Add -v/--version flag, derived from the git tag#12
Conversation
The git tag stays the single source of truth (the release flow is already tag-driven). build.py bakes $REPO_INTEL_VERSION into the released artifact; a raw source checkout derives from `git describe` against the script's own directory. The committed dist/repo-intel keeps a 0.0.0-dev sentinel so `make build` stays byte-for-byte reproducible (CI gates that), while the released asset carries the real tag. release.yml passes the tag to the build and the published-artifact smoke test asserts the baked version.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR implements a complete versioning system: repo-intel now accepts ChangesVersioning Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
What
Adds
-v/--versionto print the tool version, with the git tag as the single source of truth — no hardcoded constant to bump.How the version resolves
$REPO_INTEL_VERSIONrepo-intel 1.2.0make dev)git describein the script's own dirrepo-intel v1.2.0-3-gabcdist/repo-intel0.0.0-devsentinelAll user-facing install paths fetch the same released asset, so all three report the baked version (verified for each).
Why the committed artifact can't carry a real number
CI's stale-artifact gate requires
make buildto be byte-for-byte reproducible at every commit. Agit describevalue changes between commits, which would fail that gate. So the version is injected only at release-build time (via env var): the committed artifact stays reproducible while the released asset carries the real tag. No drift gate needed — there's no constant to keep in sync.Changes
repo-intel.py—VERSIONsentinel,resolve_version()(describes its own dir, not the analyzed repo's cwd),-v/--versionshort-circuit inparse_args, HELP text.build.py— bakes$REPO_INTEL_VERSIONinto the artifact when set; leaves the sentinel otherwise.release.yml— passes the tag to the build step; published-artifact smoke test now assertsrepo-intel <version>.dist/repo-intel— rebuilt (verified byte-identical across consecutive builds).README.md— notes--version.Verification
make checkpasses (Ruff lint+format, Prettier, svelte-check).1.2.3-rc1) flow through correctly.curl | python3 -, Homebrew) report the baked version.Summary by CodeRabbit
New Features
-v/--versionflag to display the tool versionDocumentation