fix(web): scope pull request errors to their environment - #6490
fix(web): scope pull request errors to their environment#6490Adamulek123 wants to merge 2 commits into
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 Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 e158453 This is a straightforward bug fix that prevents ID collisions in project keys by using JSON.stringify instead of space-separated strings, and properly scopes errors to their environment. Changes are self-contained to pull request filtering logic with good test coverage. You can customize Macroscope's approvability policy. Learn more. |
What Changed
Pull request list errors now retain the environment that reported them when results from multiple servers are merged. The project filter uses the environment and project ID together when deciding which project is unavailable.
Why
Project IDs are local to an environment and can collide across servers. Previously, an error from one environment could disable a healthy project with the same ID in another environment.
UI Changes
No layout or styling changes. In the colliding-ID case, only the project from the failing environment is now marked unavailable. Before/after screenshots are intentionally omitted for this PR.
Validation
vp test run apps/web/src/components/pullRequest/pullRequestList.logic.test.ts(95 tests passed)vp run --filter @t3tools/web typecheckgit diff --check origin/main...HEADChecklist
Generated with GPT-5.6 via the Codex harness.
Note
Low Risk
Targeted multi-environment pull request list fix with tests; no auth or API contract changes beyond local snapshot shape.
Overview
Merged pull request list errors now carry
environmentId, and the project filter keys unavailable projects by environment plus project instead of project id alone. That stops a failure on one server from marking the same project id on another server as unavailable.mergePullRequestListstags each error with its source environment; snapshot decode expects the new error shape.pullRequestProjectKeyreplaces the old`${environmentId} ${projectId}`string withJSON.stringify([environmentId, projectId])so radio values and unavailable lookups stay unique when ids contain spaces.Reviewed by Cursor Bugbot for commit e158453. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Scope pull request errors to their environment using combined environment+project keys
EnvironmentPullRequestErrorinpullRequestList.logic.ts, extending project errors withenvironmentIdso merged errors are scoped to the environment that reported them.pullRequestProjectKeyfromPullRequestListFilters.tsx, encoding keys as JSON tuples[environmentId, projectId]instead of space-separated strings to prevent collisions when ids contain spaces.unavailableProjectsin_chat.pull-requests.tsxto key entries bypullRequestProjectKeyso identical project ids across environments are handled correctly.PullRequestFiltersMenu'sunavailableprop now expects keys built withpullRequestProjectKeyrather than bareProjectIdvalues.Macroscope summarized e158453.