Skip to content

ci: add always-run repo-wide gofmt gate#6358

Draft
eamonnmoloney wants to merge 1 commit into
chore-gofmt-driftfrom
ci-gofmt-gate
Draft

ci: add always-run repo-wide gofmt gate#6358
eamonnmoloney wants to merge 1 commit into
chore-gofmt-driftfrom
ci-gofmt-gate

Conversation

@eamonnmoloney

Copy link
Copy Markdown
Contributor

Which problem does the PR fix?

Prevents the gofmt drift cleaned up in #6311 from silently returning. The existing make go.fmt runs only inside the unit-test workflow's per-chart-version matrix, so it checks just the chart(s) a PR touches — drift in untouched versions (8.3–8.x) and in the standalone scripts/ modules accumulated unnoticed.

What's in this PR?

A new always-run PR check (Repo - Go Format) that runs gofmt -l over every tracked Go file in one pass (gofmt is syntactic, so no per-module context is needed) and fails on any drift, listing the offending files. Not path-filtered, not version-scoped — it closes both blind spots.

Stacked on #6311 (the cleanup). Merge #6311 first; the gate is green once the tree is gofmt-clean. Verified locally: the gate flags all 48 drifted files on current main, and passes on the #6311-cleaned tree.

ci:-typed because it only adds a .github/ workflow (no chart files).

Checklist

Please make sure to follow our Contributing Guide.

Before opening the PR:

  • In the repo's root dir, run make go.update-golden-only.
  • There is no other open pull request for the same update/change.
  • Tests for charts are added (if needed).
  • In-repo documentation are updated (if needed).

After opening the PR:

  • Did you sign our CLA (Contributor License Agreement)? It will show once you open the PR.
  • Did all checks/tests pass in the PR?

Add a PR check that scans every tracked Go file with gofmt and fails on any
drift. Unlike the per-chart-version 'make go.fmt' step in the unit-test
workflow (matrix-scoped to the chart(s) a PR touches), this is not path-filtered
or version-scoped, so it also covers rarely-touched chart versions and the
standalone scripts/ modules — the blind spots where drift accumulated. gofmt is
syntactic, so a single pass over 'git ls-files "*.go"' covers all modules.

Stacked on the gofmt-cleanup (#6311); merge that first so the tree is clean and
this gate passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant