From ce09f233d9019a8c595b2dc33ff72cbe35052a4a Mon Sep 17 00:00:00 2001 From: Sander van Delden <38953576+SanderDelden@users.noreply.github.com> Date: Thu, 19 Feb 2026 13:08:50 +0100 Subject: [PATCH 1/3] fix(azure-devops): use enumerator to return pipeline run result Signed-off-by: Sander van Delden <38953576+SanderDelden@users.noreply.github.com> --- .../azure-devops/.changeset/khaki-shrimps-kick.md | 5 +++++ .../src/actions/devopsRunPipeline.test.ts | 6 +++--- .../src/actions/devopsRunPipeline.ts | 11 +++++++++-- 3 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 workspaces/azure-devops/.changeset/khaki-shrimps-kick.md diff --git a/workspaces/azure-devops/.changeset/khaki-shrimps-kick.md b/workspaces/azure-devops/.changeset/khaki-shrimps-kick.md new file mode 100644 index 00000000000..46c7a5024e0 --- /dev/null +++ b/workspaces/azure-devops/.changeset/khaki-shrimps-kick.md @@ -0,0 +1,5 @@ +--- +'@backstage-community/plugin-scaffolder-backend-module-azure-devops': patch +--- + +Fixed bug in createAzureDevopsRunPipelineAction where pipelineRun.result returned an integer instead of the corresponding string diff --git a/workspaces/azure-devops/plugins/scaffolder-backend-module-azure-devops/src/actions/devopsRunPipeline.test.ts b/workspaces/azure-devops/plugins/scaffolder-backend-module-azure-devops/src/actions/devopsRunPipeline.test.ts index 3bceebb5247..dbef6968fe2 100644 --- a/workspaces/azure-devops/plugins/scaffolder-backend-module-azure-devops/src/actions/devopsRunPipeline.test.ts +++ b/workspaces/azure-devops/plugins/scaffolder-backend-module-azure-devops/src/actions/devopsRunPipeline.test.ts @@ -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({ @@ -264,7 +264,7 @@ describe('publish:azure', () => { ); expect(mockContext.output).toHaveBeenCalledWith( 'pipelineRunStatus', - 'InProgress', + 'Succeeded', ); }); diff --git a/workspaces/azure-devops/plugins/scaffolder-backend-module-azure-devops/src/actions/devopsRunPipeline.ts b/workspaces/azure-devops/plugins/scaffolder-backend-module-azure-devops/src/actions/devopsRunPipeline.ts index 0de7ff319dd..9ae23cf9de2 100644 --- a/workspaces/azure-devops/plugins/scaffolder-backend-module-azure-devops/src/actions/devopsRunPipeline.ts +++ b/workspaces/azure-devops/plugins/scaffolder-backend-module-azure-devops/src/actions/devopsRunPipeline.ts @@ -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 + }`, ); } @@ -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); }, From 30b6955cb89a98de3beb78ed13934966bafd6b97 Mon Sep 17 00:00:00 2001 From: Sander <38953576+SanderDelden@users.noreply.github.com> Date: Mon, 23 Feb 2026 11:26:36 +0100 Subject: [PATCH 2/3] Update workspaces/azure-devops/.changeset/khaki-shrimps-kick.md Co-authored-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com> Signed-off-by: Sander <38953576+SanderDelden@users.noreply.github.com> --- workspaces/azure-devops/.changeset/khaki-shrimps-kick.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspaces/azure-devops/.changeset/khaki-shrimps-kick.md b/workspaces/azure-devops/.changeset/khaki-shrimps-kick.md index 46c7a5024e0..19d2b46903b 100644 --- a/workspaces/azure-devops/.changeset/khaki-shrimps-kick.md +++ b/workspaces/azure-devops/.changeset/khaki-shrimps-kick.md @@ -2,4 +2,4 @@ '@backstage-community/plugin-scaffolder-backend-module-azure-devops': patch --- -Fixed bug in createAzureDevopsRunPipelineAction where pipelineRun.result returned an integer instead of the corresponding string +**BREAKING** Fixed bug in `createAzureDevopsRunPipelineAction` where `pipelineRun.result` returned an integer instead of the corresponding string From 1c357bd6475a78a1c884f37aaf05be377132e678 Mon Sep 17 00:00:00 2001 From: Andre Wanlin <67169551+awanlin@users.noreply.github.com> Date: Thu, 26 Feb 2026 05:27:04 -0600 Subject: [PATCH 3/3] Update workspaces/azure-devops/.changeset/khaki-shrimps-kick.md Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com> --- workspaces/azure-devops/.changeset/khaki-shrimps-kick.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspaces/azure-devops/.changeset/khaki-shrimps-kick.md b/workspaces/azure-devops/.changeset/khaki-shrimps-kick.md index 19d2b46903b..e6251a08bdb 100644 --- a/workspaces/azure-devops/.changeset/khaki-shrimps-kick.md +++ b/workspaces/azure-devops/.changeset/khaki-shrimps-kick.md @@ -1,5 +1,5 @@ --- -'@backstage-community/plugin-scaffolder-backend-module-azure-devops': patch +'@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