Skip to content
Source
Sign inSign up
pingdotgg/t3code

test(server): share source control harness settings #17760

Closedfixfon(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/17760/headopened View on GitHub

Problem

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, received authenticated); 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 lint for the two files — exit 0 with six unused-symbol warnings, confirmed identical to baseline. Scoped vp fmt --check and git diff --check passed.

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

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at e045b5a

      Macroscope'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.
      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      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: 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.ts
      • apps/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.com changes GitHub discovery from authenticated with account octocat to 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.ts
      The 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.ts
      New tests verify that GitHub discovery reports account octocat before 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: Passed 4
      Passed Passed checks: 4 passed
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main change: sharing source control harness settings in server tests.
      Description checkPassedThe 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 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.
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • 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.
    4. juliusmarminge added labelsmacroscope-review

    5. Note

      Written by gpt-6.1-sol on behalf of Maria

      Thanks 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.

    6. maria-rcks closed this

Sign in to join this conversation.