Skip to content

Inject git-tag version into footer + wallet popup#23

Merged
heyitsStylez merged 5 commits into
mainfrom
version-injection
May 5, 2026
Merged

Inject git-tag version into footer + wallet popup#23
heyitsStylez merged 5 commits into
mainfrom
version-injection

Conversation

@heyitsStylez
Copy link
Copy Markdown
Owner

Summary

  • build.py resolves the deployed version via git describe --tags --always --dirty (resolve_version()), falling back to unknown when git is unavailable
  • {{VERSION}} (display, retains -dirty) and {{VERSION_CLEAN}} (link target, -dirty stripped) are substituted into the assembled HTML; footer + wallet popup use them, footer wraps in a link to the matching GitHub Release
  • Adds test/build/test_resolve_version.py (5 cases via temp git repos) and wires Python tests into .github/workflows/test.yml

Closes #17

Test plan

  • python3 build.py --check
  • npm test (23/23)
  • python3 -m unittest discover -s test/build -v (5/5)
  • CI green on PR

Note: the artifact bakes its own version at build time, so a fresh rebuild commit will display -dirty until the next clean build at a tagged commit. AC ("builds with uncommitted changes show a -dirty suffix") is satisfied; release workflow can be tightened separately if desired.

🤖 Generated with Claude Code

heyitsStylez and others added 2 commits May 5, 2026 09:38
Adds resolve_version() to build.py (git describe --tags --always --dirty,
falling back to 'unknown'), and substitutes {{VERSION}} / {{VERSION_CLEAN}}
in the assembled HTML so the footer and wallet popup stay in lockstep with
the deployed tag. Footer wraps the version in a link to the matching
GitHub Release; -dirty is stripped from the link target only.

Closes #17

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hyperwheel Ready Ready Preview, Comment May 5, 2026 1:45am

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
heyitsStylez and others added 2 commits May 5, 2026 09:43
Two compounding issues broke the CI artifact-equality check:

1. build.py rewrites the artifacts on every build, dirtying the tree and
   stamping every committed artifact "-dirty" forever.
2. CI checkout was shallow with no tags, so describe fell back to a bare
   short SHA — never matching what the local commit produced.

resolve_version() now ignores the artifact files when computing dirtiness,
and the build workflow fetches full history + tags, so local and CI agree
on the version string and the diff check stays green.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Root cause of repeated CI failures: hyperwheel.html / public/index.html
were tracked AND baked their own commit's git-describe output. Committing
the artifact creates a new HEAD, so the artifact always references the
prior commit's SHA — the next rebuild produces a different string and
the byte-equality check fails. Compounded by CI's shallow checkout
having no tags.

Permanent fix: artifacts are now gitignored. Vercel already rebuilds on
deploy via vercel.json's buildCommand, so production stays correct.
The CI build job drops the artifact-diff step and just runs the build
itself; the test job still runs npm test + the Python build tests.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@heyitsStylez heyitsStylez merged commit 9bd8207 into main May 5, 2026
4 checks passed
@heyitsStylez heyitsStylez deleted the version-injection branch May 5, 2026 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inject git-tag version into footer + wallet popup

1 participant