Skip to content

fix(ci): restore all tracked files before goreleaser - #741

Merged
undera merged 1 commit into
mainfrom
fix/release-dirty-tree
Aug 10, 2026
Merged

fix(ci): restore all tracked files before goreleaser#741
undera merged 1 commit into
mainfrom
fix/release-dirty-tree

Conversation

@undera

@undera undera commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

The v2.1.2 release run failed at git is in a dirty state (run). goreleaser aborts during getting and validating git state, so no GitHub release was created and the image / publish_chart jobs were skipped — nothing reached Docker Hub. The tag has since been deleted; this will go out as v2.1.3.

Root cause

Replaying the release steps on a clean clone of the tagged commit — npm inpm run buildgit clean -f && git checkout frontend/yarn.lock — leaves exactly one dirty path:

 M frontend/package-lock.json

npm i strips libc fields from the committed lockfile (48 deletions), because the runner's npm is older than whichever npm wrote it. The cleanup step restored only frontend/yarn.lock, which npm i also rewrites, so nobody was restoring package-lock.json.

This is not a regression from either recent PR — the release path has been broken since some frontend dependency bump landed after v2.1.1 in March.

Change

-        run: git clean -f && git checkout frontend/yarn.lock
+        run: git checkout -- . && git clean -fd

Restores every tracked file rather than naming one, and -d drops untracked directories that plain -f leaves behind.

No -x, deliberately: the built pkg/frontend/dist is ignored via /pkg/frontend/dist/* and the Go binary embeds it. I verified in a scratch repo that git clean -fd leaves a directory whose contents are all ignored intact — with -x it would be deleted and the build would fail on the go:embed.

Not fixed here

This workflow pins no node-version, so the runner's npm can keep drifting from whichever npm writes the lockfile. Pinning it would stop the rewrite at the source rather than cleaning up after it. Separately, the release job checks out shallow — only pre_release sets fetch-depth: 0 — which is why goreleaser warned couldn't find any tags before "v2.1.2" and will produce an empty changelog.

🤖 Generated with Claude Code

The v2.1.2 release failed at "git is in a dirty state", before goreleaser
created anything, so the image and publish_chart jobs were skipped and
nothing reached Docker Hub.

Reproducing the release steps on a clean clone shows `npm i` rewriting
frontend/package-lock.json: the committed lockfile carries `libc` fields
that the runner's npm strips. The cleanup step restored only
frontend/yarn.lock, so the rewritten package-lock.json stayed dirty.

Restore every tracked file instead of naming one. `git clean -fd` also
drops untracked directories, which `-f` alone leaves behind. No `-x`, so
the ignored pkg/frontend/dist survives for the Go build to embed.

The underlying mismatch remains: this workflow pins no node-version, so
the runner's npm can differ from whichever npm wrote the lockfile.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@undera
undera marked this pull request as ready for review August 10, 2026 14:07
@undera
undera merged commit bb2163b into main Aug 10, 2026
4 checks passed
@undera
undera deleted the fix/release-dirty-tree branch August 10, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant