chore: drop version from package.json, make git tag the source of truth#69
Merged
Conversation
The release workflow was the only enforced consumer of the
require(\"./package.json\").version check, and it only existed to
guard against tag/package.json drift. Docker image tags and
gh release create already derive from GITHUB_REF_NAME, so the
guard rail was the only thing the field enabled.
Changes:
- package.json: remove the version field; regenerate package-lock.json
- src/server.js: drop the require and the v\${version} from the boot log
- .github/workflows/release.yaml: drop the PACKAGE_VERSION comparison
- README.md, AGENTS.md, charts/.../README.md: rewrite the prose that
claimed package.json was the single source of truth
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.
Why
The release workflow was the only enforced consumer of
require("./package.json").version, and that check only existed to catch tag/package.json drift. Docker image tags andgh release createalready derive fromGITHUB_REF_NAME, so the guard rail was the only thing the field actually enabled.Keeping it forces a two-step release (bump file, commit, tag, push) and produced a CI failure on the recent
2.0.0-rc1tag attempt because the tag version didn't match the committed1.8.0. The npm convention no longer earns its keep on a service that is not published to npm and does not expose a version in its API.The git tag becomes the single source of truth.
Changes
package.json— remove theversionfield; regeneratepackage-lock.jsonvianpm install --package-lock-onlysrc/server.js— drop therequire("../package.json").versionimport and thev${version}from the boot log.github/workflows/release.yaml— drop thePACKAGE_VERSIONcomparison block. Tag parsing andGITHUB_OUTPUTemission unchanged. Docker tags andgh release createwere already tag-derived, no other workflow edits needed.README.md(L132, L152),AGENTS.md(L25),charts/readability-js-server/README.md(L83) — rewrite the prose that claimedpackage.jsonwas the single source of truth.Not touched:
charts/readability-js-server/Chart.yamlappVersion(manually maintained and independent by design),Makefilerelease-tagtarget (did not readpackage.json), tests (none referenced the version).Verification
npm ci(afterrm -rf node_modules)npm run lintnpm testmake helm-lintmake helm-templateTAG=v1.9.0)version=1.9.0,major=1 minor=9 patch=0, correct tagsFollow-ups
Chart.yamlappVersionis now the only manually-tracked version string. Bump it when a release tag changes the chart's default image.