Skip to content

Restore Source Control test state after Git operation tracking change - #37186

Closed
brennanb2025 wants to merge 1 commit into
mainfrom
brennanb2025/lt1031-main-sc-tests
Closed

brennanb2025 wants to merge 1 commit into
mainfrom
brennanb2025/lt1031-main-sc-tests

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Main CI has failed 39 Source Control tests since #37093 changed the panel to derive the active Git operation from remoteOperations. The preview-open and branch-line-total suites fail on shards 12 and 4; virtual-file-list and open-file-highlight fail on shard 9. All four mocked stores still supplied the removed inFlightRemoteOpKind field and omitted the new array, so rendering threw before their assertions ran. Every open PR's test job fails on these shards until this lands.

This PR gives those four suites one typed remote-state test fixture. It initializes the array and removes the obsolete mock field. Users see no change: the app's store always starts with an empty remoteOperations list (the editor slice sets it, and nothing saves, restores or replaces it), so only the tests' hand-built stores were incomplete. The existing assertions are unchanged.

Plan: correct the shared test-state shape after reproducing the failures on current main, then rerun all four failing suites. No product decision, persisted data change, compatibility change, or new UI is involved.

Review path: full. It meets the light-path size and scope criteria, but an unrelated revert (#31893, HTML preview by default) touched SourceControl.preview-open.test.tsx within the last 30 days, which moves it to the full path.

  • Small: no shipped production code; four test files and one 12-line test fixture (the CI line-count table counts the .test-fixture.ts file as production because of its name).
  • Outside risky areas: test-state defaults only; no shipped store, persistence, ordering, protocol, process, auth, orchestration, build, or default changes.
  • Not a repeat: no prior repair for the missing remote-operation array in the last 30 days of these files; the preview suite has the unrelated revert above.
  • Local effect: test-only fixture correction; existing user-facing behavior and assertions are unchanged.

Validation: all four suites fail on main (39/39 tests) with the missing-array error and pass on this branch (39/39), locally through tc-gate and in CI shards 4, 9 and 12. Typecheck passes in CI. The pre-commit hook passes.

The separate automation-operations.ts max-lines lint failure on main is addressed by #37174 and is outside this PR; it is the only failing check here.

Tracked in #37093.

@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b25193c8-6432-40f3-9431-c48e19c8a139
Commits

Reviewing files that changed from the base of the PR and between 70dae97 and c82740a.

Files selected for processing: 5
  • src/renderer/src/components/right-sidebar/SourceControl.branch-line-total.test.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.open-file-highlight.test.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.preview-open.test.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.virtual-file-list.test.tsx
  • src/renderer/src/components/right-sidebar/source-control-remote-state.test-fixture.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review loop status (full path, test-only)

The problem: after #37093 the Source Control panel reads the store's remoteOperations list. Four Source Control test suites (branch-line-total, preview-open, virtual-file-list, open-file-highlight) build their own mock store without that list, so 39 tests throw before their assertions and test shards 4, 9 and 12 fail on main and on every PR.

The change: one typed test fixture supplies the remote-state fields (remoteStatusesByWorktree, isRemoteOperationActive, remoteOperations: []) to all four suites and drops the stale inFlightRemoteOpKind mock field. No shipped code changes; users see nothing different.

Verified:

  • The app itself is fine: the store always starts with remoteOperations: [] (store/index.ts → create-editor-slice.ts:55 → git-remote-status.ts:35), and no hydration, persistence, store replacement or SSH/web/phone path leaves it undefined. So no production fix is needed.
  • No other test renders the panel with an incomplete store; remaining inFlightRemoteOpKind uses in tests are component props and decision inputs, not store fields.
  • The four suites pass 39/39 locally (tc-gate) and in CI; all 12 test shards, typecheck and both packages pass.
  • The PR moved from the light path to the full path only because an unrelated revert (Revert HTML preview by default for the release (#31575) #31893) touched the preview suite within 30 days.

Not green: static analysis and typecheck fails only on main's separate automation-operations.ts max-lines lint error, fixed by #37174. #37174's own test shards 4, 9 and 12 fail on the break this PR fixes, so each PR's CI is red only because of the other's main break.

Deferred: these four suites still hand-build untyped partial store mocks, so a future required store field could break them the same way; deriving their baseline from the real store's initial state would remove that. There is no repeated break in these suites yet, so it stays out of this urgent fix.

For Brennan's review:

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Closing as superseded: main's Source Control test break from #37093 was fixed by #37195 (merged), so this duplicate fix is no longer needed. The shared-fixture consolidation here was a nice-to-have, not a fix; listed as a deferred note.

@brennanb2025
brennanb2025 deleted the brennanb2025/lt1031-main-sc-tests branch November 1, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant