fix: canonicalize git.cafe pull request links#22593

open2
main
t3/gitcafe-pull-links
opened2d agobyMmaria
View on GitHubTwo-way sync enabledPR last imported 1d ago

git.cafe links supplied as host/repository/number, /pull/<n>, or /pulls/<n> now store t3's existing /pulls/<n> format, as requested. git.cafe's canonical browser route is /pull/<n>; both forms are accepted by t3. the shared parser accepts both routes on production and staging, so linked prs open in t3's panel; manual linking and checkout use the same parsing and canonicalization.

verified against main 05696c636e: real codex mcp calls linked pingdotgg/t3code #21353 all three ways, listed canonical stored urls after each, and synced its live title and checks. clicking the thread's link opened the pr panel. 238 focused existing tests passed through blacksmith, including persistence/rebuild and nearby web/mobile routing; shared, client-runtime, gitcafe, and server typechecks passed. scoped lint: 0 errors, 2 existing warnings.

after the final checkout parser change, 58 affected tests, three affected package typechecks, and scoped lint passed again. existing tests also cover repositories named pull and pulls on both git.cafe hosts. two independent source reviews approved 2a3009c658.

the recording shows the linked real pr opening in t3, its description, and its checks. #21353's activity endpoint fails independently; its details and checks load.

clicking linked git.cafe pr #21353 opens t3's pr panel

built by gpt-6.1-sol in the codex harness through t3 code.

Checks

Some checks failed

Added 2 commits

  • fix: share git.cafe route recognition for checkout2a3009c
  • fix: canonicalize git.cafe pull request links4cd649e

Note

Written by gpt-6.1-sol on behalf of Maria

@versecafe confirmed: /pulls/22593 now returns 308 to /pull/22593, which returns 200. i clarified the description. this pr accepts both routes everywhere t3 parses them and preserves t3's existing /pulls/<n> storage format, following maria's explicit requirement. the forge's canonical browser route remains /pull/<n>.

Synced from GitHub

Approvability

Verdict: Approved at 2a3009c

Macroscope's review found this PR approvable — This is a focused GitCafe pull-request URL fix that recognizes both route forms and normalizes links only for GitCafe hosts. The affected client, server, checkout, and persistence paths are covered by targeted tests, with no schema, deployment, or sensitive-area changes.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire5.0 KiB5.0 KiB+7 B (+0.1%)6.8 KiB✅
CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
CodexLive turn WebSocket wire1.2 KiB1.2 KiB+7 B (+0.6%)2.0 KiB✅
CodexLive turn WebSocket decoded20.9 KiB20.9 KiB0 B (0.0%)29.3 KiB✅
CodexLive turn messages220 (0.0%)8✅
ClaudeTotal thread wire5.0 KiB5.0 KiB+7 B (+0.1%)6.8 KiB✅
ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB+7 B (+0.6%)2.0 KiB✅
ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
ClaudeLive turn messages220 (0.0%)8✅

Baseline: 8a9d0e0 · PR result: 2a3009c · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Note

Written by gpt-6.1-sol on behalf of Maria

thread transfer impact passes for 2a3009c658. build, typecheck, lint, web tests, and all eight server test shards passed.

POST to Cursor remains failed after one rerun: both workflow attempts received HTTP 400 on all three webhook requests. this workflow only forwards the event payload and never checks out or runs the pr code. failed retry logs. the webhook integration needs an external fix; this pr leaves ci unchanged. CodeRabbit passed with no actionable findings. 28 of 29 checks pass, with none pending. both independent source reviewers and Macroscope approved the same final head. the pr remains blocked on the Cursor integration; no source changes are needed for the received reviews.

Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0f22c9bd-d3f1-4be0-98ef-f82d10e896d7
📥 Commits

Reviewing files that changed from the base of the PR and between 8a9d0e0dd553c5b0bd943ddfd9741d6bab0e486f and 2a3009c658f0e1e08dfb55f51d44b8f349bfc778.

📒 Files selected for processing: 11
  • apps/server/src/mcp/toolkits/pullRequests/handlers.test.ts
  • apps/server/src/mcp/toolkits/pullRequests/handlers.ts
  • apps/server/src/orchestration-v2/Orchestrator.ts
  • apps/server/src/orchestration-v2/runtimeLayer.test.ts
  • packages/client-runtime/src/pullRequestLinkInput.test.ts
  • packages/client-runtime/src/pullRequestLinkInput.ts
  • packages/shared/src/changeRequestUrl.test.ts
  • packages/shared/src/changeRequestUrl.ts
  • packages/source-control-gitcafe/src/client/definition.ts
  • packages/source-control-gitcafe/src/server/GitCafeSourceControlProvider.test.ts
  • packages/source-control-gitcafe/src/server/GitCafeSourceControlProvider.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

The change adds shared parsing for GitCafe pull-request URLs using /pull/ and /pulls/ routes. Client and server integrations use the parser and canonicalize valid links to HTTPS /pulls/{number} URLs.

Changes: GitCafe URL normalization

Layer / File(s)Summary
Shared URL parsing and canonicalization
packages/shared/src/changeRequestUrl.ts, packages/shared/src/changeRequestUrl.test.ts
Shared helpers recognize GitCafe pull requests on git.cafe and staging.git.cafe. Valid links use the HTTPS /pulls/{number} form. Tests cover unsupported hosts and invalid pull-request numbers.
GitCafe client and provider integration
packages/source-control-gitcafe/src/client/definition.ts, packages/source-control-gitcafe/src/server/GitCafeSourceControlProvider.ts, packages/source-control-gitcafe/src/server/GitCafeSourceControlProvider.test.ts
The client and provider use the shared parser for GitCafe pull-request URLs. Provider tests cover both route forms when checking out a fork.
Application link resolution and storage
packages/client-runtime/src/pullRequestLinkInput.ts, packages/client-runtime/src/pullRequestLinkInput.test.ts, apps/server/src/mcp/toolkits/pullRequests/handlers.ts, apps/server/src/mcp/toolkits/pullRequests/handlers.test.ts, apps/server/src/orchestration-v2/Orchestrator.ts, apps/server/src/orchestration-v2/runtimeLayer.test.ts
Client runtime resolution, pull-request handlers, and orchestration link paths store canonicalized URLs. Tests cover link commands and projection rebuilds.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge, scottn-pv

Merge Risk: ⚪ Minimal · up to 2a300

GitCafe pull-request links using either the pull or pulls route are now recognized and stored in the canonical pulls form. No actionable merge-blocking risk was identified.

Security architecture risk: 🔵 Low · up to 2a300

The change is narrowly scoped to accepting equivalent GitCafe links and storing one canonical format. Existing host and credential restrictions remain in place. No new security weakness was verified, although concurrent and interrupted updates were not fully validated.

Retained concerns No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed attack surface is user-supplied pull-request references flowing into thread associations and GitCafe retrieval or checkout. Recognition expands to another route on the two existing hosts, not to arbitrary destination hosts or new credential authorities.

Trust Boundaries and Controls

  • observed — Credential selection remains host-scoped: environment credentials require a matching configured host, settings credentials are restricted to production, and CLI lookup receives the selected host. Existing tests explicitly reject production-to-staging and staging-to-production environment-token reuse.

Resilience and Maintainability Implications

  • observed — Link deduplication, ordinary unlinking, and stack-dismissal restoration continue to use normalized identity rather than URL spelling. The unchanged commit mechanism reserves the command receipt, appends events, applies projections, and finalizes the receipt inside a transaction before publishing. Duplicate command IDs reuse the recorded result. These mechanisms provide counterevidence to partial-state concerns, but are not direct validation of every concurrent or interrupted link transition.
Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the main change: canonicalizing GitCafe pull request links.
Description checkPassedThe description explains the problem, implementation, affected behavior, and verification results in sufficient detail. It does not include an explicit issue or maintainer approval link, but the focus…
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem, implementation, affected behavior, and verification results in sufficient detail. It does not include an explicit issue or maintainer approval link, but the focused scope and review evidence provide adequate context.

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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