Repository navigation
fix(azure-devops): omit links to nonexistent build runs - #7
Conversation
Treat zero and other invalid build IDs as absent before creating results links and identifying manual builds that have not run. Preserve pending automatic policies and valid build URLs. Extend the existing checks regression with absent and invalid IDs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Problem
Azure DevOps can return a queued build-validation policy with
context.buildId: 0, including on a draft PR whose validation has not automatically started. T3 constructs/_build/results?buildId=0, which cannot identify a run and sends the user to the project's build list instead.Change
Normalize build IDs to positive safe integers before creating build-result links or deciding whether a manual-only policy has run. Missing, zero, negative, or fractional IDs produce no build link; real IDs keep their existing results URL. Automatic queued policies remain pending, and manual-only policies without a run retain the existing skipped/Not run behavior.
Extend the existing policy-mapping regression with missing and invalid IDs, the automatic queued/no-run case, and the valid-run URL. This fixes the Azure DevOps adapter restored in fork #3 from pingdotgg#22555. Shared UI wording and optional-check merge gating are separate issues and remain unchanged. No extra API calls, contract changes, or client-specific changes are needed.
Scope and approval
The fork owner reported the broken link, explicitly requested an adapter-only fix, and authorized opening this fork PR and driving it to completion. This is a focused correction to an existing invalid-link bug, not a new feature. Approval applies only to
amv146/t3code; no upstream PR, source branch, or referenced Azure DevOps PR is modified.Verification
az repos pr policy listand the raw policy-evaluations API returned a queued policy withbuildId: 0;az repos pr showconfirmed a draft PR. No build was queued and no PR state changed.git diff origin/main...HEAD --check: passed.node --experimental-strip-types --check packages\source-control-azure-devops\src\server\azureDevOpsPullRequestJson.ts: passed.node --experimental-strip-types --check packages\source-control-azure-devops\src\server\azureDevOpsPullRequestJson.test.ts: passed.vp test run packages\source-control-azure-devops\src\server\azureDevOpsPullRequestJson.test.ts: could not start locally because project-localvite-plusis missing.vp install --frozen-lockfile --filter @t3tools/source-control-azure-devops...: failed on corporate-registry HTTP 404 for@alchemy.run/testduring supply-chain metadata verification. Offline restore also failed because that metadata is absent. No dependency policies, manifests, or lockfiles were changed.vp run check:changed origin/main: could not start locally because project-localvite-plusis missing.vp run check:changed "$BASE"on Ubuntu 24.04 with Chromium, passed on head59c3893cc5b77e01c977d0c868735a38a3f2a882against base1d57e02271d25f4162aff449aaf40fb202387dc0: format, lint, both knip checks, typechecks for 11 affected/dependent packages, and 48 tests across 2 files passed.GPT-6.1 Sol (
gpt-6.1-sol) through T3 Code, acpRegistry harness.