Skip to content

fix(ci): build mcp/miner before test:coverage in test:ci - #7873

Merged
JSONbored merged 1 commit into
mainfrom
claude/test-ci-step-ordering-ce29e3
Jul 21, 2026
Merged

fix(ci): build mcp/miner before test:coverage in test:ci#7873
JSONbored merged 1 commit into
mainfrom
claude/test-ci-step-ordering-ce29e3

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • The local npm run test:ci composite script built @loopover/mcp and @loopover/miner (build:mcp/build:miner) after test:coverage, but packages/loopover-mcp and packages/loopover-miner ship .ts source only — their compiled bin/*.js/lib/*.js are gitignored. Every mcp-cli-*/miner-* test that spawns the compiled CLI via StdioClientTransport with a hardcoded bin/loopover-mcp.js/bin/loopover-miner.js path needs those binaries to already exist on disk, so a fresh checkout's local test:ci failed test:coverage with McpError: MCP error -32000: Connection closed (root cause: MODULE_NOT_FOUND on the missing compiled bin).
  • CI's own validate-tests job (.github/workflows/ci.yml) already builds engine → MCP → miner before its "Test with coverage" step, so CI itself was never affected — only the local test:ci script's ordering diverged from it.
  • Fix: move npm run build:mcp && npm run build:miner next to the already-correctly-ordered @loopover/engine/@loopover/discovery-index builds, ahead of typecheck/test:coverage, matching CI's order. test:mcp-pack/test:miner-pack keep their existing position in the script — they still run after their respective builds (which now happen much earlier), so that invariant holds.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes — it is a single-line reorder in package.json's test:ci script, no source changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • Linked issue — not applicable. I'm the repo's maintainer fixing a local-tooling ordering bug I found and verified myself; no contributor-issue-link requirement applies here.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally — full unsharded run: 1048 test files passed, 2 skipped, 19889 tests passed, 0 failures.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate — 0 vulnerabilities
  • New/changed-behavior unit tests for new branches/fallback paths/sanitizer boundaries — not applicable; this changes shell-command ordering in a package.json script (no src/** lines, no new branches). Verified instead by reproducing the failure from a clean state — deleted the gitignored packages/loopover-mcp/{bin,lib}/*.js, .tsbuildinfo, and packages/loopover-miner/bin/*.js, confirmed test/unit/mcp-discovery.test.ts fails with the Connection closed/MODULE_NOT_FOUND error on the old ordering, then confirmed it passes with the corrected order — plus a full green npm run test:ci end to end.

If any required check was skipped, explain why:

  • package.json is not under src/**, so this diff has no Codecov-measured lines/branches — patch coverage is not a meaningful gate for this change.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth/cookie/CORS/GitHub App/Cloudflare/session changes — not applicable, none touched.
  • API/OpenAPI/MCP behavior updates — not applicable; no MCP protocol/tool behavior changed, only when the package gets compiled during the local test pipeline.
  • UI changes — not applicable, no UI changed.
  • Public docs/changelogs — not applicable; changelogs are only edited for release-prep PRs.

Notes

  • No UI Evidence section: this PR has no visible UI/frontend/docs change.

npm run test:ci built @loopover/mcp and @loopover/miner (build:mcp/
build:miner) after test:coverage, but packages/loopover-mcp and
packages/loopover-miner ship .ts source only -- bin/*.js and lib/*.js
are gitignored. Every mcp-cli-*/miner-* test that spawns the compiled
CLI via StdioClientTransport with a hardcoded bin/loopover-mcp.js or
bin/loopover-miner.js path needs those binaries to already exist on
disk, so a fresh checkout's local test:coverage step failed with
McpError: MCP error -32000: Connection closed (root cause:
MODULE_NOT_FOUND on the missing compiled bin).

CI's own validate-tests job already builds engine, MCP, and miner
before its "Test with coverage" step -- only the local composite
script was out of order. Move build:mcp/build:miner next to the
already-correctly-ordered engine/discovery-index builds, ahead of
typecheck and test:coverage, matching CI. test:mcp-pack/test:miner-pack
keep their existing position: they still run after their respective
builds, just much earlier in the pipeline now.

Verified by deleting the gitignored mcp/miner build artifacts from a
clean state to reproduce the failure, then confirming the corrected
order builds both binaries before test:coverage runs and the full
local gate (npm run test:ci) passes end to end.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 21, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui 98c2c99 Commit Preview URL

Branch Preview URL
Jul 21 2026, 03:40 PM

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 21, 2026
@loopover-orb

loopover-orb Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Important

🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪

🔍 LoopOver is reviewing…

AI analysis is in progress. This comment will update when the review is complete.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing

@JSONbored
JSONbored merged commit 16fa59b into main Jul 21, 2026
14 checks passed
@JSONbored
JSONbored deleted the claude/test-ci-step-ordering-ce29e3 branch July 21, 2026 15:54
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.40%. Comparing base (2ac97ad) to head (98c2c99).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7873   +/-   ##
=======================================
  Coverage   91.40%   91.40%           
=======================================
  Files         730      730           
  Lines       74763    74763           
  Branches    22815    22815           
=======================================
  Hits        68335    68335           
  Misses       5385     5385           
  Partials     1043     1043           
Flag Coverage Δ
shard-1 58.56% <ø> (-0.01%) ⬇️
shard-2 51.84% <ø> (ø)
shard-3 50.21% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant