From 64bdced68278cd78107607348be9791d94e96cc3 Mon Sep 17 00:00:00 2001
From: Avgustin Marinov
Date: Tue, 28 Oct 2025 12:40:37 +0200
Subject: [PATCH] Tune/fix action cleanup tenant properties (#2782)
* actions.cleanup.onQuotaHit.percent -> action.cleanup.onQuotaHit.percent
* action.cleanup.enabled - removed - instead enabled / disable <=> expire < / >= 0
* action.cleanup.actionExpiry -> action.cleanup.auto.expiry and action.cleanup.auto.status - so both are under action.cleanup.auto, and differentiate from on quota hit
* auto db convert of props with one backward incompatibility - if you had action.cleanup.enabled=true and not set action.cleanup.actionExpiry (assuming default 30 days) - auto cleanup will be disabled
you should set action.cleanup.auto.expiry=2592000000 in order to get the old behavior
* Note that if you have configured global action cleanup the properties are changed also this config you shall change manually
Signed-off-by: Avgustin Marinov
---
docs/rest-api/mgmt.html | 2 +-
.../MgmtSystemTenantConfigurationValue.java | 5 +-
.../TenantConfigurationProperties.java | 17 ++---
.../hawkbit-repository-defaults.properties | 22 +++---
.../H2/V1_12_35__cleanup_prop_changes__H2.sql | 4 ++
.../V1_12_35__cleanup_prop_changes__MYSQL.sql | 4 ++
...2_36__cleanup_prop_changes__POSTGRESQL.sql | 4 ++
.../jpa/JpaRepositoryConfiguration.java | 12 ++--
.../jpa/autocleanup/AutoActionCleanup.java | 72 ++++++-------------
.../jpa/autocleanup/AutoCleanupScheduler.java | 29 +++++---
.../jpa/autocleanup/CleanupTask.java | 27 -------
.../management/JpaDeploymentManagement.java | 3 +-
.../autocleanup/AutoActionCleanupTest.java | 22 +++---
.../autocleanup/AutoCleanupSchedulerTest.java | 11 ++-
.../management/DeploymentManagementTest.java | 6 +-
.../management/ManagementSecurityTest.java | 2 +-
16 files changed, 99 insertions(+), 143 deletions(-)
create mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/H2/V1_12_35__cleanup_prop_changes__H2.sql
create mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/MYSQL/V1_12_35__cleanup_prop_changes__MYSQL.sql
create mode 100644 hawkbit-repository/hawkbit-repository-jpa-flyway/src/main/resources/db/migration/POSTGRESQL/V1_12_36__cleanup_prop_changes__POSTGRESQL.sql
delete mode 100644 hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/autocleanup/CleanupTask.java
diff --git a/docs/rest-api/mgmt.html b/docs/rest-api/mgmt.html
index 0cf78abab..8bbfcb6bb 100644
--- a/docs/rest-api/mgmt.html
+++ b/docs/rest-api/mgmt.html
@@ -3916,7 +3916,7 @@ available fields.
" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg">Generated server url
http://localhost:53002/rest/v1/system/configs/{keyName}
Response samples
Content typeapplication/json