Skip to content

chore(ci): consolidate the 3-shard test matrix into one unsharded validate-tests run#8514

Merged
JSONbored merged 2 commits into
mainfrom
chore/unshard-validate-tests
Jul 24, 2026
Merged

chore(ci): consolidate the 3-shard test matrix into one unsharded validate-tests run#8514
JSONbored merged 2 commits into
mainfrom
chore/unshard-validate-tests

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Queue-pressure + reliability consolidation (follows the CodeQL default-setup removal and #8512's batched cache cleanup): at the one-shot gate's PR volume, the 2 extra shard runners per PR were a major driver of org-wide Actions concurrency saturation (observed: 60-run queue), and the shard seams were a recurring flake/incident source. One slower job (~10–15 min added PR latency; timeout 45) buys:

  • 2 fewer runners per PR, every PR.
  • One honest whole-suite lcov — the identical signal npm run test:coverage gives locally — replacing 3 additive shard uploads. codecov.yml's after_n_builds drops 3 → 1 (the new always-lands floor; a floor above it would leave codecov/patch permanently un-posted on non-rees/control-plane PRs). The narrow premature-window this reopens on rees/control-plane PRs self-corrects on the backend upload and is documented in place; require_ci_to_pass still holds the final verdict.
  • Global 90% threshold runs inline in full-suite runs (scoped-selection runs keep COVERAGE_NO_THRESHOLDS via the exact expression the merge job used) — so validate-tests-merge is deleted outright, along with the blob-report artifact plumbing.
  • The duration-aware sharding stack retires: compute-test-shards.ts, fetch-test-timing.ts, test-timing-refresh.yml (one fewer scheduled workflow), and their suites.
  • Codecov flags: shard-Nbackend. codecov-policy.test.ts pins updated — the merge job's absence is now itself pinned so a stale resurrection can't slip back in.
  • The validate aggregator's needs drops the merge job; scoped-selection, harness-skip narrowing, no_tests_matched/no_src_coverage escapes, and the fork/tokenless upload split are all preserved verbatim.

Validation

actionlint clean; codecov-policy suite 8/8 green against the new topology; stale-reference sweep clean (remaining "shard" mentions in ci.yml are historical rationale comments, with the job banner rewritten). This PR's own CI run is the live proof of the single-shard path end-to-end — including the first inline whole-suite threshold check and the single backend-flag Codecov upload.

…idate-tests run

At the one-shot gate's PR volume the 2 extra runners per PR were a major
driver of org-wide Actions concurrency saturation (observed: 60-run queue),
and the shard seams were a recurring flake/complexity source. One slower
job (~10-15 min added PR latency, timeout raised to 45) buys:

- 2 fewer runners per PR, every PR
- ONE honest whole-suite lcov (the exact signal npm run test:coverage gives
  locally), replacing 3 additive shard uploads -- codecov.yml's
  after_n_builds drops 3 -> 1 (the new always-lands floor; the narrow
  rees/control-plane premature-window this reopens self-corrects and is
  documented in place)
- the global 90% threshold runs INLINE in full-suite runs (scoped runs keep
  COVERAGE_NO_THRESHOLDS via the same expression the merge job used), so
  validate-tests-merge is deleted outright
- the whole duration-aware sharding stack retires: compute-test-shards.ts,
  fetch-test-timing.ts, test-timing-refresh.yml (one fewer scheduled
  workflow), their suites, and the blob-report artifact plumbing

Codecov flags: shard-N -> backend. codecov-policy pins updated (the merge
job's absence is now itself pinned).
@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 24, 2026
…s job

Four tests across workflow-runner-labels, ci-skip-draft-prs, and
ci-composite-setup-workspace still pinned the 3-shard shape (the merge
job in validate's needs, the merge job's draft-skip condition, and its
save-cache:false composite call). All now pin the single-job topology;
codecov-policy already pins the merge job's absence.
@JSONbored
JSONbored merged commit 0234cc1 into main Jul 24, 2026
1 check passed
@JSONbored
JSONbored deleted the chore/unshard-validate-tests branch July 24, 2026 17:21
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 24, 2026
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.53%. Comparing base (962fa08) to head (5d96270).
⚠️ Report is 19 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #8514       +/-   ##
===========================================
+ Coverage   80.35%   92.53%   +12.18%     
===========================================
  Files         793      793               
  Lines       79483    79527       +44     
  Branches    24018    24030       +12     
===========================================
+ Hits        63867    73591     +9724     
+ Misses      12673     4799     -7874     
+ Partials     2943     1137     -1806     
Flag Coverage Δ
backend 93.71% <ø> (?)
control-plane 99.85% <ø> (ø)
rees 88.56% <ø> (ø)
shard-2 ?
shard-3 ?

Flags with carried forward coverage won't be shown. Click here to find out more.
see 240 files with indirect coverage changes

JSONbored added a commit that referenced this pull request Jul 24, 2026
…o changes, make selfhost push-only, one-runner same-repo previews, merge the calibration advisories (#8523)

Follow-up to the validate-tests unsharding (#8514), attacking the remaining
per-PR runner fan-out at the source (observed 44-deep queue with 3 running):

1. The standalone `security` job folds into `changes` as a PR-only
   dependency-review step -- one fewer runner slot on EVERY PR at zero
   wall-clock cost (the API lockfile diff takes seconds). `validate`'s
   needs drops it; a dep failure still reddens `validate` via `changes`.

2. selfhost.yml drops its pull_request trigger (~99 x 5.2min/week --
   migrations/** made nearly every backend PR pay a docker build+boot).
   ci.yml still validates migrations/schema/pg suites pre-merge; the boot
   smoke now catches a break minutes after merge, and self-host users only
   consume tagged releases, never main.

3. Same-repo UI PRs build AND deploy their preview in ONE job: the deploy
   half moves to a shared .github/actions/deploy-ui-preview composite
   (setup-workspace precedent), ui-preview.yml gains the inline
   build-deploy job, and ui-preview-deploy.yml becomes fork-only (its job
   skips runner-free for same-repo builds via head_repository comparison).
   The fork trust boundary is untouched: fork code still builds with zero
   secrets and deploys only through the trusted workflow_run half. Bonus:
   the deploy job now has a trusted default-branch checkout, retiring the
   hand-synced hardcoded Node version.

4. backtest-logic-check.yml + counterfactual-replay-check.yml merge into
   calibration-advisory.yml -- identical scaffolding, overlapping paths
   (ai-review.ts fired BOTH), so one job runs both halves for one npm ci
   and one runner slot. The replay half keeps its budget spend-guard and
   now self-gates on the canonical prompt actually differing (replacing
   its ai-review.ts-only path filter). Fail-open posture preserved
   verbatim on every advisory step.

Net per-PR floor drops 5 -> 4 slots, UI PRs 7 -> 5, migration PRs lose the
5-minute docker job. Pinned tests updated (ci-skip-draft-prs,
workflow-runner-labels); skill reference.md rows updated.
JSONbored added a commit that referenced this pull request Jul 24, 2026
…toring both coverage attribution and subprocess artifacts (#8568)

Second, complete fix for the 2026-07-24 codecov/patch (0%/99%) incident.
The first fix (#8564) deleted the miner/MCP in-place build output before
the coverage run, which restored .ts coverage attribution and --changed
tracing -- but broke the other class of tests: subprocess-spawning ones
(the CLI harnesses and MCP stdio tests) run under plain Node outside
Vite's resolver and genuinely need the built lib/bin .js at spawn time
(node's ESM resolver does not fall back from a .js specifier to a .ts
sibling). Scoped post-fix runs failed in miner-discover-cli/--help,
miner-init-wizard e2e, and all 14 mcp-feasibility-gate stdio tests.

This replaces that approach: a resolve-stage vitest plugin rewrites
relative .js-suffixed imports that land inside
packages/loopover-{miner,mcp}/{lib,bin} to their .ts sibling when it
exists, so in-process imports always carry the source identity (correct
v8 attribution + import-graph tracing) while the built .js stays on disk
for spawned subprocesses. The #8564 ci.yml surgery (pre-coverage clean,
unconditional check-miner-package exclusion, trailing pack-integrity
step) is reverted -- the workflow returns to the #8514 shape, with the
plugin making it correct.
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