Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

public class ExecutionDetailResponse {

private String executionId;
private Long executionId;
private long environmentId;
private long serviceId;
private String runnerId;
Expand All @@ -32,7 +32,7 @@ public class ExecutionDetailResponse {
public ExecutionDetailResponse() {
}

public ExecutionDetailResponse(String executionId, long environmentId, long serviceId, String runnerId,
public ExecutionDetailResponse(Long executionId, long environmentId, long serviceId, String runnerId,
Instant startedAt, ClientSubmissionRequest clientSubmission, PipelineResponse pipeline) {
this.executionId = executionId;
this.environmentId = environmentId;
Expand All @@ -43,8 +43,8 @@ public ExecutionDetailResponse(String executionId, long environmentId, long serv
this.pipeline = pipeline;
}

public String getExecutionId() { return executionId; }
public void setExecutionId(String executionId) { this.executionId = executionId; }
public Long getExecutionId() { return executionId; }
public void setExecutionId(Long executionId) { this.executionId = executionId; }

public long getEnvironmentId() { return environmentId; }
public void setEnvironmentId(long environmentId) { this.environmentId = environmentId; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

public class ExecutionPlanResponse {

private String executionId;
private Long executionId;

private CloudExecutionAction action;

Expand Down Expand Up @@ -50,28 +50,28 @@ public ExecutionPlanResponse() {
}

public ExecutionPlanResponse(CloudExecutionAction action,
String executionId,
Long executionId,
LockInfoResponse lock) {
this(action, executionId, lock, Collections.emptyList());
}

public ExecutionPlanResponse(CloudExecutionAction action,
String executionId,
Long executionId,
LockInfoResponse lock,
List<StageResponse> stages) {
this(action, executionId, lock, stages, false);
}

public ExecutionPlanResponse(CloudExecutionAction action,
String executionId,
Long executionId,
LockInfoResponse lock,
List<StageResponse> stages,
boolean synchronizedMarks) {
this(action, executionId, lock, stages, null, synchronizedMarks);
}

public ExecutionPlanResponse(CloudExecutionAction action,
String executionId,
Long executionId,
LockInfoResponse lock,
List<StageResponse> stages,
PipelineResultResponse pipelineResult,
Expand All @@ -88,11 +88,11 @@ public void setAction(CloudExecutionAction action) {
this.action = action;
}

public String getExecutionId() {
public Long getExecutionId() {
return executionId;
}

public void setExecutionId(String executionId) {
public void setExecutionId(Long executionId) {
this.executionId = executionId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

public class ExecutionSummaryResponse {

private String executionId;
private Long executionId;
private long environmentId;
private long serviceId;
private String runnerId;
Expand All @@ -28,16 +28,16 @@ public class ExecutionSummaryResponse {
public ExecutionSummaryResponse() {
}

public ExecutionSummaryResponse(String executionId, long environmentId, long serviceId, String runnerId, Instant startedAt) {
public ExecutionSummaryResponse(Long executionId, long environmentId, long serviceId, String runnerId, Instant startedAt) {
this.executionId = executionId;
this.environmentId = environmentId;
this.serviceId = serviceId;
this.runnerId = runnerId;
this.startedAt = startedAt;
}

public String getExecutionId() { return executionId; }
public void setExecutionId(String executionId) { this.executionId = executionId; }
public Long getExecutionId() { return executionId; }
public void setExecutionId(Long executionId) { this.executionId = executionId; }

public long getEnvironmentId() { return environmentId; }
public void setEnvironmentId(long environmentId) { this.environmentId = environmentId; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ private ExecutionPlan buildNextExecutionPlan(List<AbstractLoadedStage> loadedSta
ExecutionPlanResponse response,
Lock lock) {
return ExecutionPlan.newExecution(
response.getExecutionId(),
// The server identity is a Long (the executions PK). The shared core ExecutionPlan/AuditEntry keep a
// String executionId (used by Community local audit stores too), so convert at the cloud boundary.
String.valueOf(response.getExecutionId()),
lock,
CloudExecutionPlanMapper.getExecutableStages(response, loadedStages)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ void shouldThrowManualInterventionOnStageValidate() {
void shouldBuildAbortPlanFromAbortResponse() {
List<AbstractLoadedStage> loadedStages = Arrays.asList(buildStage("stage-1", change1, change2));
ExecutionPlanResponse response = new ExecutionPlanResponse(
CloudExecutionAction.ABORT, "exec-1", null,
CloudExecutionAction.ABORT, 1L, null,
Arrays.asList(buildStageResponse("stage-1", 0,
changeResponse(change1.getId(), CloudChangeAction.MANUAL_INTERVENTION),
changeResponse(change2.getId(), CloudChangeAction.APPLY)))
Expand Down Expand Up @@ -372,7 +372,7 @@ private static DefaultLoadedStage buildStage(String name, AbstractLoadedChange..
}

private static ExecutionPlanResponse buildResponse(StageResponse... stages) {
return new ExecutionPlanResponse(CloudExecutionAction.EXECUTE, "exec-1", null, Arrays.asList(stages));
return new ExecutionPlanResponse(CloudExecutionAction.EXECUTE, 1L, null, Arrays.asList(stages));
}

private static StageResponse buildStageResponse(String name, int order, ChangeResponse... changes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void shouldReturnAbortPlanWhenServerReturnsAbort() {
CloudExecutionPlanner planner = buildPlanner(Collections.emptyList());

ExecutionPlanResponse response = new ExecutionPlanResponse(
CloudExecutionAction.ABORT, "exec-1", null,
CloudExecutionAction.ABORT, 1L, null,
Collections.singletonList(new StageResponse("stage-1", 0,
Collections.singletonList(new ChangeResponse(change1.getId(), CloudChangeAction.MANUAL_INTERVENTION))))
);
Expand All @@ -178,7 +178,7 @@ void shouldReturnAbortPlanWhenServerReturnsAbortWithNoMIChanges() {
CloudExecutionPlanner planner = buildPlanner(Collections.emptyList());

ExecutionPlanResponse response = new ExecutionPlanResponse(
CloudExecutionAction.ABORT, "exec-1", null,
CloudExecutionAction.ABORT, 1L, null,
Collections.singletonList(new StageResponse("stage-1", 0,
Collections.singletonList(new ChangeResponse(change1.getId(), CloudChangeAction.APPLY))))
);
Expand Down Expand Up @@ -208,7 +208,7 @@ void shouldIncludeAuditMarksInExecutionRequest() {
CloudExecutionPlanner planner = buildPlanner(Arrays.asList(marker1, marker2));

ExecutionPlanResponse response = new ExecutionPlanResponse(
CloudExecutionAction.CONTINUE, "exec-1", null,
CloudExecutionAction.CONTINUE, 1L, null,
Collections.singletonList(new StageResponse("stage-1", 0, Arrays.asList(
new ChangeResponse(change1.getId(), CloudChangeAction.SKIP),
new ChangeResponse(change2.getId(), CloudChangeAction.APPLY))))
Expand Down Expand Up @@ -238,7 +238,7 @@ void shouldSendNoneStatusWhenNoMarks() {
CloudExecutionPlanner planner = buildPlanner(Collections.emptyList());

ExecutionPlanResponse response = new ExecutionPlanResponse(
CloudExecutionAction.CONTINUE, "exec-1", null,
CloudExecutionAction.CONTINUE, 1L, null,
Collections.singletonList(new StageResponse("stage-1", 0,
Collections.singletonList(new ChangeResponse(change1.getId(), CloudChangeAction.SKIP))))
);
Expand Down Expand Up @@ -352,7 +352,7 @@ void shouldNotClearNewMarksWrittenAfterRequest() {

private ExecutionPlanResponse buildSyncResponse(CloudExecutionAction action, boolean synchronizedMarks) {
ExecutionPlanResponse response = new ExecutionPlanResponse(
action, "exec-1", null,
action, 1L, null,
Collections.singletonList(new StageResponse("stage-1", 0,
Arrays.asList(
new ChangeResponse(change1.getId(), CloudChangeAction.SKIP),
Expand Down Expand Up @@ -396,7 +396,7 @@ void continueWithPipelineResultWritesVerdict() {
Collections.emptyList())
));
ExecutionPlanResponse response = new ExecutionPlanResponse(
CloudExecutionAction.CONTINUE, "exec-1", null, Collections.emptyList(),
CloudExecutionAction.CONTINUE, 1L, null, Collections.emptyList(),
pipelineResult, false);
when(client.createExecution(any(), any(), anyLong())).thenReturn(response);

Expand Down Expand Up @@ -440,7 +440,7 @@ void executeWithPipelineResultUpgradesAlreadyAppliedRecords() {
lockInfo.setAcquisitionId("acq-1");
lockInfo.setAcquiredForMillis(60000L);
ExecutionPlanResponse response = new ExecutionPlanResponse(
CloudExecutionAction.EXECUTE, "exec-1", lockInfo,
CloudExecutionAction.EXECUTE, 1L, lockInfo,
Collections.singletonList(new StageResponse("stage-1", 0,
Collections.singletonList(
new ChangeResponse(change2.getId(), CloudChangeAction.APPLY)))),
Expand Down Expand Up @@ -477,7 +477,7 @@ void abortLeavesPipelineRunUntouched() {
// ABORT carries no pipelineResult — validate() doesn't require it, and the planner
// must not attempt to apply one (NPE-guard).
ExecutionPlanResponse response = new ExecutionPlanResponse(
CloudExecutionAction.ABORT, "exec-1", null,
CloudExecutionAction.ABORT, 1L, null,
Collections.singletonList(new StageResponse("stage-1", 0,
Collections.singletonList(
new ChangeResponse(change1.getId(), CloudChangeAction.APPLY))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void afterEach() {
@DisplayName("Should run successfully happy path")
void happyPath() {
//GIVEN
String executionId = "execution-1";
long executionId = 1L;
mockRunnerServer
.addSimpleStageExecutionPlan(executionId, "changes", auditEntryExpectations)
.addExecutionWithAllChangesRequestResponse(executionId)
Expand All @@ -157,7 +157,7 @@ void shouldPerformRightCallsWhenAwaitExecuteContinue() {
try (MockedConstruction<ThreadSleeper> lockThreadSleeperConstructors = Mockito.mockConstruction(ThreadSleeper.class)) {


String executionId = "execution-1";
long executionId = 1L;
mockRunnerServer
.addSimpleStageExecutionPlan(executionId, "changes", auditEntryExpectations)
.addExecutionAwaitRequestResponse(executionId)
Expand Down Expand Up @@ -185,7 +185,7 @@ void shouldPerformRightCallsWhenAwaitExecuteContinue() {
void shouldWaitAndEventuallyAbort() {
///GIVEN
String acquisitionId = UUID.randomUUID().toString();
String executionId = "execution-1";
long executionId = 1L;
mockRunnerServer
.addSimpleStageExecutionPlan(executionId, "changes", auditEntryExpectations)
.addExecutionAwaitRequestResponse(executionId, 5000L, acquisitionId)
Expand Down Expand Up @@ -218,7 +218,7 @@ void shouldWaitAndEventuallyAbort() {
@DisplayName("Should wait and retry when lock is initially blocked eventually released")
void shouldWaitAndRetry() {
//GIVEN
String executionId = "execution-1";
long executionId = 1L;
String acquisitionId = UUID.randomUUID().toString();
mockRunnerServer
.addSimpleStageExecutionPlan(executionId, "changes", auditEntryExpectations)
Expand All @@ -243,7 +243,7 @@ void shouldWaitAndRetry() {
@DisplayName("Should continue and not run anything if server returns CONTINUE at first")
void shouldContinue() {
mockRunnerServer
.addSimpleStageExecutionPlan("execution-1", "changes", auditEntryExpectations)
.addSimpleStageExecutionPlan(1L, "changes", auditEntryExpectations)
.addExecutionContinueRequestResponse()
.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void afterEach() {
@DisplayName("Should run successfully happy path")
void happyPath() {
//GIVEN
String executionId = "execution-1";
long executionId = 1L;
mockRunnerServer
.addSimpleStageExecutionPlan(executionId, "changes", auditEntries)
.addExecutionWithAllChangesRequestResponse(executionId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void afterEach() throws Exception {
@Test
@DisplayName("Should follow the targetSystem lifecycle")
void happyPath() {
String executionId = "execution-1";
long executionId = 1L;
String stageName = "stage-1";

PrototypeClientSubmission prototypeClientSubmission = new PrototypeClientSubmission(
Expand Down Expand Up @@ -191,7 +191,7 @@ void happyPath() {
@Test
@DisplayName("Should rollback the ongoing deletion when a change fails")
void failedChanges() {
String executionId = "execution-1";
long executionId = 1L;
String stageName = "stage-1";

PrototypeClientSubmission prototypeClientSubmission = new PrototypeClientSubmission(
Expand Down Expand Up @@ -246,7 +246,7 @@ void failedChanges() {
@Disabled("adapt when adding cloud support")
@DisplayName("Should send ongoing change in execution when is present in local database")
void shouldSendOngoingChangeInExecutionPlan() {
String executionId = "execution-1";
long executionId = 1L;
String stageName = "stage-1";

PrototypeClientSubmission prototypeClientSubmission = new PrototypeClientSubmission(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void afterEach() throws Exception {
@Test
@DisplayName("Should follow the transactioner lifecycle")
void happyPath() {
String executionId = "execution-1";
long executionId = 1L;
String stageName = "stage-1";

PrototypeClientSubmission prototypeClientSubmission = new PrototypeClientSubmission(
Expand Down Expand Up @@ -178,7 +178,7 @@ void happyPath() {
@Test
@DisplayName("Should rollback the ongoing deletion when a change fails")
void failedChanges() {
String executionId = "execution-1";
long executionId = 1L;
String stageName = "stage-1";

PrototypeClientSubmission prototypeClientSubmission = new PrototypeClientSubmission(
Expand Down Expand Up @@ -238,7 +238,7 @@ void failedChanges() {
@Disabled("adapt when adding cloud support")
@DisplayName("Should send ongoing change in execution when is present in local database")
void shouldSendOngoingChangeInExecutionPlan() {
String executionId = "execution-1";
long executionId = 1L;
String stageName = "stage-1";

PrototypeClientSubmission prototypeClientSubmission = new PrototypeClientSubmission(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void afterEach() throws Exception {
@Test
@DisplayName("Should follow the targetSystem lifecycle")
void happyPath() {
String executionId = "execution-1";
long executionId = 1L;
String stageName = "stage-1";

PrototypeClientSubmission prototypeClientSubmission = new PrototypeClientSubmission(
Expand Down Expand Up @@ -184,7 +184,7 @@ void happyPath() {
@Test
@DisplayName("Should rollback the ongoing deletion when a change fails")
void failedChanges() {
String executionId = "execution-1";
long executionId = 1L;
String stageName = "stage-1";

PrototypeClientSubmission prototypeClientSubmission = new PrototypeClientSubmission(
Expand Down Expand Up @@ -240,7 +240,7 @@ void failedChanges() {
@Disabled("adapt when adding cloud support")
@DisplayName("Should send ongoing change in execution when is present in local database")
void shouldSendOngoingChangeInExecutionPlan() {
String executionId = "execution-1";
long executionId = 1L;
String stageName = "stage-1";

PrototypeClientSubmission prototypeClientSubmission = new PrototypeClientSubmission(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void afterEach() throws Exception {
@Test
@DisplayName("Should follow the targetSystem lifecycle")
void happyPath() {
String executionId = "execution-1";
long executionId = 1L;
String stageName = "stage-1";

PrototypeClientSubmission prototypeClientSubmission = new PrototypeClientSubmission(
Expand Down Expand Up @@ -182,7 +182,7 @@ void happyPath() {
@Test
@DisplayName("Should rollback the ongoing deletion when a change fails")
void failedChanges() {
String executionId = "execution-1";
long executionId = 1L;
String stageName = "stage-1";

PrototypeClientSubmission prototypeClientSubmission = new PrototypeClientSubmission(
Expand Down Expand Up @@ -242,7 +242,7 @@ void failedChanges() {
@Disabled("adapt when adding cloud support")
@DisplayName("Should send ongoing change in execution when is present in local database")
void shouldSendOngoingChangeInExecutionPlan() {
String executionId = "execution-1";
long executionId = 1L;
String stageName = "stage-1";

PrototypeClientSubmission prototypeClientSubmission = new PrototypeClientSubmission(
Expand Down
Loading
Loading