From 952646d0259c29b70e8e58b11794bde5e02abb31 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Sat, 24 Oct 2026 20:09:46 -0300 Subject: [PATCH] ci: no Blacksmith builder's config to ignore The release no longer runs useblacksmith/setup-docker-builder, so nothing writes buildkitd.toml into the checkout: its ignore lines and the test that held them guard a step that is gone. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 5 --- internal/cli/release_workflow_test.go | 46 --------------------------- 2 files changed, 51 deletions(-) delete mode 100644 internal/cli/release_workflow_test.go diff --git a/.gitignore b/.gitignore index 9d2022e..f85c053 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,3 @@ coverage.xml .claude/ .task/ -# BuildKit daemon configs that useblacksmith/setup-docker-builder writes into the -# job's working directory (the repo checkout) in the release workflow. Left -# untracked they make the tree dirty and GoReleaser refuses to release. -/buildkitd.toml -/docker-container-buildkitd.toml diff --git a/internal/cli/release_workflow_test.go b/internal/cli/release_workflow_test.go deleted file mode 100644 index 05ce97d..0000000 --- a/internal/cli/release_workflow_test.go +++ /dev/null @@ -1,46 +0,0 @@ -package cli - -import ( - "errors" - "os/exec" - "path/filepath" - "testing" -) - -// TestReleaseBuilderConfigsAreGitIgnored guards the release job against a dirty -// tree. useblacksmith/setup-docker-builder writes its BuildKit daemon config with -// a relative path, so it lands in the job's working directory — the repository -// checkout. GoReleaser validates that the tree is clean before releasing, and an -// untracked buildkitd.toml made `goreleaser release` fail with "git is in a dirty -// state". Ignored files do not count as dirty, so the configs must stay ignored. -// -// `git check-ignore --no-index` evaluates the ignore rules for a path without the -// file existing, so the test never touches the working tree. -func TestReleaseBuilderConfigsAreGitIgnored(t *testing.T) { - gitPath, err := exec.LookPath("git") - if err != nil { - t.Skip("git not available") - } - repoRoot, err := filepath.Abs(filepath.Join("..", "..")) - if err != nil { - t.Fatalf("resolve repo root: %v", err) - } - - for _, name := range []string{ - "buildkitd.toml", // setup_builder.ts: writeTomlConfig("buildkitd.toml", ...) - "docker-container-buildkitd.toml", // setup_builder.ts: the docker-container fallback builder - } { - cmd := exec.Command(gitPath, "check-ignore", "--quiet", "--no-index", name) - cmd.Dir = repoRoot - err := cmd.Run() - var exitErr *exec.ExitError - switch { - case err == nil: - // Exit 0: the path is ignored. - case errors.As(err, &exitErr) && exitErr.ExitCode() == 1: - t.Errorf("%s is not git-ignored: the release job's builder writes it into the checkout and GoReleaser then fails on a dirty tree", name) - default: - t.Fatalf("git check-ignore %s: %v", name, err) - } - } -}