Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(azure-devops): Issues search finds a work item by its ID #48221

Openjuliusmarmingewants to merge 2 commits intomain fromrefs/pull/48221/headopened View on GitHub

juliusmarmingecommented

Searching Issues on an Azure DevOps project only matched work item titles. Typing a work item's number (for example 46 or #46) showed "Nothing matches that." unless the number was in the title. Now a search that is a number also matches that work item's ID ([System.Id]), and the title match still applies as before.

Fixes pingdotgg/t3code#48209

Reproduction on main

Commit dc11614464 (origin/main). Created Azure DevOps Task #46 titled 'Factory 48209 search repro widget' (title does not contain 46) in the test organisation with az. Made a local git repo whose origin is that project's Azure Repos URL. Started T3CODE_DEV_SEED=0 vp run dev (fresh database) with the Azure DevOps token in its environment, paired the web client, added the repo as a project, and opened Issues. The Azure DevOps section listed #46. Searching 46 showed 'Nothing matches that.' under Azure DevOps with no error. Searching #46 gave the same. Searching repro widget returned #46. Afterwards I deleted work item #46. Failing test: 'finds a work item by its numeric ID, not only by its title' in packages/source-control-azure-devops/src/server/AzureDevOpsIssueTracker.test.ts. On main the WIQL sent for '46' is ... AND [System.Title] CONTAINS '46' ORDER BY ..., with no [System.Id] clause.

Evidence

Being captured: before and after in the real app. This section is filled in before the pull request can merge.

Tests

  • vp test run src/server/AzureDevOpsIssueTracker.test.ts with the fix stashed: 1 failed (the repro test), 11 passed
  • vp test run src/server/AzureDevOpsIssueTracker.test.ts with the fix: 12 passed
  • vp run typecheck in packages/source-control-azure-devops: no errors, after adding the missing sort to the repro test call
  • vp run check:changed: format, lint, knip, typecheck (11 packages) and tests (2 files) all pass
  • Live WIQL check with az boards query against the test organisation: the new clause returned the created work item for 47, #47 and a title search

Not in this change

  • An ID search still honours the selected state filter, so a closed work item's number finds nothing on the Open view; this is the same as every other search.
  • The title search does not cover the description, unlike GitLab's search parameter.

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

    1. tanstack-source added labelsbug

    2. Approvability

      Verdict: Approved at f9c7aac

      Macroscope's review found this PR approvable — Azure DevOps issue searches now recognize numeric work-item IDs while preserving title matching and existing project and filter constraints. The change is limited to read-only search behavior, with no material operational or data risk identified.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      CodexLive turn WebSocket decoded21.5 KiB21.5 KiB0 B (0.0%)24.4 KiB✅
      CodexLive turn messages110 (0.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.9 KiB21.9 KiB0 B (0.0%)24.4 KiB✅
      ClaudeLive turn messages110 (0.0%)8✅

      Other scenarios

      All 64 scenario measurements match main.

      All 64 scenario measurements
      ProviderScenarioMetricMain baselineThis PRImpactPR ceiling
      Codexshort turn resumeWebSocket decoded10.5 KiB10.5 KiB0 B (0.0%)12.7 KiB✅
      Codexshort turn resumeWebSocket messages220 (0.0%)2✅
      Codexlong turn running, cold openHTTP decoded281.7 KiB281.7 KiB0 B (0.0%)302.7 KiB✅
      Codexlong turn running, cold openrows75750 (0.0%)75✅
      Codexlong turn running, history pageHTTP decoded92.5 KiB92.5 KiB0 B (0.0%)107.4 KiB✅
      Codexlong turn running, history pagerows75750 (0.0%)75✅
      Codexlong turn finished, cold openHTTP decoded381.5 KiB381.5 KiB0 B (0.0%)410.2 KiB✅
      Codexlong turn finished, cold openrows1511510 (0.0%)151✅
      Codexlong turn finished, socket cold openWebSocket decoded381.6 KiB381.6 KiB0 B (0.0%)410.2 KiB✅
      Codexlong turn finished, socket cold openWebSocket messages220 (0.0%)2✅
      Codexlong turn finished, socket cold openrows1511510 (0.0%)151✅
      Codexlong turn finished, work pageHTTP decoded78.3 KiB78.3 KiB0 B (0.0%)200.2 KiB✅
      Codexlong turn finished, work pagerows75750 (0.0%)150✅
      Codexidle thread resumeWebSocket decoded65 B65 B0 B (0.0%)200 B✅
      Codexidle thread resumeWebSocket messages110 (0.0%)1✅
      Codexfleet shell snapshotHTTP decoded42.4 KiB42.4 KiB0 B (0.0%)53.7 KiB✅
      Codexfleet shell snapshotrows27270 (0.0%)27✅
      Codexfleet shell subscribeWebSocket decoded65 B65 B0 B (0.0%)200 B✅
      Codexfleet shell subscribeWebSocket messages110 (0.0%)1✅
      Codexfleet shell resume checkHTTP decoded18 B18 B0 B (0.0%)100 B✅
      Codexfleet shell resume checkrows0000✅
      Codexstale shell reloadHTTP decoded42.4 KiB42.4 KiB0 B (0.0%)53.7 KiB✅
      Codexstale shell reloadrows27270 (0.0%)27✅
      Codexstale shell resumeWebSocket decoded140 B140 B0 B (0.0%)400 B✅
      Codexstale shell resumeWebSocket messages220 (0.0%)2✅
      Codexstale todo list cold openHTTP decoded72.4 KiB72.4 KiB0 B (0.0%)83.0 KiB✅
      Codexstale todo list cold openrows75750 (0.0%)75✅
      Codexstale todo list cold opennodes220 (0.0%)4✅
      Codexstale todo list cold opensubagents220 (0.0%)4✅
      Codexstale todo list cold openplans110 (0.0%)2✅
      Codexstale todo list cold openproviderTurns110 (0.0%)2✅
      Codexstale todo list cold opencheckpoints110 (0.0%)2✅
      Claudeshort turn resumeWebSocket decoded10.6 KiB10.6 KiB0 B (0.0%)12.7 KiB✅
      Claudeshort turn resumeWebSocket messages220 (0.0%)2✅
      Claudelong turn running, cold openHTTP decoded283.3 KiB283.3 KiB0 B (0.0%)302.7 KiB✅
      Claudelong turn running, cold openrows75750 (0.0%)75✅
      Claudelong turn running, history pageHTTP decoded93.4 KiB93.4 KiB0 B (0.0%)107.4 KiB✅
      Claudelong turn running, history pagerows75750 (0.0%)75✅
      Claudelong turn finished, cold openHTTP decoded384.2 KiB384.2 KiB0 B (0.0%)410.2 KiB✅
      Claudelong turn finished, cold openrows1511510 (0.0%)151✅
      Claudelong turn finished, socket cold openWebSocket decoded384.3 KiB384.3 KiB0 B (0.0%)410.2 KiB✅
      Claudelong turn finished, socket cold openWebSocket messages220 (0.0%)2✅
      Claudelong turn finished, socket cold openrows1511510 (0.0%)151✅
      Claudelong turn finished, work pageHTTP decoded79.2 KiB79.2 KiB0 B (0.0%)200.2 KiB✅
      Claudelong turn finished, work pagerows75750 (0.0%)150✅
      Claudeidle thread resumeWebSocket decoded66 B66 B0 B (0.0%)200 B✅
      Claudeidle thread resumeWebSocket messages110 (0.0%)1✅
      Claudefleet shell snapshotHTTP decoded43.0 KiB43.0 KiB0 B (0.0%)53.7 KiB✅
      Claudefleet shell snapshotrows27270 (0.0%)27✅
      Claudefleet shell subscribeWebSocket decoded66 B66 B0 B (0.0%)200 B✅
      Claudefleet shell subscribeWebSocket messages110 (0.0%)1✅
      Claudefleet shell resume checkHTTP decoded18 B18 B0 B (0.0%)100 B✅
      Claudefleet shell resume checkrows0000✅
      Claudestale shell reloadHTTP decoded43.0 KiB43.0 KiB0 B (0.0%)53.7 KiB✅
      Claudestale shell reloadrows27270 (0.0%)27✅
      Claudestale shell resumeWebSocket decoded140 B140 B0 B (0.0%)400 B✅
      Claudestale shell resumeWebSocket messages220 (0.0%)2✅
      Claudestale todo list cold openHTTP decoded73.4 KiB73.4 KiB0 B (0.0%)83.0 KiB✅
      Claudestale todo list cold openrows75750 (0.0%)75✅
      Claudestale todo list cold opennodes220 (0.0%)4✅
      Claudestale todo list cold opensubagents220 (0.0%)4✅
      Claudestale todo list cold openplans110 (0.0%)2✅
      Claudestale todo list cold openproviderTurns110 (0.0%)2✅
      Claudestale todo list cold opencheckpoints110 (0.0%)2✅

      Baseline: 7eba80e · PR result: f9c7aac · Source CI: success

      Scenario and decoded snapshot size

      10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

      • Codex decoded thread snapshot: 108.5 KiB
      • Claude decoded thread snapshot: 108.8 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    4. Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      Azure DevOps issue search now matches numeric queries against work-item IDs as well as titles. Tests verify that both 46 and #46 generate an exact ID filter.

      Changes: Azure DevOps ID search

      Layer / File(s)Summary
      Build and validate the search clause
      packages/source-control-azure-devops/src/server/AzureDevOpsIssueTracker.ts, packages/source-control-azure-devops/src/server/AzureDevOpsIssueTracker.test.ts
      Numeric queries with an optional leading # add an exact work-item ID condition alongside title matching. WIQL uses the new search clause. Tests check both numeric query formats.

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

      Change: Bug fix · Severity of issue fixed: Medium

      Merge Risk: Minimal · up to f9c7a

      Numeric searches in Azure DevOps issues now find work items by ID as well as by title, and tests cover both the plain and the #-prefixed form. The change is small and safe to merge. Only extremely large ten-digit IDs still fall back to title-only matching.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title "fix(azure-devops): Issues search finds a work item by its ID" matches the main change. The raw summary and objectives show the adapter now matches a numeric search to [System.Id] as well as…
      Description checkPassedThe description covers the problem, the change, the scope link, and verification, so it is mostly complete. The Problem section describes the bug and reproduction steps on main. The Change section exp…
      Linked Issues checkPassed[#48209] requires that a search for a work item's displayed numeric ID finds that item, as a title-phrase search does. The reviewed diff for AzureDevOpsIssueTracker.ts adds searchClause(text). For tex…
      Out of Scope Changes checkPassedThe reviewed change set is limited to the Azure DevOps issue-search path. It adds one helper (searchClause) and replaces the inline title clause in the issue-list WIQL builder with a call to it. The c…
      Full details: Title check

      Explanation

      The title "fix(azure-devops): Issues search finds a work item by its ID" matches the main change. The raw summary and objectives show the adapter now matches a numeric search to [System.Id] as well as the title. The title is short, specific, and follows the conventional commit style used in the template. It names the affected area (azure-devops) and the behavior fixed.

      Full details: Description check

      Explanation

      The description covers the problem, the change, the scope link, and verification, so it is mostly complete. The Problem section describes the bug and reproduction steps on main. The Change section explains the numeric ID match and that title matching still applies. The Scope section links issue #48209 as the bug report. The Verification section lists focused test runs, a typecheck, a check:changed run, and a live WIQL check. It also states which behavior was not checked. The Evidence section is a placeholder that says the before and after capture is still in progress. The description does not mark the evidence as optional, and the template asks for before and after screenshots for UI changes. This change touches no UI, so the placeholder is a minor gap, not a blocker. The author should remove the placeholder or fill it in before merge.

      Full details: Linked Issues check

      Explanation

      [#48209] requires that a search for a work item's displayed numeric ID finds that item, as a title-phrase search does. The reviewed diff for AzureDevOpsIssueTracker.ts adds searchClause(text). For text matching /^#?(\d{1,9})$/, the WIQL becomes AND ([System.Title] CONTAINS '<text>' OR [System.Id] = <number>). Non-numeric text keeps the title-only clause, and empty text adds no clause. Both 46 and #46 produce the ID match. The PR summary reports that the regression test 'finds a work item by its numeric ID, not only by its title' failed before the fix and passed after it, with 12 tests passing in AzureDevOpsIssueTracker.test.ts. I did not re-run the tests. The PR description's live in-app before/after evidence section is marked as still being captured. That evidence is not a coding requirement, so it does not affect this verdict. Limitation: numbers of ten or more digits fall back to title-only search. The issue does not require those cases.

      Full details: Out of Scope Changes check

      Explanation

      The reviewed change set is limited to the Azure DevOps issue-search path. It adds one helper (searchClause) and replaces the inline title clause in the issue-list WIQL builder with a call to it. The change alters no exported declarations. The test file adds coverage for the numeric-ID WIQL clause. Both files relate directly to #48209. The PR description's notes on state-filter behavior and description search describe existing limits. They do not add unrelated behavior.

      Finishing Touches

      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 7eba80e43120c8533738e7b5149f5b08b7ab0b14 and f9c7aacacd736be316f80afd489abf19666b1f05.

      Files selected for processing: 2

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

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

Sign in to join this conversation.