Skip to content

[codex] Canonicalize PR number references#1749

Merged
juliusmarminge merged 1 commit intopingdotgg:mainfrom
sabraman:codex/canonicalize-pr-number-references
Apr 5, 2026
Merged

[codex] Canonicalize PR number references#1749
juliusmarminge merged 1 commit intopingdotgg:mainfrom
sabraman:codex/canonicalize-pr-number-references

Conversation

@sabraman
Copy link
Copy Markdown
Contributor

@sabraman sabraman commented Apr 5, 2026

Summary

  • canonicalize numeric pull request references on the client so 42 and #42 resolve to the same value
  • update the parser tests to cover the normalized #42 behavior

Why

The web client accepted both 42 and #42 for the same pull request, but preserved them as different strings. That meant client-side query and cache keys could diverge for the same PR even though the server already normalizes #42 to 42.

Impact

Equivalent numeric PR references now share the same client-side representation, which avoids redundant PR-resolution cache entries and keeps client normalization aligned with the server.

Validation

  • bun run test src/pullRequestReference.test.ts
  • bun fmt
  • bun lint
  • bun typecheck

Note

Strip leading # from PR number references in parsePullRequestReference

Updates parsePullRequestReference to always return the bare numeric string for PR number matches. Previously, inputs like #42 returned #42; they now return 42. Tests are updated to match the new behavior.

Macroscope summarized ffea8f2.


Note

Low Risk
Low risk: small normalization change limited to client-side PR reference parsing, with tests updated to lock in behavior. Main risk is minor behavior change for any consumers that previously relied on the leading # being preserved.

Overview
parsePullRequestReference now canonicalizes numeric PR inputs by stripping a leading # and always returning the bare number (e.g., #42 -> 42, including gh pr checkout #42).

Tests were updated to assert the normalized output so equivalent PR references share the same client-side representation and cache/query keys.

Reviewed by Cursor Bugbot for commit ffea8f2. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 5, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 068dd050-fb57-4709-94b3-a78f0b190a0f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Apr 5, 2026
@sabraman sabraman marked this pull request as ready for review April 5, 2026 00:35
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 5, 2026

Approvability

Verdict: Approved

Simple normalization change that strips the '#' prefix from parsed PR numbers, making output format consistent. The change is minimal (3 lines), has corresponding test updates, and poses negligible runtime risk.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge juliusmarminge merged commit cd7980b into pingdotgg:main Apr 5, 2026
17 checks passed
aaditagrawal pushed a commit to aaditagrawal/t3code that referenced this pull request Apr 5, 2026
aaditagrawal added a commit to aaditagrawal/t3code that referenced this pull request Apr 5, 2026
…lize-pr-refs

Merge upstream: Canonicalize PR number references (pingdotgg#1749)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants