Repository navigation
test(gateway): centralize session branch fixtures - #117625
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 4:44 PM ET / 20:44 UTC. ClawSweeper reviewWhat this changesCentralizes repeated temporary-Git repository, remote-ref, GitHub-response, and branch-state setup inside Merge readinessThis is a focused test-only refactor that keeps the existing session-branch behavior matrix while making its real-Git setup easier to maintain. Current main still has the expanded fixture setup, and the protected Priority: P3 Review scores
Verification
How this fits togetherThe Control UI session pull-request loader combines local Git branch facts with GitHub pull-request state to render pull-request chips and a possible Create PR row. This test suite builds temporary repositories and routed GitHub responses to verify that branch-state decisions remain correct across merged, rebased, dirty, and missing-ref scenarios. flowchart LR
A[Control UI session] --> B[Session PR loader]
B --> C[Local Git branch facts]
B --> D[GitHub pull request state]
C --> E[Branch-state decision]
D --> E
E --> F[PR chips and Create PR row]
G[Test fixtures] --> C
G --> D
Decision needed
Why: The patch appears correct and does not alter runtime behavior, but repository policy keeps protected Before merge
Agent review detailsSecurityNone. PR surfaceTests -517. Total -517 across 1 file. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the file-local fixture refactor after an up-to-date merge check, retaining the existing real-Git scenario coverage and the unchanged production branch-resolution contract. Do we have a high-confidence way to reproduce the issue? Not applicable — this PR refactors test setup rather than reporting a runtime defect. The provided PR evidence reports the exact 19-case suite and changed gate passing after the refactor. Is this the best way to solve the issue? Yes. File-local helpers remove repeated arrangement mechanics while preserving the real-Git and routed-response boundary that the tests are intended to cover; moving this policy into production or shared support code would add unnecessary surface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fb3d473a73b0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
The session branch diff suite rebuilt the same real temporary Git repository, commits, remote refs, GitHub routes, and merged-PR envelopes in every test. That made a 19-test behavior matrix 961 lines long and obscured the few history details that differ per scenario.
This change moves only repeated arrange/act mechanics into typed, file-local fixture owners. Every test remains standalone. Real Git commits, branches, heads, merge bases, remote refs, routed GitHub responses, cache eviction, and cleanup still run exactly as before.
Architectural owner and canonical fix
Evidence
Tests