[codex] Canonicalize PR number references#1749
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
ApprovabilityVerdict: 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. |
…lize-pr-refs Merge upstream: Canonicalize PR number references (pingdotgg#1749)
Summary
42and#42resolve to the same value#42behaviorWhy
The web client accepted both
42and#42for 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#42to42.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.tsbun fmtbun lintbun typecheckNote
Strip leading
#from PR number references inparsePullRequestReferenceUpdates
parsePullRequestReferenceto always return the bare numeric string for PR number matches. Previously, inputs like#42returned#42; they now return42. 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
parsePullRequestReferencenow canonicalizes numeric PR inputs by stripping a leading#and always returning the bare number (e.g.,#42->42, includinggh 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.