Skip to content

Conversation

mansikulkarni96
Copy link
Member

Add gomod manager and vendor directory handling to automatically update Go dependencies and their vendored files via Renovate PRs.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 16, 2025
Copy link
Contributor

openshift-ci bot commented Sep 16, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

Copy link
Contributor

openshift-ci bot commented Sep 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mansikulkarni96

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 16, 2025
renovate.json Outdated
"commitMessageTopic": "Go dependencies",
"matchManagers": ["gomod"],
"excludePackageNames": [
"k8s.io/kubernetes"
Copy link
Contributor

Choose a reason for hiding this comment

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

need to also exclude OpenShift ones, they are handled in the submodule update script

https://github.com/openshift/windows-machine-config-operator/blob/master/hack/update_submodules.sh#L37

renovate.json Outdated
Comment on lines 134 to 168
"enabled": false,
"enabled": true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this expand recursively to submodules?

Copy link
Member Author

Choose a reason for hiding this comment

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

no it doesnt do recursive updates, it scans .gitmodules file in the root repository

  1. Updates submodule commit hashes when newer commits are available in upstream repos
  2. Only handles direct submodules - not submodules within submodules

Copy link
Contributor

Choose a reason for hiding this comment

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

Neat! Do you think it can replace the manual hack/submodule update flow?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes it can but the issue we are going to run into is with the version bumps that need to go into the Makefile.

Copy link
Contributor

Choose a reason for hiding this comment

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

I follow

Copy link
Contributor

Choose a reason for hiding this comment

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

fairly certain this was removed because it doesn't work in the way we want.
ignorePaths couldnt be used on specific submodules.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was remembering incorrectly
4b93f24

I'd like to see the documentation for this change.
Also this is not related to Enable Go dependency updates in Renovate config

renovate.json Outdated
"allowedPostUpgradeCommands": [
"^rpm-lockfile-prototype rpms.in.yaml$",
"^go mod vendor$",
"^go mod tidy$"
Copy link
Contributor

Choose a reason for hiding this comment

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

consider adding go mod verify

@mansikulkarni96 mansikulkarni96 changed the title Enable Go dependency updates in Renovate config [WIP] Enable Go dependency updates in Renovate config Sep 16, 2025
@mansikulkarni96 mansikulkarni96 force-pushed the master branch 2 times, most recently from de64e3b to 65d7c49 Compare September 16, 2025 19:19
@mansikulkarni96 mansikulkarni96 changed the title [WIP] Enable Go dependency updates in Renovate config Enable Go dependency updates in Renovate config Sep 16, 2025
@mansikulkarni96 mansikulkarni96 force-pushed the master branch 2 times, most recently from 6b87563 to 62aec6d Compare October 2, 2025 20:08
@mansikulkarni96 mansikulkarni96 marked this pull request as ready for review October 6, 2025 15:32
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 6, 2025
@openshift-ci openshift-ci bot requested review from jrvaldes and sebsoto October 6, 2025 15:33
@jrvaldes
Copy link
Contributor

jrvaldes commented Oct 6, 2025

LGTM, will defer the final stamp to @sebsoto

renovate.json Outdated
"allowedCommands": [
"^rpm-lockfile-prototype rpms.in.yaml$"
],
"allowedPostUpgradeCommands": [
Copy link
Contributor

Choose a reason for hiding this comment

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

https://docs.renovatebot.com/self-hosted-configuration/#allowedcommands

looks like this should be merged into allowedCommands

renovate.json Outdated
{
"groupName": "Go dependencies",
"commitMessageAction": "",
"commitMessageTopic": "Go dependencies",
Copy link
Contributor

Choose a reason for hiding this comment

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

https://docs.renovatebot.com/configuration-options/#commitmessagetopic

Looks like this might be for the individual dependency. Lets start with the default recommended value

renovate.json Outdated
"packageRules": [
{
"groupName": "Go dependencies",
"commitMessageAction": "",
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this overriding?

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like default is update. Don't think we need to change it.
https://docs.renovatebot.com/configuration-options/#commitmessagetopic

Add gomod manager and vendor directory handling to automatically
update Go dependencies and their vendored files via Renovate PRs.
@sebsoto
Copy link
Contributor

sebsoto commented Oct 7, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 7, 2025
Copy link
Contributor

openshift-ci bot commented Oct 7, 2025

@mansikulkarni96: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit d1f7438 into openshift:master Oct 7, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants