Adding last action status code in view Rolloutgroup targets (#1295)

* added column action status code to RolloutGroupTarget view, currently bug too many rows
* changed JPA query to return also action status code
* added repository tests
* additional checks in tests
* improved jpa query to retrieve targets of rollout group
* added new property lastActionStatusCode to action for performance reasons
* added new property lastActionStatusCode to action for performance reasons
* adapted test cases
* fixing build problems on MAC with asciidoctor
* added testcase to ensure action status code is stored on action
* setting min push size to this value reduces multiple calls to the db
* renamed properties for consistency
* incorporated code review remarks
This commit is contained in:
Markus Block
2023-01-12 12:53:23 +01:00
committed by GitHub
parent d7796121d1
commit ed1e7d8da2
20 changed files with 449 additions and 114 deletions

View File

@@ -135,6 +135,12 @@ public interface Action extends TenantAwareBaseEntity {
*/
String getInitiatedBy();
/**
* @return the latest action status code. Performance optimization to not
* query the action status table for the last action status code.
*/
Optional<Integer> getLastActionStatusCode();
/**
* checks if the {@link #getForcedTime()} is hit by the given
* {@code hitTimeMillis}, by means if the given milliseconds are greater

View File

@@ -12,7 +12,7 @@ import org.eclipse.hawkbit.repository.Identifiable;
import org.eclipse.hawkbit.repository.model.Action.Status;
/**
*
*
* Target with action status.
*
*/
@@ -22,6 +22,8 @@ public class TargetWithActionStatus implements Identifiable<Long> {
private Status status;
private Integer lastActionStatusCode;
public TargetWithActionStatus(final Target target) {
this.target = target;
}
@@ -31,6 +33,12 @@ public class TargetWithActionStatus implements Identifiable<Long> {
this.target = target;
}
public TargetWithActionStatus(final Target target, final Status status, final Integer lastActionStatusCode) {
this.status = status;
this.target = target;
this.lastActionStatusCode = lastActionStatusCode;
}
public Target getTarget() {
return target;
}
@@ -52,4 +60,11 @@ public class TargetWithActionStatus implements Identifiable<Long> {
return target.getId();
}
public Integer getLastActionStatusCode() {
return lastActionStatusCode;
}
public void setLastActionStatusCode(final Integer lastActionStatusCode) {
this.lastActionStatusCode = lastActionStatusCode;
}
}