Skip to content

ci: add Go-scoped Renovate configuration - #2850

Merged
Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
ci/scorecard-renovate-go
Jun 9, 2026
Merged

Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
ci/scorecard-renovate-go

Conversation

@myasnikovdaniil

@myasnikovdaniil myasnikovdaniil commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Raises the OpenSSF Scorecard Dependency-Update-Tool check (was 0/10) by adding a Renovate configuration at .github/renovate.json. Scorecard scores this check on the presence of a recognized config file, so the check turns green as soon as this merges.

Why Renovate (not Dependabot)

Renovate is already the cozystack org standard — it actively raises and merges PRs on cozystack/ansible-cozystack, and cozystack/talm + cozystack/boot-to-talos already ship renovate.json. The Renovate GitHub App is authorized on the org, so this config is picked up without creating a new credential. There is no Dependabot usage anywhere in the org.

If the app installation is scoped to "selected repositories", cozystack/cozystack needs to be toggled into the existing installation by an org admin — a one-click change, not a new auth artifact. The Scorecard check does not depend on that toggle.

Scoped to Go dependencies only (per the 2026-05-27 decision)

  • enabledManagers: ["gomod"] — Renovate only ever touches Go modules. It will not open PRs for Dockerfiles, Helm charts, shipped component/operator versions, or GitHub Actions. Components and images stay hand-managed.
  • gomodTidy + gomodUpdateImportPaths run after each bump. The gomod manager auto-discovers both the root module and the api/apps/v1alpha1 submodule.
  • Kubernetes libraries grouped (sigs.k8s.io/controller-runtime + k8s.io/**) so client-go/apimachinery never bump out of lockstep with controller-runtime (a split bump fails to compile).
  • Go toolchain directive pinned (matchDepTypes: ["golang"] disabled) — go.mod is generated and a toolchain bump needs a matching setup-go + codegen run, out of scope for an automated PR.

"do not merge" on every bot PR (requirement)

  • automerge and platformAutomerge are off.
  • Every Renovate PR is labeled do-not-merge/hold + automated on creation. Both labels already exist in .github/labels.yml; stale.yaml already exempts do-not-merge/hold PRs from auto-close, so held bumps won't rot.
  • Bumps therefore stay parked until tests pass and a maintainer removes the label after a hands-on check.

Note: do-not-merge/hold is a signal/marker (cozystack uses native GitHub, not Prow Tide). Combined with automerge being off, nothing can auto-merge a held PR. Hard merge-blocking would need a status check tied to the label, which would require branch-protection changes that were explicitly excluded.

Verification

  • renovate-config-validator (Renovate v42): Config validated successfully.
  • Valid JSON.

Release note

ci: add a Go-scoped Renovate configuration (gomod only, no automerge, bot PRs held with do-not-merge/hold) to automate Go dependency updates

Summary by CodeRabbit

  • Chores
    • Configured automated dependency management for Go modules, including synchronized updates for Kubernetes-related dependencies, rate limiting on concurrent updates, and manual approval requirements to ensure controlled rollouts.

Raise the OpenSSF Scorecard Dependency-Update-Tool check (was 0/10) by
adding a Renovate config. Renovate is already the cozystack org standard
(active on ansible-cozystack, talm, boot-to-talos), so the app is
authorized org-wide and this file is picked up without a new credential.

Scoped deliberately so automated bumps only ever touch Go dependencies:

- enabledManagers: [gomod] — Renovate ignores Dockerfiles, Helm charts,
  shipped component/operator versions, and GitHub Actions. Components and
  images stay hand-managed, per the 2026-05-27 decision.
- gomodTidy + gomodUpdateImportPaths run after each bump; the gomod manager
  auto-discovers both the root module and the api/apps/v1alpha1 submodule.
- controller-runtime and k8s.io/** are grouped so client-go and
  controller-runtime never bump out of lockstep.
- The Go toolchain directive is pinned (matchDepTypes golang disabled):
  go.mod is generated and a toolchain bump needs a matching setup-go and a
  codegen run, out of scope for an automated PR.
- automerge/platformAutomerge are off and every Renovate PR is labeled
  do-not-merge/hold + automated, so bumps are held until tests pass and a
  maintainer reviews them by hand.

Validated with renovate-config-validator (config validated successfully).

Signed-off-by: Myasnikov Daniil <[email protected]>
Assisted-By: Claude <[email protected]>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a scoped Renovate configuration to automate Go dependency updates while maintaining strict control over the process. By targeting only Go modules and enforcing manual review through labels and disabled auto-merge, the changes improve the project's OpenSSF Scorecard rating without introducing risk to the existing build and deployment workflows.

Highlights

  • Renovate Configuration: Added a new .github/renovate.json configuration file to enable automated dependency updates.
  • Go-Specific Scoping: Restricted Renovate to only manage Go modules (gomod) to ensure stability and alignment with project standards.
  • Safety and Automation: Disabled auto-merge and configured all bot-generated PRs to be labeled with 'do-not-merge/hold' and 'automated' to ensure manual verification before merging.
  • Dependency Grouping: Implemented package rules to group Kubernetes-related libraries, preventing compilation issues caused by mismatched versions.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@github-actions github-actions Bot added size/S This PR changes 10-29 lines, ignoring generated files area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review labels Jun 8, 2026
@coderabbitai

coderabbitai Bot commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 62eee3fb-fb24-4819-87f7-651997c34050

📥 Commits

Reviewing files that changed from the base of the PR and between 80fbfa1 and ac56d4c.

📒 Files selected for processing (1)
  • .github/renovate.json

📝 Walkthrough

Walkthrough

Renovate automation configuration added to the repository. The configuration restricts Renovate to Go module updates only, enforces post-update tidying and import-path normalization, applies hold and automation labels, disables automerge, caps concurrent update PRs at 5, groups Kubernetes-related dependencies together, and prevents automatic Go toolchain directive version bumps.

Changes

Dependency Automation

Layer / File(s) Summary
Go Module Update Configuration
.github/renovate.json
Renovate configuration enables Go module manager only, configures post-update tidying and import-path updates, applies automation and hold labels, disables automerge and platform automerge, limits concurrent PRs to 5, groups Kubernetes library upgrades (controller-runtime and k8s.io/**), and disables Go toolchain directive bumps.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A Renovate config, neat and small,
Go modules dance at Dependency's call!
Kubernetes friends in lockstep aligned,
No toolchain drifts left to find.
Five PRs at once—orderly, wise! 📦

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: add Go-scoped Renovate configuration' accurately and concisely summarizes the main change—adding a Renovate configuration file scoped to Go modules.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/scorecard-renovate-go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a Renovate configuration file (.github/renovate.json) to automate Go module dependency updates. The reviewer identified that because k8s.io/apimachinery is replaced by a custom fork in go.mod, automated updates to other Kubernetes libraries and controller-runtime will break compilation. To prevent broken pull requests, the reviewer suggested disabling automated updates for these packages entirely.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread .github/renovate.json
Comment on lines +14 to +19
{
"description": "Keep controller-runtime and the Kubernetes libraries in lockstep. A split bump breaks compilation because a given controller-runtime release expects a matching client-go / apimachinery line.",
"groupName": "kubernetes",
"matchManagers": ["gomod"],
"matchPackageNames": ["sigs.k8s.io/controller-runtime", "k8s.io/**"]
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Since k8s.io/apimachinery is replaced by a custom fork (github.com/cozystack/apimachinery) in go.mod, any automated update to other k8s.io/* packages (like k8s.io/client-go or k8s.io/api) or sigs.k8s.io/controller-runtime will lead to compilation failures. This is because all Kubernetes libraries must be kept in strict lockstep, and the custom fork cannot be automatically updated by Renovate. It is highly recommended to disable automated updates for these packages entirely to avoid broken PRs.

Suggested change
{
"description": "Keep controller-runtime and the Kubernetes libraries in lockstep. A split bump breaks compilation because a given controller-runtime release expects a matching client-go / apimachinery line.",
"groupName": "kubernetes",
"matchManagers": ["gomod"],
"matchPackageNames": ["sigs.k8s.io/controller-runtime", "k8s.io/**"]
},
{
"description": "Disable updates for Kubernetes libraries and controller-runtime because k8s.io/apimachinery is replaced by a custom fork and updating other k8s.io packages out of lockstep will break compilation.",
"matchManagers": ["gomod"],
"matchPackageNames": ["sigs.k8s.io/controller-runtime", "k8s.io/**"],
"enabled": false
},

@myasnikovdaniil myasnikovdaniil self-assigned this Jun 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — adds a valid, gomod-scoped Renovate config that turns the Scorecard Dependency-Update-Tool check green on merge; automerge is off and every bot PR is held, so nothing can land unreviewed.

Business context: raise the OpenSSF Scorecard Dependency-Update-Tool check (was 0/10) by shipping a recognized dependency-update config, scoped to Go modules per the team decision.

Verified: the config is valid JSON against the Renovate schema; enabledManagers: ["gomod"] limits Renovate to Go modules; automerge/platformAutomerge are both off and every PR is labeled do-not-merge/hold + automated, and stale.yaml already exempts do-not-merge/hold, so held bumps are parked rather than auto-merged or auto-closed.

Non-blocking follow-ups

  1. The kubernetes group (k8s.io/** + sigs.k8s.io/controller-runtime) will still produce non-compiling bump PRs: k8s.io/apimachinery is a replace onto the github.com/cozystack/apimachinery fork pinned at a pseudo-version that caps k8s.io/api at the v0.34.x line, and Renovate cannot move the fork in lockstep with the non-replaced k8s.io/* packages. The group keeps the non-replaced libraries in step with each other but not with the forked apimachinery, so each k8s.io/api minor bump yields a PR that fails to build. The held-PR design makes these noise rather than breakage, but disabling updates for these packages (or capping them to the fork's supported line) until the fork moves to release-1.35 would avoid the churn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review size/S This PR changes 10-29 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants