Skip to content

fix(web): scope pull request errors to their environment - #6490

Open
Adamulek123 wants to merge 2 commits into
pingdotgg:mainfrom
Adamulek123:t3code/pr-environment-error-scoping
Open

fix(web): scope pull request errors to their environment#6490
Adamulek123 wants to merge 2 commits into
pingdotgg:mainfrom
Adamulek123:t3code/pr-environment-error-scoping

Conversation

@Adamulek123

@Adamulek123 Adamulek123 commented Aug 13, 2026

Copy link
Copy Markdown

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 typecheck
  • git diff --check origin/main...HEAD

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • No animation or interaction video is required

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.

mergePullRequestLists tags each error with its source environment; snapshot decode expects the new error shape. pullRequestProjectKey replaces the old `${environmentId} ${projectId}` string with JSON.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

  • Introduces EnvironmentPullRequestError in pullRequestList.logic.ts, extending project errors with environmentId so merged errors are scoped to the environment that reported them.
  • Exports pullRequestProjectKey from PullRequestListFilters.tsx, encoding keys as JSON tuples [environmentId, projectId] instead of space-separated strings to prevent collisions when ids contain spaces.
  • Updates unavailableProjects in _chat.pull-requests.tsx to key entries by pullRequestProjectKey so identical project ids across environments are handled correctly.
  • Behavioral Change: PullRequestFiltersMenu's unavailable prop now expects keys built with pullRequestProjectKey rather than bare ProjectId values.

Macroscope summarized e158453.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

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 Plus

Run ID: 389793b6-e6ca-4165-8286-3762197189d3

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

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 13, 2026
Comment thread apps/web/src/components/pullRequest/PullRequestListFilters.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 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.

1 participant