Skip to content

ci: check generated code with the shared go-generated workflow (MK8S-516) - #92

Open
ezekiel-alexrod wants to merge 3 commits into
mainfrom
improvement/MK8S-516-go-generated
Open

ezekiel-alexrod wants to merge 3 commits into
mainfrom
improvement/MK8S-516-go-generated

Conversation

@ezekiel-alexrod

@ezekiel-alexrod ezekiel-alexrod commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

The go-generate job is replaced by the shared go-generated workflow of scality/workflows. On a Renovate branch, it also pushes the regenerated mocks itself.

Problem

When Renovate bumps mockery, the mocks change, so the go-generate check fails until someone runs go generate ./... and pushes on the Renovate branch. scality/raidmgmt#121 is the current example: mockery 3.9.1 renames args to args1 in a mock, and the PR stays red. The shared workflow (scality/workflows#115, scality/workflows#117) runs the generators without a write token, then pushes the result with a GitHub App token in a separate job.

Review guide

.github/workflows/pre-merge.yaml only, plus a line in CONTRIBUTING.md. The workflow is pinned by SHA on its v2.13.0 release, so Renovate updates it like our other pinned actions.

What changes

  • go-generate becomes go-generated, which runs go mod tidy then go generate ./... and fails on a diff, as before.
  • On a renovate/* branch of this repo, it pushes the regenerated code as the App.

Testing

Check Result
go mod tidy and go generate ./... on main no diff
push mode: #93, a throwaway PR from renovate/test-go-generated with a stale mock the first run fails on the stale mock and the App (eve-ci-cd[bot]) pushes 754cf6e, which restores it; the run on that commit passes, with no second push

Out of scope

  • Adding the App email to gitIgnoredAuthors in platform-renovate, so Renovate keeps updating a branch after the App commit (MK8S-516).
  • The other repos.

Refs: MK8S-516

On a Renovate branch it also pushes the regenerated mocks, so a mockery
bump no longer needs a human commit.

Refs: MK8S-516
Comment thread .github/workflows/pre-merge.yaml Resolved
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