Skip to content

ci: add required PR baseline and nightly determinism workflows (#66) - #80

Open
senolcolak wants to merge 4 commits into
feat/67-hermetic-test-foundationfrom
feat/66-ci-baseline
Open

ci: add required PR baseline and nightly determinism workflows (#66)#80
senolcolak wants to merge 4 commits into
feat/67-hermetic-test-foundationfrom
feat/66-ci-baseline

Conversation

@senolcolak

Copy link
Copy Markdown
Collaborator

Summary

Second PR of the testing-foundation series: the mandatory pull-request CI baseline, before the expensive system-test work in later issues.

Closes #66.

Stacked on #79 (#67). Base branch is feat/67-hermetic-test-foundation because this workflow calls the hermetic make targets introduced there (test-unit, test-envtest, test-unit-repeat). Merge #79 first, then this rebases onto main. The diff below is scoped to this PR's own changes.

What's added

.github/workflows/ci.yaml — required fast checks, all SHA-pinned, permissions: contents: read, concurrency-cancel on superseded runs, 15-minute per-job timeout:

  • generated files up to datemake gen && make helm && make imports must be a no-op (guards controller-gen CRDs/RBAC/deepcopy and the Helm chart templates they feed).
  • fmt / vet / lint / unit / build — gofmt, go vet, golangci-lint, unit tests (-race -shuffle=on), go build.
  • envtest integration — controller suite against the pinned Rook CRD (no network); uploads logs on failure.
  • helm lint + template — chart lints and renders.
  • govulncheck.

.github/workflows/nightly.yaml — the 20× determinism repeat, deferred off the required gate to keep fast CI under target.

contrib/k8s/3rdparty/rook.yaml — vendored, pinned Rook v1.18.6 CRD, verified byte-for-byte identical to the upstream tag. Un-ignored just this file in .gitignore; added an Apache-2.0 REUSE annotation (Rook's license). This makes the CRD/envtest jobs network-free.

docs/ci/required-checks.md — the checks branch protection must require, plus recommended main settings (supports #77).

Design notes

  • CI reads the Go version from go.mod and the K8s/envtest version from the Makefile, so it uses the versions the repo declares.
  • All Go tooling runs via go tool X (declared in go.mod), resolved and cached by actions/setup-go — no separate installs, no version drift.

Verification

  • Both workflow files parse as valid YAML.
  • make gen && make helm && make imports is a no-op on the committed tree (the generate job passes on a clean checkout).
  • helm lint and helm template both succeed; gofmt clean.
  • reuse lint passes 77/77 files including the vendored CRD.
  • Rook CRD sha256 matches upstream v1.18.6 (ae93e5d8…).

Review

Reviewed for Actions correctness/security: SHA-pinned, least-privilege, no pull_request_target, hermetic. One gap found and fixed — the generate job now also runs make helm so stale chart templates can't slip through green CI.

Add the mandatory pull-request CI baseline before the expensive system-test
work in later issues.

- .github/workflows/ci.yaml: fast required checks, all SHA-pinned, least
  privilege (contents: read), concurrency-cancel on superseded runs, and a
  15-minute per-job timeout:
    - generated files up to date (make gen + make imports must be a no-op)
    - fmt / vet / lint / unit (-race -shuffle=on) / build
    - envtest integration (against the pinned Rook CRD, no network)
    - helm lint + template
    - govulncheck
  Go version comes from go.mod, envtest/K8s version from the Makefile, so CI
  uses the versions the repository declares. All Go tooling runs via `go tool`.
- .github/workflows/nightly.yaml: the 20x determinism repeat, deferred off the
  required gate to keep fast CI under target.
- Vendor the pinned Rook CRD (contrib/k8s/3rdparty/rook.yaml, Rook v1.18.6,
  verified byte-for-byte against upstream) so CRD/envtest jobs need no network;
  un-ignore just that file and add its Apache-2.0 REUSE annotation.
- docs/ci/required-checks.md: the checks branch protection must require and the
  recommended main-branch settings (supports #77).

Builds on #67 (the hermetic make targets this workflow calls).

Signed-off-by: senol.colak <senol.colak@sap.com>
The helm job relied on the runner's preinstalled, unpinned Helm. Add
azure/setup-helm (SHA-pinned) with a pinned Helm version so the check is
reproducible.

Correct the 'no network / hermetic' claims in ci.yaml and required-checks.md:
the envtest job downloads kube-apiserver/etcd via setup-envtest from a
Google-hosted bucket on a cache miss, and govulncheck queries vuln.go.dev.
CI is reproducible (pinned versions), not fully network-free; say so. Also
note the REUSE check comes from reuse.yaml, not ci.yaml.

Signed-off-by: senol.colak <senol.colak@sap.com>
govulncheck flags four standard-library vulnerabilities fixed in
go1.26.6, all reachable from the controller and manager:

- GO-2026-6218 (net/url)
- GO-2026-6091 (html/template)
- GO-2026-6090 (crypto/tls)
- GO-2026-6089 (net/http)

CI resolves the toolchain via go-version-file: go.mod, so bumping the
go directive is sufficient to pull in the patched standard library.

Signed-off-by: senol.colak <senol.colak@sap.com>
govulncheck flags three reachable dependency vulnerabilities once the
go1.26.6 stdlib bump clears the standard-library ones:

- GO-2026-6061 google.golang.org/grpc  v1.80.0 -> v1.82.1
- GO-2026-5970 golang.org/x/text       v0.36.0 -> v0.39.0
- GO-2026-5026 golang.org/x/net        v0.53.0 -> v0.56.0

Local govulncheck ./... after the bump: 0 vulnerabilities in called code.

Signed-off-by: senol.colak <senol.colak@sap.com>
@jrse
jrse self-requested a review September 9, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants