added triggeredBy for rollouts and autoassignment (#1017)

* added triggeredBy for rollouts and autoassignment

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* use createdBy as fallback for triggeredBy in AutoAssignChecker

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* removed 'NOT NULL' from db migration scripts for JpaTargetFilterQuery

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* fixed tests

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* fixed review findings

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* inlined redundant method in JpaDeploymentManagement

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* added tests + renamed property to 'initiatedBy'

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>

* fixed review findings

Signed-off-by: Ahmed Sayed <ahmed.sayed@bosch-si.com>
This commit is contained in:
Ahmed Sayed
2020-09-28 09:35:19 +02:00
committed by GitHub
parent e82b9cee70
commit ba96c68eb0
27 changed files with 173 additions and 44 deletions

View File

@@ -76,13 +76,14 @@ public interface DeploymentManagement {
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_UPDATE_TARGET)
List<DistributionSetAssignmentResult> assignDistributionSets(
@Valid @NotEmpty List<DeploymentRequest> deploymentRequests);
List<DistributionSetAssignmentResult> assignDistributionSets(@Valid @NotEmpty List<DeploymentRequest> deploymentRequests);
/**
* Assigns {@link DistributionSet}s to {@link Target}s according to the
* {@link DeploymentRequest}.
*
* @param initiatedBy
* the username of the user who initiated the assignment
* @param deploymentRequests
* information about all target-ds-assignments that shall be made
* @param actionMessage
@@ -107,7 +108,7 @@ public interface DeploymentManagement {
*
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_UPDATE_TARGET)
List<DistributionSetAssignmentResult> assignDistributionSets(
List<DistributionSetAssignmentResult> assignDistributionSets(String initiatedBy,
@Valid @NotEmpty List<DeploymentRequest> deploymentRequests, String actionMessage);
/**

View File

@@ -130,6 +130,11 @@ public interface Action extends TenantAwareBaseEntity {
*/
String getExternalRef();
/**
* @return the username that initiated this action (directly or indirectly)
*/
String getInitiatedBy();
/**
* checks if the {@link #getForcedTime()} is hit by the given
* {@code hitTimeMillis}, by means if the given milliseconds are greater

View File

@@ -77,4 +77,8 @@ public interface TargetFilterQuery extends TenantAwareBaseEntity {
*/
Optional<Integer> getAutoAssignWeight();
/**
* @return the user that triggered the auto assignment
*/
String getAutoAssignInitiatedBy();
}