Repository navigation
Fix incorrect Azure DevOps PR URL in review markdown output - #21
Merged
Merged
Conversation
- Add PRURL field to PRRef to store the canonical PR web URL - Populate PRURL from URL parsing (pullrequest/ for ADO, pull/ for GitHub) - Carry PRURL through ResolveFromPullRequestURL - Enrich PRURL from _links.web.href via az repos pr show CLI - Update renderMarkdown/renderPRLine to use pre-built prURL - Fall back to buildPRURL when PRURL is not set - Add tests for URL parsing, enrichment, and render functions Co-authored-by: richardthombs <1511599+richardthombs@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix incorrect URL for PR in output
Fix incorrect Azure DevOps PR URL in review markdown output
Mar 19, 2026
richardthombs
marked this pull request as ready for review
March 19, 2026 15:03
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.
Azure DevOps PR URLs use
/pullrequest/{id}, but the review output was emitting/pull/{id}— a format only valid for GitHub. The fix uses the canonical URL from the ADO CLI/API, falling back to the input URL when enrichment is unavailable.Changes
types.PRRef— AddedPRURL stringfield to carry the canonical PR web URL through the pipeline.pr_url.go— PopulatesPRURLon parse with the correctly-formatted URL (/pullrequest/{id}for ADO,/pull/{id}for GitHub), serving as the fallback.resolver.go—ResolveFromPullRequestURLcarriesPRURLfrom the parsed context into the returnedPRRef.enricher.go—enrichAzureDevOpsnow queries_links.web.hrefviaaz repos pr showto capture the canonical ADO web URL, overriding the parsed fallback when available.render.go—renderMarkdown/renderPRLinenow accept a pre-builtprURLdirectly rather than reconstructing fromrepoURL + prID.review.go— UsesprRef.PRURLwhen set; falls back tobuildPRURL(repoURL, prID)(preserving existing GitHub behaviour).Before / after:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/acme/repo/pulls/42/usr/bin/gh gh api repos/acme/repo/pulls/42 --jq .base.ref,.base.sha(http block)/usr/bin/gh gh api repos/acme/repo/pulls/42 --jq .base.ref,.base.sha ux-amd64/src/run.(http block)/usr/bin/gh gh api repos/acme/repo/pulls/42 --jq .base.ref,.base.sha ux-amd64/src/run-c ux-amd64/src/ven-I ux-amd64/pkg/tool/linux_amd64/vet(http block)https://api.github.com/repos/acme/repo/pulls/73/usr/bin/gh gh api repos/acme/repo/pulls/73 --jq .base.ref,.base.sha ux-amd64/src/run.(http block)/usr/bin/gh gh api repos/acme/repo/pulls/73 --jq .base.ref,.base.sha _.a 0.1-go1.25.0.lin--64 rg/toolchain@v0.-o(http block)/usr/bin/gh gh api repos/acme/repo/pulls/73 --jq .base.ref,.base.sha 0.1-go1.25.0.lin-errorsas SQdUDQPIO cal/bin/git credential.helpegit(http block)https://api.github.com/repos/acme/repo/pulls/77/usr/bin/gh gh api repos/acme/repo/pulls/77 --jq .base.ref,.base.sha /tmp/go-build521727931/b184/ -dumpbase _cgo_main.c -dumpbase-ext .c -m64 -mtune=generic 0.1-�� 0.1-go1.25.0.lin. ame ux-amd64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api repos/acme/repo/pulls/77 --jq .base.ref,.base.sha 0.1-go1.25.0.lin--gdwarf-5 0.1-go1.25.0.lin--64 0.1-go1.25.0.lin-o(http block)/usr/bin/gh gh api repos/acme/repo/pulls/77 --jq .base.ref,.base.sha 0.1-go1.25.0.linux-amd64/src/run-pthread /http/httptest/httptest.go ux-amd64/pkg/tool/linux_amd64/compile --fix-thin bis(http block)https://api.github.com/repos/checkouttestuser/checkouttestrepo/pulls/987654321/usr/bin/gh gh api repos/checkouttestuser/checkouttestrepo/pulls/987654321 --jq .base.ref,.base.sha(http block)/usr/bin/gh gh api repos/checkouttestuser/checkouttestrepo/pulls/987654321 --jq .base.ref,.base.sha 0.1-go1.25.0.lin--gdwarf-5 --global rg/toolchain@v0.-o http.https://git/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/pkg/too-buildtags(http block)/usr/bin/gh gh api repos/checkouttestuser/checkouttestrepo/pulls/987654321 --jq .base.ref,.base.sha ux-amd64/src/net 0.1-go1.25.0.linux-amd64/src/int--64 ux-amd64/pkg/tool/linux_amd64/vet --depth bis REDACTED status --porcelain --ignore-submodules | head -n 10 ux-amd64/pkg/tool/linux_amd64/vet conf�� _.a ZqIvYSOoH pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.lin-lang=go1.25 pull.rebase(http block)https://api.github.com/repos/checkouttestuser2/checkouttestrepo2/pulls/123456789/usr/bin/gh gh api repos/checkouttestuser2/checkouttestrepo2/pulls/123456789 --jq .base.ref,.base.sha(http block)/usr/bin/gh gh api repos/checkouttestuser2/checkouttestrepo2/pulls/123456789 --jq .base.ref,.base.sha get 0.1-go1.25.0.lin--64 ux-amd64/src/net-o ux-amd64/src/net/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64/pkg/too-trimpath ux-amd64/src/net-unsafeptr=false ux-amd64/src/net-unreachable=false ux-amd64/src/net/tmp/go-build521727931/b194/vet.cfg conf�� ux-amd64/src/net 0.1-go1.25.0.linux-amd64/src/enc/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.lin--norc ux-amd64/pkg/tool/linux_amd64/vet(http block)/usr/bin/gh gh api repos/checkouttestuser2/checkouttestrepo2/pulls/123456789 --jq .base.ref,.base.sha ux-amd64/src/net Gykg3C2n6 /usr/bin/git --depth 2 REDACTED git rtcf�� unset 0.1-go1.25.0.linux-amd64/src/vendor/golang.org/x/text/secure/bidirule/bidirule.go rg/toolchain@v0.0.1-go1.25.0.linux-amd64/pkg/tool/linux_amd64/compile pull.rebase(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.