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.