Skip to content

feat(ci): bring miner package under Codecov patch gate (#4864)#5305

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
andriypolanski:feat-miner-codecov-patch-gate-4864
Jul 12, 2026
Merged

feat(ci): bring miner package under Codecov patch gate (#4864)#5305
JSONbored merged 1 commit into
JSONbored:mainfrom
andriypolanski:feat-miner-codecov-patch-gate-4864

Conversation

@andriypolanski

Copy link
Copy Markdown
Contributor

Summary

Adds packages/gittensory-miner/lib/**/*.js to the vitest v8 coverage include list so changed miner library lines appear in the uploaded lcov.info report. Codecov's existing 99% patch gate then applies to miner diffs the same way it already does for src/** and packages/gittensory-engine/src/**.

Miner tests already run in CI (test:miner-pack, path-filtered validate-tests); this closes the gap where those tests could pass without any patch-coverage obligation on miner code.

Closes #4864

Changes

Area Change
vitest.config.ts Include packages/gittensory-miner/lib/**/*.js in coverage collection
codecov.yml Document miner lib as a measured path (no new ignore entries)
test/unit/codecov-policy.test.ts Regression: miner lib is in vitest include and not codecov-ignored

Scope notes

  • Measured: packages/gittensory-miner/lib/**/*.js only — same pattern as engine's src/** focus; thin bin/ entrypoints stay out of the include list (mirrors how src/server.ts is codecov-ignored).
  • This PR: config + policy test only — no miner runtime changes. Patch coverage on this PR itself applies only to the test file under test/** (codecov-ignored) and non-src/** config files.
  • Follow-on PRs that touch miner lib must hit 99% patch coverage (lines and branches) on changed hunks, same bar as backend src/**.

Test plan

  • npm run test:unit -- test/unit/codecov-policy.test.ts
  • npm run test:ci (full gate)
  • npm run test:coverage — confirm merged lcov lists packages/gittensory-miner/lib/** paths
  • After merge: open a small miner-lib PR and confirm codecov/patch evaluates changed miner lines

Notes

  • Issue labels: help wanted, gittensor:priority, gittensor:feature — confirm contributor eligibility before opening.
  • .claude/skills/contributing-to-gittensory/reference.md still says coverage include is src/**/*.ts only; a separate doc tweak may be warranted after this lands.
  • Existing miner unit tests under test/unit/miner-*.test.ts already import from packages/gittensory-miner/lib/**; no new behavioral tests required for this wiring change.

@andriypolanski andriypolanski marked this pull request as draft July 12, 2026 13:31
@gittensory-orb gittensory-orb Bot added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 12, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@gittensory-orb

gittensory-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-12 13:46:42 UTC

3 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): codecov.yml (matched **/codecov.yml).

Review summary
This is a narrow config-only change that adds packages/gittensory-miner/lib/**/*.js to vitest's coverage include list so Codecov's existing 99% patch gate applies to miner code the same way it already does for src/** and the engine package. The codecov.yml comment update and the new regression test both correctly reflect the vitest.config.ts change, and since this PR touches no miner runtime code, its own patch coverage only applies to codecov-ignored test/config files, consistent with the stated scope. The change closes the linked issue #4864 and is well-targeted, mechanical, and low-risk.

Nits — 6 non-blocking
  • vitest.config.ts's exclude list (`exclude: ["src/env.d.ts", "apps/**"]`) isn't updated to explicitly exclude `packages/gittensory-miner/lib/bin/**`; the PR description says bin/ entrypoints should stay out, and while the include glob (`lib/**/*.js`) already naturally excludes anything outside lib/, a comment noting that reliance would help future maintainers avoid accidentally broadening the include.
  • The new test in test/unit/codecov-policy.test.ts only checks that no codecov.yml ignore entry contains the string 'gittensory-miner' — a more literal `include`-mirroring assertion (checking the ignore list doesn't shadow the specific lib/**/*.js glob) would be slightly more precise, though not necessary given the current negative-match approach works.
  • Consider adding a brief note in codecov.yml's ignore-list comment clarifying that packages/gittensory-miner/lib/bin/** is intentionally excluded via the vitest include pattern rather than an explicit ignore rule, to make the scope decision self-documenting for the next contributor touching miner code.
  • nit: `test/unit/codecov-policy.test.ts:78` verifies the Vitest include through a raw regex match, so a future commented-out or dead string could satisfy the test without proving the active coverage config still measures miner lib files.
  • nit: `codecov.yml:29` says the Codecov ignore list mirrors Vitest exclusions, but the file also ignores paths that are not in `vitest.config.ts`'s `coverage.exclude`, so the wording is a little looser than the actual contract.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #4864
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 148 registered-repo PR(s), 100 merged, 29 issue(s).
Contributor context ✅ Confirmed Gittensor contributor andriypolanski; Gittensor profile; 148 PR(s), 29 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
Review context
  • Author: andriypolanski
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 148 PR(s), 29 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

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


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@JSONbored JSONbored marked this pull request as ready for review July 12, 2026 13:33
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.40%. Comparing base (d56f4ec) to head (2fd377d).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5305      +/-   ##
==========================================
+ Coverage   94.37%   94.40%   +0.03%     
==========================================
  Files         474      548      +74     
  Lines       40128    43834    +3706     
  Branches    14631    14631              
==========================================
+ Hits        37869    41381    +3512     
- Misses       1583     1777     +194     
  Partials      676      676              
Flag Coverage Δ
shard-1 44.11% <ø> (-2.32%) ⬇️
shard-2 34.22% <ø> (-0.49%) ⬇️
shard-3 32.26% <ø> (+0.19%) ⬆️
shard-4 31.48% <ø> (-0.63%) ⬇️
shard-5 33.37% <ø> (-0.32%) ⬇️
shard-6 42.87% <ø> (-1.97%) ⬇️

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored merged commit 8fd32af into JSONbored:main Jul 12, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. manual-review Gittensor contributor context

Projects

Development

Successfully merging this pull request may close these issues.

Bring the miner package under the Codecov patch-coverage gate

2 participants