Skip to content

fix(azure-devops): omit links to nonexistent build runs - #7

Merged
amv146 merged 2 commits into
mainfrom
fix/azure-devops-empty-build-links
Nov 10, 2026
Merged

amv146 merged 2 commits into
mainfrom
fix/azure-devops-empty-build-links

Conversation

@amv146

@amv146 amv146 commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

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

  • Read-only live diagnosis: both az repos pr policy list and the raw policy-evaluations API returned a queued policy with buildId: 0; az repos pr show confirmed 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-local vite-plus is missing.
  • vp install --frozen-lockfile --filter @t3tools/source-control-azure-devops...: failed on corporate-registry HTTP 404 for @alchemy.run/test during 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-local vite-plus is missing.
  • Latest fork main was merged normally without rewriting history. Hosted Fork PR validation, vp run check:changed "$BASE" on Ubuntu 24.04 with Chromium, passed on head 59c3893cc5b77e01c977d0c868735a38a3f2a882 against base 1d57e02271d25f4162aff449aaf40fb202387dc0: format, lint, both knip checks, typechecks for 11 affected/dependent packages, and 48 tests across 2 files passed.
  • CodeRabbit's substantive review completed successfully, explicitly covering that same head, with no actionable findings. There are no unresolved review threads or requested changes.
  • Fresh main-branch policy inspection reports no protection or effective rules, and no configured required checks. Queued upstream maintainer-runner jobs were not counted as passes or disabled.

GPT-6.1 Sol (gpt-6.1-sol) through T3 Code, acpRegistry harness.

Alex Vallone and others added 2 commits November 9, 2026 11:54
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>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS labels Nov 10, 2026
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

toPullRequestChecks now accepts only positive safe integer build IDs. Tests cover how missing, invalid, and valid IDs affect check status and result URLs.

Changes: Azure DevOps build check ID handling

Layer / File(s) Summary
Build ID validation and check outcomes
packages/source-control-azure-devops/src/server/azureDevOpsPullRequestJson.ts, packages/source-control-azure-devops/src/server/azureDevOpsPullRequestJson.test.ts
toPullRequestChecks treats missing, non-integer, unsafe, zero, and negative build IDs as absent. Tests verify that manual-only policies without a valid run show “Not run,” non-manual policies remain pending, and valid queued runs include a build URL.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • amv146/t3code#3: Adds toPullRequestChecks, which this change updates to validate build IDs.

Suggested labels: size:S

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · up to 59c38

No actionable defect remains identified in this change. Complete the pending validation before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title clearly and concisely describes the change: omit links for nonexistent Azure DevOps build runs.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the invalid build-ID behavior, the focused fix and regression coverage, why the change…
Full details: Description check

Explanation

The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the invalid build-ID behavior, the focused fix and regression coverage, why the change is in scope, and the tests that passed or could not run.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1d57e02 and 59c3893.

Files selected for processing: 2

  • packages/source-control-azure-devops/src/server/azureDevOpsPullRequestJson.test.ts
  • packages/source-control-azure-devops/src/server/azureDevOpsPullRequestJson.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@amv146
amv146 merged commit 230247c into main Nov 10, 2026
11 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant