test(server): share source control harness settings #17760
main fromrefs/pull/17760/head·opened View on GitHubProblem#
The discovery and provider-registry test helpers constructed independent settings instances for ServerSourceControlHost and the registry. Changing settings through the supplied service could leave the host using stale settings, which existing tests did not exercise.
Change#
Provide one settings layer with Layer.provideMerge in both helpers. Add behavioral regressions that discover an authenticated GitHub login, disable github.com through the supplied settings service, and verify a subsequent discovery reports it unauthenticated with no selected account.
Refs #17608.
Scope and approval#
This implements only the test-harness settings item in Julius's comment, following the existing Bitbucket test pattern. It does not close the broader cleanup issue. Only the two named test files change.
Verification#
macOS, Node 24.21.0; in-memory test settings, mocked CLI/API responses, and an empty host environment to exclude ambient credentials.
- Baseline: 19 tests passed.
- With the new regressions and the old independent settings composition: both regressions failed (expected
unauthenticated, receivedauthenticated); the original 19 tests passed. - With shared settings: 21 tests passed across two files, independently rerun after commit.
- Focused command:
node node_modules/vite-plus/bin/vp test run apps/server/src/sourceControl/SourceControlDiscovery.test.ts apps/server/src/sourceControl/SourceControlProviderRegistry.test.ts. node node_modules/typescript/bin/tsc --noEmit -p apps/server/tsconfig.json— exit 0; existing Effect suggestions elsewhere, none in the changed files.- Scoped
vp lintfor the two files — exit 0 with six unused-symbol warnings, confirmed identical to baseline. Scopedvp fmt --checkandgit diff --checkpassed.
The local Vite+ entry point was invoked with Node 24 directly because the global installation wrapper selected a different runtime.
Implemented with GPT-6.1-Sol through Codex desktop; reviewed independently through Codex.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
Approvability#
Verdict: Approved at
e045b5aMacroscope's review found this PR approvable — The PR is confined to ignored server test-harness files and adds mocked regression coverage without changing production behavior, product defaults, or static-analysis configuration. Its runtime impact is limited to test execution.
Notes:
- No code objects were reviewed. Approvability was decided on eligibility alone.
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:
348eed64-7cde-46ce-bf10-4be14b4b3781
📥 Commits
-
Reviewing files that changed from the base of the PR and between 2943e30974a4afdb436d0a34316c752056ce5d17 and e045b5a6ebfee501049aa6afacb96e36702e9747.
📒 Files selected for processing: 2
-
apps/server/src/sourceControl/SourceControlDiscovery.test.tsapps/server/src/sourceControl/SourceControlProviderRegistry.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
The source-control test layers now provide server settings at the outer test boundary. New tests verify that disabling
github.comchanges GitHub discovery from authenticated with accountoctocatto unauthenticated with no account.Changes: Source control settings discovery
Layer / File(s) Summary Provide settings to test layers
apps/server/src/sourceControl/SourceControlDiscovery.test.ts,apps/server/src/sourceControl/SourceControlProviderRegistry.test.tsThe test setup provides server settings at the outer layer. The registry helper accepts optional Bitbucket and server-settings services. Check discovery after disabling GitHub
apps/server/src/sourceControl/SourceControlDiscovery.test.ts,apps/server/src/sourceControl/SourceControlProviderRegistry.test.tsNew tests verify that GitHub discovery reports account octocatbefore the host is disabled, then reports unauthenticated with no account afterward.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
e045b-
The new tests cover discovery before and after GitHub is disabled. No actionable issue is identified before merge.
Pre-merge checks:
4-
Passed checks: 4 passed-
Check name Status Explanation Title check The title clearly and concisely describes the main change: sharing source control harness settings in server tests. Description check The description includes the problem, change, scope and approval reference, focused verification steps, observed results, and tooling details. It is complete and directly matches the changeset. Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
coderabbitai[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge added labelsmacroscope-review
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
Note
Written by
gpt-6.1-solon behalf of MariaThanks for fixing the test helpers. The diff changes only settings composition and regressions in two test files, so this is test maintenance rather than a runtime bug fix. Under Read this first, review capacity is limited, and right now we are only taking focused bug fixes from outside contributors. Please keep this cleanup tracked in #17608 and request reconsideration when maintainers reopen scope for test maintenance.
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed