fix(azure-devops): use absolute URL and compound repository ID in pipeline permit action - #8181
Merged
awanlin merged 1 commit intoApr 11, 2026
Conversation
…eline permit action
The azure:pipeline:permit action passed a relative URL to HttpClient.patch(),
which resolved to localhost:80 causing ECONNREFUSED errors. Fixed by prefixing
the request URL with the full Azure DevOps base URL.
For repository resource types, the Azure DevOps Pipeline Permissions API requires
a compound resource ID in {projectId}.{repositoryId} format. Added automatic
resolution via the Core API when the provided resourceId does not already contain
a dot separator.
Signed-off-by: AlperOnder <alperonder980@gmail.com>
Contributor
Changed Packages
|
Contributor
|
Hi @EsmerlinJM, as the initial author of this action can you give this PR a quick look, please? |
Contributor
|
HI @artificialvirus, thanks for the contribution, I'm away at BackstageCon/KubeCon this week and won't have time to review this for a bit, if I have time it will be this Friday if not it won't be till the Friday after. Just wanted to give you a heads up. I also asked the initial author of this action to review as well. 👍 |
awanlin
approved these changes
Apr 11, 2026
awanlin
left a comment
Contributor
There was a problem hiding this comment.
Sorry this took as long as it did to review @artificialvirus, let's ship it 🚀
evanlankveld
pushed a commit
to evanlankveld/community-plugins
that referenced
this pull request
Apr 28, 2026
…eline permit action (backstage#8181) The azure:pipeline:permit action passed a relative URL to HttpClient.patch(), which resolved to localhost:80 causing ECONNREFUSED errors. Fixed by prefixing the request URL with the full Azure DevOps base URL. For repository resource types, the Azure DevOps Pipeline Permissions API requires a compound resource ID in {projectId}.{repositoryId} format. Added automatic resolution via the Core API when the provided resourceId does not already contain a dot separator. Signed-off-by: AlperOnder <alperonder980@gmail.com> Signed-off-by: Emiel van Lankveld <evanlankveld@bol.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey, I just made a Pull Request!
Bug Fix:
azure:pipeline:permitaction — two issues resolvedBug 1: Relative URL causes ECONNREFUSED
The
azure:pipeline:permitaction constructs a request URL as a relative path:When passed to
HttpClient.patch(), this relative URL resolves tohttp://localhost:80/...instead of the intended Azure DevOps API endpoint, causingECONNREFUSEDerrors.Fix: Prefix the URL with the full Azure DevOps base URL (
${url}/):Bug 2: Repository resources require compound resource ID
The Azure DevOps Pipeline Permissions API requires repository resource IDs in the compound format
{projectId}.{repositoryId}. Passing only the repository GUID results in400 Bad Request — "Invalid resource id".Fix: For
resourceType === 'repository', automatically resolve the project GUID via the Core API and construct the compound ID. If the providedresourceIdalready contains a dot (i.e., the caller already provided a compound ID), it is passed through unchanged.✔️ Checklist
Signed-off-byline in the message. (more info)Test coverage (8 tests, all passing)
{projectId}.{repositoryId})getCoreApi().getProject()called, compound ID constructed.skips resolutiongetCoreApiNOT called for endpoint/variablegroup typesInputErrorwhen project not foundFiles changed (3 files, +142 / -4)
plugins/scaffolder-backend-module-azure-devops/src/actions/devopsPermitPipeline.ts— Both fixesplugins/scaffolder-backend-module-azure-devops/src/actions/devopsPermitPipeline.test.ts— Updated + 4 new tests.changeset/fix-pipeline-permit-url-and-repo-id.md— Patch changeset