Skip to content

test: split GitHub and GitLab mocks out of runtime setup.spec to fix main lint - #39837

Merged
OrcaWin merged 2 commits into
mainfrom
fix/setup-spec-max-lines
Nov 8, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
fix/setup-spec-max-lines

Conversation

@nwparker

@nwparker nwparker commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

The shared test-mock file for the runtime tests grew one line past the lint size limit, so lint now fails on main and on every PR. This splits it into smaller files without changing any test.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2 $\color{#cf222e}{\Huge{\mathbf{−}}}$​482 $\color{#cf222e}{\Huge{\mathbf{−}}}$​480
Prod 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​510 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​510

What Changed

src/main/runtime/orca-runtime-test-mocks/setup.spec.ts reached 801 counted lines (limit 800) after #39575 added one mock line. The file holds shared mocks, not tests, so I split it by mocked area:

  • github-hosted-review-mocks.ts: the GitHub and hosted-review mock functions plus their vi.mock registrations
  • gitlab-mocks.ts: the GitLab mock functions plus their vi.mock registrations

setup.spec.ts re-exports both modules (export * from ...) as its first statements, so the GitHub and GitLab mocks still register before its other imports, and every existing import { ... } from '.../setup.spec' keeps working unchanged. Mock definitions and default return values moved over exactly as they were. No tests or assertions changed.

Why

This fixes the max-lines lint failure on main by splitting the file along a real boundary. It doesn't delete blank lines or add a lint exemption. The new files are plain .ts modules under the 300-line limit, like the other *-mocks.ts helpers in src/main.

Linked Issue

N/A (maintainer fix for a broken main lint step)

Visual Proof

N/A: this only changes test mocks, with no UI or behavior change.

Testing

  • Root lint step as CI runs it (node node_modules/oxlint/bin/oxlint): passes. On main it fails with max-lines on setup.spec.ts.

  • JS-plugin lint and oxfmt --check on the changed directory: pass

  • pnpm typecheck: passes

  • pnpm test src/main/runtime/construction/orca-runtime.test.ts (the entry point that loads the orca-runtime-tests/*.spec.ts fragments using these mocks) plus four direct consumers of setup.spec: 898 passed, 3 skipped. That's the same result as on unmodified main.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below (no test changes; this is a mock-file split)

  • Every added test fails without this change and avoids the test anti-patterns

Risk

Level: Low. Only test-support files change. If anything breaks, it would be a runtime spec that loses a GitHub/GitLab mock, which would show up as a test failure, not a product change. A plain revert backs it out.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

setup.spec.ts reached 801 counted lines after #39575, failing the root
oxlint max-lines rule on main. Move the GitHub/hosted-review and GitLab
mock functions and their vi.mock registrations into sibling modules that
setup.spec re-exports, so every consumer keeps the same imports and mocks.
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds separate shared Vitest mock harnesses for GitHub-hosted-review and GitLab operations. Each harness provides hoisted mock functions, partially mocks related modules, and exports the mock bindings. The shared setup re-exports both harnesses and removes their operation mocks, while retaining agent-status, detection, and trust mocks.

Merge Risk: Minimal · up to b8d5b

This is a test-only refactor that splits mocks out of a shared setup file to fix a max-lines lint failure. It does not affect production behavior. The CI failures visible in the supplied evidence are in an unrelated build job. The change is ready to merge.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title names the main change: splitting GitHub and GitLab mocks out of the runtime setup.spec file, which the PR says fixes a max-lines lint failure. It is specific, concise, and matches the change…
Description check Passed The description follows the repository template. It has an ELI5, What Changed, Why, Visual Proof marked N/A with a reason, Testing with the commands run and results, Risk with a level and a revert pat…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: splitting GitHub and GitLab mocks out of the runtime setup.spec file, which the PR says fixes a max-lines lint failure. It is specific, concise, and matches the changeset and the stated objective. The title's 78 characters are a little long, but the content is accurate.

Full details: Description check

Explanation

The description follows the repository template. It has an ELI5, What Changed, Why, Visual Proof marked N/A with a reason, Testing with the commands run and results, Risk with a level and a revert path, and the Checklist. The Linked Issue section says N/A and gives a maintainer-fix reason, which the template allows for maintainers. The AI Disclosure section is absent, but the template marks it as skippable for internal contributors. Several template checkboxes are left unchecked in the Testing section, and the Testing section does not fill in which platforms were tested, which the template asks for. These gaps are minor.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • 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

Recent review info

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: fbf8a49e-1535-4e65-b0a7-6c9a0f539e18
Commits

Reviewing files that changed from the base of the PR and between 448aaad and b8d5b0f.

Files selected for processing: 3

  • src/main/runtime/orca-runtime-test-mocks/github-hosted-review-test-harness.ts
  • src/main/runtime/orca-runtime-test-mocks/gitlab-test-harness.ts
  • src/main/runtime/orca-runtime-test-mocks/setup.spec.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.

The module-mocking lint exempts *-test-harness.ts support modules shared by
split suites; the split-out GitHub and GitLab mock modules are exactly that.
@OrcaWin
OrcaWin merged commit 2a5a939 into main Nov 8, 2026
82 of 87 checks passed
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.

2 participants