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

Swapped the return codes to highlight partial success #914

Merged
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 @@ -95,7 +95,7 @@ async function run(): Promise<number> {
run()
.then((result) => {
if (result === -1) {
tl.setResult(tl.TaskResult.SucceededWithIssues, "Skipped release notes generation as redeploy");
tl.setResult(tl.TaskResult.SucceededWithIssues, "Release notes generation had an issue and was only partially successful");
} else {
tl.setResult(tl.TaskResult.Succeeded, "");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,7 @@ export async function generateReleaseNotes(
var currentRelease: Release;
var currentBuild: Build;
var currentStage: TimelineRecord;
var hasBeenTimeout = false;

try {

Expand Down Expand Up @@ -1308,6 +1309,7 @@ export async function generateReleaseNotes(
} catch (ex) {
agentApi.logInfo(`The most common reason for the task to fail is due API ECONNRESET issues. To avoid this failing the pipeline these will be treated as warnings and an attempt to generate any release notes possible`);
agentApi.logWarn(ex);
hasBeenTimeout = true;
}

try {
Expand Down Expand Up @@ -1365,7 +1367,12 @@ export async function generateReleaseNotes(

agentApi.writeVariable(outputVariableName, outputString.toString());

resolve(0);
if (hasBeenTimeout) {
// we want to return -1 so flagged as succeeded with issues
resolve(-1);
} else {
resolve(0);
}
} else {
reject ("Missing template file");
}
Expand Down