Repository navigation
chore: regenerate third-party notices in the pre-commit hook, untrack static/index.html - #57
Merged
Merged
Conversation
The 'Attribution is current' CI job failed on five PRs because a lockfile change was committed without bun run licenses:generate. scripts/ensure-attribution.mjs now runs from the husky pre-commit hook: when a commit stages a generator input it regenerates the notices and stages them, and it refuses the commit when cargo-about is missing or not the version ci.yml pins. Other commits exit immediately.
… the website repo static/index.html is vite build output that names hashed files under the gitignored static/_app/, so the committed copy was stale after every build and broken on a fresh clone; the app compiles without it. The pre-commit attribution guard now passes --skip-www so a dependency commit does not rewrite the sibling website checkout.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The "Attribution is current" CI job has failed on five PRs since v1.0.1 (three pushes in a row on one of them), every time for the same reason: a dependency change was committed without
bun run licenses:generate. Nothing caught it locally.scripts/ensure-attribution.mjs, run from the husky pre-commit hook. When a commit stages a file the notices are generated from (Cargo.lock,bun.lock,src-tauri/about.toml,src-tauri/about.hbs,vite.config.js, the generator itself), it regeneratesATTRIBUTION.mdandTHIRD-PARTY-NOTICES.txtand stages them into that commit. Any other commit exits immediately.cargo-aboutis missing or is not the versionci.ymlpins, since a different version produces output CI rejects anyway. The pinned version is read fromci.yml, so there is one place to bump it.SKIP_ATTRIBUTION=1is the escape hatch.--skip-wwwflag to the generator;bun run licenses:generate(the release flow) still updates the siblingechophrase-wwwdata file, so the site keeps listing what the last release ships.static/index.htmlis no longer tracked. It is vite build output that names hashed files under the gitignoredstatic/_app/, so the committed copy was stale after every build and a broken page on a fresh clone. It is now in.gitignore.CLAUDE.md,CONTRIBUTING.md, and a### DevelopersCHANGELOG entry.Limits: the guard only runs for people with git hooks installed (
bun installsets them up), and CI remains the backstop. It reads the working-tree lockfile, not the staged copy.Test plan
Cargo.lockstaged withcookiedowngraded: notices regenerated and staged in 29s,static/index.htmlleft cleancargo-aboutversion changed to one not installed: commit refused with the install command--forceregeneration returns the tree to matchmaincargo check -p echophrase --no-default-featurespasses on Windows withstatic/in fresh-clone state and noindex.htmlcargo-aboutat all; the guard on macOS / Linux; a Rust build withoutindex.htmlon macOS / Linux (the Rust CI jobs do not run for this diff)