ci(renovate): auto-bump go-github in examples and readme - #283
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make Renovate bump the go-github version everywhere, not just the top-level
go.mod.postUpdateOptions: ["gomodUpdateImportPaths"]-> on a major bump, Renovate rewrites the Go import paths (.../v89/github->.../v90/github) in every module: theexamples/*modules, the hand-writtengithubevents/dispatch_test.go, and the generated files.customManagersregex that keeps the README's import snippet in sync, tracked against go-github's github tags.Why
Right now a go-github major bump only edits
go.mod. The import paths inexamples/*/*.goand the README code block still point at the old major, so they get bumped by hand every time.gomodUpdateImportPathsis the built-in Renovate feature for exactly this (it runs themodtool per module), so all the.gofiles move automatically. The README isn't a Go file, so it needs the small regex manager.Note on the examples: they depend on a published
githubevents/v2(no localreplace), so they can only move to a new go-github major once a githubevents release using that major exists. After that release, Renovate bumps the githubevents dep and go-github together, and this config rewrites the import paths for you.Testing
The README manager validates against the schema. Since go's semantic-import-versioning (major-in-path) is a bit awkward for a non-code file, i'd confirm it on the next Renovate dry-run / first real bump, it's doc-only so nothing breaks if it needs a tweak.
Checklist