Skip to content

feat(miner): wire GITTENSORY_MINER_VERSION build-time override (#4310) - #4336

Merged
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
RealDiligent:feat/miner-version-env-override-4310
Jul 9, 2026
Merged

feat(miner): wire GITTENSORY_MINER_VERSION build-time override (#4310)#4336
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
RealDiligent:feat/miner-version-env-override-4310

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

Closes #4310

Adds a build-time-injectable miner version override so fleet Docker images can report their real built ref instead of always echoing package.json.

  • New packages/gittensory-miner/lib/version.js exports MINER_PACKAGE_VERSION (JSON import at module load) and resolveMinerVersion(env)
  • GITTENSORY_MINER_VERSION wins over package.json when set (mirrors root GITTENSORY_VERSION / ARGENV pattern)
  • Wired into --version / printVersion and status --json via collectStatus

Validation

  • npx vitest run test/unit/miner-version.test.ts test/unit/miner-status.test.ts -t GITTENSORY_MINER_VERSION
  • npm run build:miner

Made with Cursor

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.94%. Comparing base (90da00d) to head (b2e76f4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4336   +/-   ##
=======================================
  Coverage   93.94%   93.94%           
=======================================
  Files         397      397           
  Lines       36744    36744           
  Branches    13430    13430           
=======================================
  Hits        34519    34519           
  Misses       1569     1569           
  Partials      656      656           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@superagent-security

Copy link
Copy Markdown
Contributor

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

Co-authored-by: Cursor <cursoragent@cursor.com>
@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 9, 2026
@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-09 04:46:21 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR adds packages/gittensory-miner/lib/version.js with resolveMinerVersion(env) and wires it into bin/gittensory-miner.js (--version) and lib/status.js (collectStatus), replacing the createRequire-based package.json version reads. The env-override logic itself is correct (trims, falls back to MINER_PACKAGE_VERSION on empty/whitespace) and is well covered by new unit tests exercising the real resolveMinerVersion/collectStatus/--version paths, not fabricated payloads. The main gap: the PR's stated purpose is for 'fleet Docker images' to report a real built ref via GITTENSORY_MINER_VERSION, but the diff contains no Dockerfile/CI wiring (ARG→ENV) that would ever set that variable during a miner image build — mirroring the root GITTENSORY_VERSION pattern shown in the reference Dockerfile — so the override path, while functionally correct, is unreachable in the actual fleet build today.

Blockers

  • The stated goal ('fleet Docker images can report their real built ref') isn't actually achieved: no Dockerfile/build pipeline change in this diff sets GITTENSORY_MINER_VERSION (unlike the existing ARG GITTENSORY_VERSION → ENV GITTENSORY_VERSION pattern for the root image), so resolveMinerVersion's override branch has no way to be populated in a real build and the linked issue feat(miner-deployment): wire GITTENSORY_MINER_VERSION build-time metadata into both form factors #4310 is only partially closed for the Docker form factor — please point to where GITTENSORY_MINER_VERSION actually gets set at build time, or add that wiring here.
Nits — 4 non-blocking
  • version.js:2 comment 'the laptop npm-install default' is oddly phrased for what is really just the package.json semver fallback — consider clarifying.
  • status.js's leftover `const require = createRequire(import.meta.url)` (line 11) is still used by readEngineVersion/requiredNodeMajor, but it's worth a one-line confirmation in the PR description that it wasn't meant to be removed alongside readOwnVersion.
  • Add the ARG GITTENSORY_MINER_VERSION / ENV GITTENSORY_MINER_VERSION plumbing to whichever Dockerfile builds the fleet miner image, following the existing root Dockerfile's GITTENSORY_VERSION ARG→ENV pattern, so this override is actually reachable in production.
  • Consider documenting the GITTENSORY_MINER_VERSION env var in the miner README alongside the existing --version/--json status docs, since it's now a supported operator-facing override.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #4310
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: 301 registered-repo PR(s), 116 merged, 17 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 301 PR(s), 17 issue(s).
Gate result ✅ Passing No configured blocker found.
Linked issue satisfaction

Addressed
The PR adds lib/version.js with a JSON-import-derived MINER_PACKAGE_VERSION and a resolveMinerVersion(env) that lets GITTENSORY_MINER_VERSION override it, mirroring the referenced engine/version.ts and Dockerfile ARG/ENV patterns, and wires the resolved value into both printVersion (bin/gittensory-miner.js) and collectStatus's package.version (lib/status.js) for status --json. It also adds unit te

Review context
  • Author: RealDiligent
  • 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: 301 PR(s), 17 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.

🟩 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

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit c388dbe into JSONbored:main Jul 9, 2026
9 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(miner-deployment): wire GITTENSORY_MINER_VERSION build-time metadata into both form factors

1 participant