Repository navigation
ci: run the unit tests on every push and pull request - #55
Merged
Merged
Conversation
The Jest suite has never run in CI. Both workflows went straight from `npm install` to `npm run build`, so the three suites under tests/unit were green only on whichever machine last bothered to run them, and a regression could reach a pushed image unnoticed. The step goes into snapshot.yml only. That workflow already triggers on every branch push and every pull request, so it is the gate every commit passes; release.yml builds from a tag whose commit has already been through it. Placing the step before the build means a failing test stops the job before the image is pushed to ghcr.io. agents.md did not list `npm run test:unit` among the commands at all, which is part of why the gap survived this long. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JMHRfVM4Mzy1bhEUTc3se9
Agent sessions create git worktrees under .worktrees/. Untracked, they show up in `git status` and can be swept into the generated `set version to <v>` commits, where a worktree directory lands as a broken gitlink rather than as files. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JMHRfVM4Mzy1bhEUTc3se9
`just set-version` rewrote only package.json, so the two version fields in package-lock.json kept whatever value they had when npm last wrote the file. main carried 0.38.1 in the lockfile against 0.40.0 in package.json, two releases of drift. The recipe now walks both files: `.version` in each, plus `.packages[""].version` in the lockfile, which is where npm keeps the root package's own version in lockfileVersion 2. A json round-trip of package-lock.json reproduces the file byte for byte, so writing it back with the same indent changes nothing but the version lines. This commit also carries the correction to 0.40.0, so the drift is not left waiting for the next release. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JMHRfVM4Mzy1bhEUTc3se9
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.
The Jest suite has never run in CI.
snapshot.ymlandrelease.ymlboth go straight fromnpm installtonpm run build, so the three suites undertests/unit/were green only on whichever machine last ran them by hand, and a regression could reach a pushed image without anyone noticing.Verified before changing anything: on
origin/mainat 0.40.0 the suite is green — 3 suites, 28 tests, exit 0.A second gap turned up while checking that one, and is fixed here too:
just set-versionnever touched the lockfile.What changed
.github/workflows/snapshot.yml— aRun unit testsstep between install and build.agents.md—npm run test:unitwas missing from the Commands block entirely, which is part of why the gap survived. Added, plus a line saying CI runs it.justfile—set-versionnow writespackage-lock.jsonas well aspackage.json.package-lock.json— corrected to 0.40.0, closing the drift that already existed..gitignore—.worktrees/, so agent worktrees cannot be swept into the generatedset version to <v>commits as broken gitlinks.set-versionrunsgit add ., so this is a real path, not a hypothetical one.Why snapshot.yml and not release.yml
snapshot.ymlalready triggers on every branch push and every pull request, so it is the gate every commit passes anyway.release.ymlbuilds from a tag whose commit has already been through it, so a second run there would only duplicate. Placing the step before the build means a failing test stops the job before the image is pushed to ghcr.io, rather than after.The lockfile gap
_set-version-filesrewrotepackage.jsononly, so the lockfile kept whatever version npm last wrote into it.maincarried 0.38.1 inpackage-lock.jsonagainst 0.40.0 inpackage.json— two releases of drift.The recipe now walks both files:
.versionin each, plus.packages[""].version, which is where npm keeps the root package's own version inlockfileVersion: 2. A json round-trip ofpackage-lock.jsonreproduces the file byte for byte, so writing it back with the same indent touches nothing but the version lines. The resulting diff is identical to whatnpm installproduces on its own.Verification
vue-cli-service test:unitwas invoked, three suites PASS,Tests: 28 passed, 28 total.npm lsstill exits 0 against the rewritten lockfile.Recommended reading order
.github/workflows/snapshot.yml— the actual changejustfile— the second fix, independent of the firstpackage-lock.json— data, produced by the recipe aboveagents.md— documentation catching up.gitignore— one line of hygieneNoticed, not touched
GitHub reports 144 Dependabot findings on
main(17 critical, 55 high). That is the Node 14 / Vue CLI 4 stack and a separate piece of work.🤖 Generated with Claude Code
https://claude.ai/code/session_01JMHRfVM4Mzy1bhEUTc3se9