Repository navigation
ci: add CI gates for codegen drift, Go build, and Go unit tests #2499
Copy link
Copy link
Open
Labels
area/ciIssues or PRs related to CI workflows, GitHub Actions, automationIssues or PRs related to CI workflows, GitHub Actions, automationarea/testingIssues or PRs related to testing (e2e, bats, unit tests)Issues or PRs related to testing (e2e, bats, unit tests)kind/featureCategorizes issue or PR as related to a new featureCategorizes issue or PR as related to a new featurepriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to completeImportant over the long term, but may not be staffed and/or may need multiple releases to completequality-of-lifeQoL improvementsQoL improvementstriage/acceptedIndicates an issue is ready to be actively worked onIndicates an issue is ready to be actively worked on
Description
Activity
- addedkind/featureCategorizes issue or PR as related to a new featureCategorizes issue or PR as related to a new featurequality-of-lifeQoL improvementsQoL improvementsarea/ciIssues or PRs related to CI workflows, GitHub Actions, automationIssues or PRs related to CI workflows, GitHub Actions, automationarea/testingIssues or PRs related to testing (e2e, bats, unit tests)Issues or PRs related to testing (e2e, bats, unit tests)triage/acceptedIndicates an issue is ready to be actively worked onIndicates an issue is ready to be actively worked onpriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to completeImportant over the long term, but may not be staffed and/or may need multiple releases to complete
on Apr 27, 2026 Correction — 2 of 3 gates already landed (2026-07-08)
The body is stale — the "one
go-checks.yml" never happened, but two of the three gates landed piecemeal:- Codegen drift ✅ —
.github/workflows/codegen-drift.yml(ci(api): add codegen drift check #2463) runsmake generateand fails on anygit status --porcelaindiff (path-filtered toapi/**,pkg/apis/**,Makefile,go.mod). Catches the feat(postgres)!: support all PostgreSQL configuration parameters #2466-class regression. - Go unit tests
⚠️ partial —pull-requests.yamlrunsmake unit-tests(go test ./pkg/registry/... ./pkg/config/... ./pkg/cmd/server/...) +make test-controllers(go test ./internal/...). Not full./...—./cmd/...and nested image modules are uncovered. - Go build ❌ — still no explicit fast
go build ./...per-module gate; onlycodeql.ymlautobuild covers it incidentally (slow, not a fast gate).
So the remaining work is just gate 3 (explicit
go build ./...across root +api/apps/v1alpha1/+ the image modules) and a decision on whether to widen gate 2 toward./....- Codegen drift ✅ —
lexfrei commented
on Oct 2, 2026 ContributorAuthorMore actionsCorrection: this comment was wrong, and there is no gap here.
make unit-testsrunsgo-module-tests, which walks everygo.modin the tree and runsgo test ./...in each, andpull-requests.yamlrunsmake unit-testson every PR. That coverspackages/apps/kubernetes/images/kubevirt-csi-driver, including its Linux-only test. I had looked only at the Dockerfile and the workflow file names and missed the Makefile target.
Metadata
Metadata
Assignees
Labels
area/ciIssues or PRs related to CI workflows, GitHub Actions, automationIssues or PRs related to CI workflows, GitHub Actions, automationarea/testingIssues or PRs related to testing (e2e, bats, unit tests)Issues or PRs related to testing (e2e, bats, unit tests)kind/featureCategorizes issue or PR as related to a new featureCategorizes issue or PR as related to a new featurepriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to completeImportant over the long term, but may not be staffed and/or may need multiple releases to completequality-of-lifeQoL improvementsQoL improvementstriage/acceptedIndicates an issue is ready to be actively worked onIndicates an issue is ready to be actively worked on
Problem
PR CI currently runs Helm/BATS unit tests, builds Docker images, and runs E2E tests, but does not validate three Go-related concerns. PR #2466 illustrated all three:
api/apps/v1alpha1/postgresql/types.go(replacing a typed sub-struct withmap[string]string) butmake generatewas not run. The orphanPostgreSQLParametersDeepCopyInto/DeepCopymethods left inzz_generated.deepcopy.gobroke the package with threeundefined: PostgreSQLParameterserrors. CI did not flag this — code review did.make build(inpull-requests.yamlBuild job) only builds Docker images andcmd/cozypkg. There is nogo build ./...for the root module or for the other modules in the repo (api/apps/v1alpha1/,packages/apps/kubernetes/images/kubevirt-csi-driver/,packages/system/dashboard/images/token-proxy/,packages/system/kubeovn-webhook/images/kubeovn-webhook/). A broken submodule only fails compilation when something else imports it.make unit-testsonly runshelm-unit-tests.shandbats-unit-tests. There is nogo test ./...for any module.The pre-commit config (
.pre-commit-config.yaml) does declare arun-make-generatehook, but the workflow (.github/workflows/pre-commit.yml) only feeds*.yamland*.mdfiles intopre-commit run --files, so the generate hook never executes in CI.Proposal
Add a new workflow (e.g.
go-checks.yml), triggered onpull_request, with three jobs:make generateproduces any change.go build ./...for the root module and each submodule listed above (or viago workif a workspace is appropriate).go test ./...for each module above.The job should run independently of the heavy E2E pipeline so contributors get fast feedback on code-level regressions that today only surface in review or once the cluster install fails.
Out of scope
pre-commitworkflow already lints YAML & Markdown).References
.github/workflows/{pull-requests.yaml,pre-commit.yml,retest.yaml}Makefile:121→hack/update-codegen.sh.pre-commit-config.yaml:1-157144d893)