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
5 changes: 5 additions & 0 deletions workspaces/azure-devops/.changeset/khaki-shrimps-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage-community/plugin-scaffolder-backend-module-azure-devops': minor
---

**BREAKING** Fixed bug in `createAzureDevopsRunPipelineAction` where `pipelineRun.result` returned an integer instead of the corresponding string
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ describe('publish:azure', () => {
it('should output pipelineRunStatus if available', async () => {
mockPipelineClient.runPipeline.mockImplementation(() => ({
_links: { web: { href: 'http://pipeline-run-url.com' } },
result: 'InProgress',
result: '1',
}));
mockPipelineClient.getRun.mockImplementation(() => ({
_links: { web: { href: 'http://pipeline-run-url.com' } },
result: 'InProgress',
result: '1',
}));

await action.handler({
Expand All @@ -264,7 +264,7 @@ describe('publish:azure', () => {
);
expect(mockContext.output).toHaveBeenCalledWith(
'pipelineRunStatus',
'InProgress',
'Succeeded',
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,11 @@ export function createAzureDevopsRunPipelineAction(options: {
// Log the pipeline run result if available
if (pipelineRun.result) {
ctx.logger.info(
`Pipeline run result: ${pipelineRun.result.toString()}`,
`Pipeline run result: ${
pipelineRun.result
? RunResult[pipelineRun.result]
: RunResult.Unknown
}`,
);
}

Expand All @@ -227,7 +231,10 @@ export function createAzureDevopsRunPipelineAction(options: {

ctx.output('pipelineRunUrl', pipelineRun._links.web.href);
ctx.output('pipelineRunId', pipelineRun.id!);
ctx.output('pipelineRunStatus', pipelineRun.result?.toString());
ctx.output(
'pipelineRunStatus',
pipelineRun.result ? RunResult[pipelineRun.result] : RunResult.Unknown,
);
ctx.output('pipelineTimeoutExceeded', timeoutExceeded);
ctx.output('pipelineOutput', pipelineRun.variables);
},
Expand Down