Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revision deployment approval workflow #12169

Merged
merged 36 commits into from
Dec 14, 2023
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2b62ad7
publisher yaml changes
GihanAyesh Oct 6, 2023
68c4547
add revision executor
GihanAyesh Oct 6, 2023
3a3f49e
add constants
GihanAyesh Oct 6, 2023
a0e5692
admin yaml changes
GihanAyesh Oct 6, 2023
f740eaf
add functions to interface
GihanAyesh Oct 6, 2023
6bcd392
add status
GihanAyesh Oct 6, 2023
bbb3989
logic changes for workflow
GihanAyesh Oct 6, 2023
75279b0
new workflow dto
GihanAyesh Oct 6, 2023
1e14268
approval and simple executors
GihanAyesh Oct 6, 2023
9b2ec5b
auto generated code
GihanAyesh Oct 6, 2023
44d570d
check for revision deployment
GihanAyesh Oct 6, 2023
cb33ad8
admin changes
GihanAyesh Oct 6, 2023
473de80
publisher changes
GihanAyesh Oct 6, 2023
33e5eb6
auto gen content
GihanAyesh Oct 6, 2023
f05b4f7
add status to h2
GihanAyesh Oct 6, 2023
8280f6e
Refactoring code
GihanAyesh Oct 9, 2023
0e1efd0
ability to have a pending and an approved workflow
GihanAyesh Oct 12, 2023
93d8806
refactor files
GihanAyesh Oct 12, 2023
7616a57
add api revision
GihanAyesh Oct 12, 2023
0c988b8
comment changes
GihanAyesh Oct 12, 2023
231c47a
minor fix
GihanAyesh Oct 12, 2023
59ee8d3
bug fix and reformatting
GihanAyesh Oct 13, 2023
fa3c535
Merge branch 'wso2:master' into master
GihanAyesh Oct 18, 2023
c4a6119
change getAPIRevisionDeployments
GihanAyesh Oct 18, 2023
75c268f
displayOnDevportal fix
GihanAyesh Oct 18, 2023
154911f
revision status for other databases
GihanAyesh Oct 18, 2023
fc7885b
Unit tests for revision deployment new functions
GihanAyesh Oct 24, 2023
357bf2a
set autocommit to false and reformatting
GihanAyesh Nov 6, 2023
6a77f97
change complete logic
GihanAyesh Nov 9, 2023
932d40d
remove complete call
GihanAyesh Nov 15, 2023
6b6005d
Merge branch 'wso2:master' into master
GihanAyesh Nov 20, 2023
e279821
Merge branch 'wso2:master' into master
GihanAyesh Dec 1, 2023
96b8beb
Merge branch 'wso2:master' into master
GihanAyesh Dec 6, 2023
020dc14
Test fixes
GihanAyesh Dec 12, 2023
504ee62
Set simple executor as default
GihanAyesh Dec 14, 2023
7c7a2e4
minor fix
GihanAyesh Dec 14, 2023
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
Prev Previous commit
Next Next commit
change complete logic
GihanAyesh committed Nov 9, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 6a77f972d36648beea27f7970cce295f0e7858d7
Original file line number Diff line number Diff line change
@@ -5633,14 +5633,25 @@ public void deployAPIRevision(String apiId, String apiRevisionUUID,
revisionWFDto.setEnvironment(apiRevisionDeployment.getDeployment());
revisionWFDto.setRevisionId(String.valueOf(revisionId));
revisionDeploymentWFExecutor.execute(revisionWFDto);
revisionDeploymentWFExecutor.complete(revisionWFDto);
} catch (WorkflowException e) {
log.error("Unable to execute Revision Deployment Workflow for revision: " + apiRevisionUUID, e);
handleException("Unable to execute Revision Deployment Workflow for revision: " + apiRevisionUUID, e);
}

// get the workflow state once the executor is executed.
WorkflowDTO wfDTO = apiMgtDAO.retrieveWorkflow(revisionWFDto.getExternalWorkflowReference());
WorkflowStatus apiWFState = null;
if (wfDTO != null) {
apiWFState = wfDTO.getStatus();
}
// if the workflow has started, then executor should not fire again
if (WorkflowStatus.CREATED.equals(apiWFState)) {
try {
revisionDeploymentWFExecutor.complete(wfDTO);
} catch (WorkflowException e) {
log.error("Unable to update status of the revision: " + apiRevisionUUID, e);
}
}

// only send the notification if approved
// wfDTO is null when simple wf executor is used because wf state is not stored in the db.
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ public WorkflowResponse execute(WorkflowDTO workFlowDTO) throws WorkflowExceptio

workFlowDTO.setStatus(WorkflowStatus.APPROVED);
workFlowDTO.setMetadata(ENVIRONMENT_PROPERTY, revisionWorkFlowDTO.getEnvironment());
complete(workFlowDTO);
return new GeneralWorkflowResponse();
}