[codex] Structure pull request link failures#3445
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
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)
Comment |
ApprovabilityVerdict: Approved This PR introduces structured error handling for opening PR links, wrapping existing You can customize Macroscope's approvability policy. Learn more. |
Summary
Root cause
The two pull-request link entry points called the bridge independently and reduced rejected operations to toast text. That discarded the cause chain and provided no safe URL correlation for diagnostics.
Validation
vp test apps/web/src/lib/openPullRequestLink.test.ts(2 tests)vp checkvp run typecheckNote
Low Risk
Small UX/diagnostics refactor around external link opening; no auth or data-path changes, with tests for error redaction.
Overview
Pull request links no longer call
shell.openExternaldirectly at each UI entry point. A sharedopenPullRequestLinkhelper wraps the bridge call and turns rejections into aPullRequestLinkOpenErrorthat keeps the original cause while exposing only a safetargetOrigin(no full URL or query secrets) in user-facing messages.useOpenPrLinkandGitActionsControl’s open-existing-PR path now use that helper; failures areconsole.error’d before the existing error toasts. Unit tests cover successful opens and failure shaping (including URLs with sensitive query params).Reviewed by Cursor Bugbot for commit d120aa7. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Structure pull request link open failures into
PullRequestLinkOpenErroropenPullRequestLink.tswith aPullRequestLinkOpenErrortagged error class that wraps raw shell failures, exposing only the URL origin (not full URL with query params) in its message.openPullRequestLink(shell, url)utility that throwsPullRequestLinkOpenErroron failure, used by bothGitActionsControlanduseOpenPrLink.console.errorbefore surfacing a toast, and the toast message reflects the sanitized error message.Macroscope summarized d120aa7.