From d923459a78b843a196228e264831ff36ea459913 Mon Sep 17 00:00:00 2001 From: Alex Rodriguez <131964409+ezekiel-alexrod@users.noreply.github.com> Date: Thu, 26 Nov 2026 12:57:20 +0100 Subject: [PATCH] ci: push the regenerated code on Renovate branches with go-generated A controller-gen bump changes the CRDs, so its Renovate PR needed a human commit. The shared workflow regenerates in agent/ and pushes it. Refs: MK8S-516 --- .github/workflows/pre-merge.yaml | 15 +++++++++++++++ CONTRIBUTING.md | 5 ++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre-merge.yaml b/.github/workflows/pre-merge.yaml index d544e01..608feed 100644 --- a/.github/workflows/pre-merge.yaml +++ b/.github/workflows/pre-merge.yaml @@ -107,6 +107,20 @@ jobs: EL: ${{ matrix.el }} run: make -C rpm test EL="$EL" + go-generated: + # On a Renovate branch, pushes the regenerated code itself. + uses: scality/workflows/.github/workflows/go-generated.yaml@1c3bb83b992d0a512c08755606ee6439b26c463b # v2.13.0 + secrets: + ACTIONS_APP_PRIVATE_KEY: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }} + with: + working-directory: agent + commands: | + go mod tidy + go generate ./... + make manifests generate + push-to-renovate-branches: true + actions-app-id: ${{ vars.ACTIONS_APP_ID }} + pre-merge: name: Pre Merge # Single check for rulesets to require: GitHub reports one check per job, never one per workflow @@ -114,6 +128,7 @@ jobs: if: always() needs: - lint + - go-generated - test - image - e2e diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f98eadf..ed86654 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,7 +63,10 @@ make -C rpm rpm EL=9 # build both RPMs into rpm/_build/ - **Generated code is committed.** After touching the API types or the RBAC markers, run `make -C agent manifests generate` and commit the result. CI regenerates it before running the tests, and fails if the result differs - from what is committed. A controller-gen bump needs the same step. + from what is committed. A controller-gen bump needs the same step: on a + `renovate/*` branch, the `go-generated` job runs `go mod tidy`, + `go generate ./...` and `make manifests generate` in `agent/`, and pushes + the result itself. - **Logging**: `logr` through controller-runtime, with the `logcheck` linter enforcing balanced key-value pairs. Log a value once, at the level that owns it: the reconciler logs outcomes, the packages it calls return errors.