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

DAT-15208 :: Changeset object added back to "Update command completed successfully" JSON #4581

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,16 @@ public void cleanUp(CommandResultsBuilder resultsBuilder) {
private void logDeploymentOutcomeMdc(ChangeExecListener defaultListener, boolean success) {
String successLog = "Update command completed successfully.";
String failureLog = "Update command encountered an exception.";
try (MdcObject deploymentOutcomeMdc = Scope.getCurrentScope().addMdcValue(MdcKey.DEPLOYMENT_OUTCOME, success ? MdcValue.COMMAND_SUCCESSFUL : MdcValue.COMMAND_FAILED)) {
Scope.getCurrentScope().getLog(getClass()).info(success ? successLog : failureLog);
}

if (defaultListener instanceof DefaultChangeExecListener) {
List<ChangeSet> deployedChangeSets = ((DefaultChangeExecListener)defaultListener).getDeployedChangeSets();
int deployedChangeSetCount = deployedChangeSets.size();
ChangesetsUpdated changesetsUpdated = new ChangesetsUpdated(deployedChangeSets);
Scope.getCurrentScope().addMdcValue(MdcKey.DEPLOYMENT_OUTCOME_COUNT, String.valueOf(deployedChangeSetCount));
Scope.getCurrentScope().addMdcValue(MdcKey.CHANGESETS_UPDATED, changesetsUpdated);
}
try (MdcObject deploymentOutcomeMdc = Scope.getCurrentScope().addMdcValue(MdcKey.DEPLOYMENT_OUTCOME, success ? MdcValue.COMMAND_SUCCESSFUL : MdcValue.COMMAND_FAILED)) {
Scope.getCurrentScope().getLog(getClass()).info(success ? successLog : failureLog);
}
}

@Beta
Expand Down