[#2429] Add completeness property for software modules (#2765)

* add `min artifacts` requirement on the Software Module Type level for Software Module completeness
* removed `complete` Distribution Set property from DB - calculated runtime
* Distribution Set and Software Module completeness is calcualted on demand in memory (TODO: implement cache)
* locking of Software Module now requires the software module to be `completed`
* removed 'complete' search field for DistributionSet type. Still keep (DEPRECATED) limited support for search with 'complete' -
  only on the first level of expression and with AND. I.e. complete==true, complete==false and id=in=(1, 3) is suppoted,
  while complete==false or id=in=(1, 3) and id=in(1, 3) and (type==os and complete==true) are not

Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2025-10-22 09:57:45 +03:00
committed by GitHub
parent f1c3d0175e
commit e154e1b18a
32 changed files with 377 additions and 155 deletions

View File

@@ -147,11 +147,6 @@ public class MgmtDistributionSet extends MgmtNamedEntity {
example = "OS (FW) mandatory, runtime (FW) and app (SW) optional")
private String typeName;
@Schema(description = """
True of the distribution set software module setup is complete as defined by the
distribution set type""", example = "true")
private Boolean complete;
@Schema(description = "If the distribution set is locked", example = "true")
private boolean locked;
@@ -167,4 +162,8 @@ public class MgmtDistributionSet extends MgmtNamedEntity {
private boolean requiredMigrationStep;
private List<MgmtSoftwareModule> modules = new ArrayList<>();
@Schema(description = "True of the distribution set software module setup is complete as defined by the distribution set type",
example = "true")
private Boolean complete;
}

View File

@@ -93,4 +93,7 @@ public class MgmtSoftwareModule extends MgmtNamedEntity {
@Schema(description = "If the software module is deleted", example = "false")
private boolean deleted;
@Schema(description = "True of the software module has sufficient number of artifacts", example = "true")
private Boolean complete;
}

View File

@@ -40,6 +40,7 @@ import org.eclipse.hawkbit.mgmt.json.model.MgmtTypeEntity;
"description" : "Updated description.",
"key" : "application",
"maxAssignments" : 2147483647,
"minArtifacts": 1,
"deleted" : false,
"_links" : {
"self" : {
@@ -54,7 +55,9 @@ public class MgmtSoftwareModuleType extends MgmtTypeEntity {
@Schema(description = "The technical identifier of the entity", example = "83")
private Long id;
@Schema(description = "Software modules of that type can be assigned at this maximum number " +
"(e.g. operating system only once)", example = "1")
@Schema(description = "The minimum number of artifacts a software module if this type should have in order to be completed", example = "1")
private int minArtifacts;
@Schema(description = "Software modules of this type can be assigned at this maximum number (e.g. operating system only once)", example = "1")
private int maxAssignments;
}

View File

@@ -33,6 +33,9 @@ public class MgmtSoftwareModuleTypeRequestBodyPost extends MgmtSoftwareModuleTyp
@Schema(example = "Example key")
private String key;
@Schema(description = "The minimum number of artifacts a software module if this type should have in order to be completed", example = "1")
private int minArtifacts;
@JsonProperty(required = true)
@Schema(example = "1")
private int maxAssignments;