From d2d46652a0530ad87785ccf38f8933e3fe8182b2 Mon Sep 17 00:00:00 2001 From: Alex Rodriguez <131964409+ezekiel-alexrod@users.noreply.github.com> Date: Thu, 19 Nov 2026 17:25:02 +0100 Subject: [PATCH 1/3] ci: check generated code with the shared go-generated workflow On a Renovate branch it also pushes the regenerated mocks, so a mockery bump no longer needs a human commit. Refs: MK8S-516 --- .github/workflows/pre-merge.yaml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pre-merge.yaml b/.github/workflows/pre-merge.yaml index 75c69cc..3debce3 100644 --- a/.github/workflows/pre-merge.yaml +++ b/.github/workflows/pre-merge.yaml @@ -16,19 +16,14 @@ jobs: is-latest: false is-stable: false - go-generate: - runs-on: ubuntu-26.04 - steps: - - name: Checkout - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - name: Set up Go - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 - with: - go-version-file: 'go.mod' - - name: Verify generated mocks are up to date - run: | - go generate ./... - git diff --exit-code + go-generated: + # On a Renovate branch, pushes the regenerated mocks itself. + uses: scality/workflows/.github/workflows/go-generated.yaml@1c3bb83b992d0a512c08755606ee6439b26c463b # main, no release yet + secrets: + ACTIONS_APP_PRIVATE_KEY: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }} + with: + push-to-renovate-branches: true + actions-app-id: ${{ vars.ACTIONS_APP_ID }} lint: runs-on: ubuntu-26.04 @@ -72,7 +67,7 @@ jobs: if: always() needs: - build - - go-generate + - go-generated - lint - test - test-e2e From bae945ddd2b5489fb8c848f39bccd28fa7e76fd6 Mon Sep 17 00:00:00 2001 From: Alex Rodriguez <131964409+ezekiel-alexrod@users.noreply.github.com> Date: Thu, 19 Nov 2026 18:02:47 +0100 Subject: [PATCH 2/3] docs: describe the go-generated check in CONTRIBUTING Refs: MK8S-516 --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e0a9e3..b2019fa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,7 +44,9 @@ owns its responsibility: errors.CausedBy(rawErr))` so `errors.Is` keeps matching the category. - **Tests**: Ginkgo + Gomega. Mocks for the `service` ports are generated by mockery (`go generate ./...`) and committed; never edit them by hand. CI - fails if the committed mocks are stale. + runs `go mod tidy` and `go generate ./...` and fails if the result differs + from what is committed. On `renovate/*` branches, it pushes the regenerated + code itself. - **Linting & formatting**: `golangci-lint run` must pass; format with `golangci-lint fmt`. From 76e9e971221f3a5b5f4983533e97924b3aac97e9 Mon Sep 17 00:00:00 2001 From: Alex Rodriguez <131964409+ezekiel-alexrod@users.noreply.github.com> Date: Fri, 20 Nov 2026 16:05:55 +0100 Subject: [PATCH 3/3] ci: pin go-generated on its v2.13.0 release Refs: MK8S-516 --- .github/workflows/pre-merge.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-merge.yaml b/.github/workflows/pre-merge.yaml index 3debce3..168c41e 100644 --- a/.github/workflows/pre-merge.yaml +++ b/.github/workflows/pre-merge.yaml @@ -18,7 +18,7 @@ jobs: go-generated: # On a Renovate branch, pushes the regenerated mocks itself. - uses: scality/workflows/.github/workflows/go-generated.yaml@1c3bb83b992d0a512c08755606ee6439b26c463b # main, no release yet + uses: scality/workflows/.github/workflows/go-generated.yaml@1c3bb83b992d0a512c08755606ee6439b26c463b # v2.13.0 secrets: ACTIONS_APP_PRIVATE_KEY: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }} with: