-
Notifications
You must be signed in to change notification settings - Fork 246
fix(renovate): improve lockfile maintenance and tidy config #2546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,13 +5,6 @@ | |
| 'helpers:pinGitHubActionDigestsToSemver', | ||
| ':separateMultipleMajorReleases', | ||
| ], | ||
| gitIgnoredAuthors: [ | ||
| "107717825+opentelemetrybot@users.noreply.github.com", | ||
| "107717825+opentelemetrybot[bot]@users.noreply.github.com", | ||
| "197425009+otelbot@users.noreply.github.com", | ||
| "197425009+otelbot[bot]@users.noreply.github.com", | ||
| "github-actions[bot]@users.noreply.github.com" | ||
| ], | ||
| prHourlyLimit: 15, | ||
| prConcurrentLimit: 15, | ||
| ignorePaths: [ | ||
|
|
@@ -33,7 +26,7 @@ | |
| 'golang', | ||
| ], | ||
| postUpdateOptions: [ | ||
| 'gomodTidy', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the logs, https://developer.mend.io/github/open-telemetry/opentelemetry-lambda/-/job/01a00d17-448a-7bb4-94dc-309930aa60b6 it looks like part of the issue is when renovate runs goModTidy it is failing with an error. What i can't tell is why it fails when run by renovate but ok as a ci job. The only thing it could be is that the workflow is not checking exit Code. We could add the gomodTidyE option to renovate in addition to goModTidyAll and see if that decreases lines changed by the workflow.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure this is related, all those failures were for a completely different renovate PR. They're for the one that updates the collector-other deps. As stated above also, on the lockfile PRs we know for sure that
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually it is related as if we remove the ignored authors, pr's such as that will end up in the edited/errored state and blocked from adding additional updates. |
||
| 'gomodTidyAll', | ||
| ], | ||
| semanticCommitType: 'build', | ||
| schedule: [ | ||
|
|
@@ -53,7 +46,7 @@ | |
| 'golang', | ||
| ], | ||
| postUpdateOptions: [ | ||
| 'gomodTidy', | ||
| 'gomodTidyAll', | ||
| ], | ||
| semanticCommitType: 'build', | ||
| schedule: [ | ||
|
|
@@ -176,17 +169,16 @@ | |
| { | ||
| groupName: "Lock file maintenance golang", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest adding rebasewhen to reduce when the rebase occurs by setting it to
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
And then later on it pushes: The pushes we see come from the "content regeneration" path, which
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the cause is the ignoredAuthors, all that is doing is enabling the pr to avoid an edited/error state. It is more likely renovate updates a dependency to a version which is not imported & then go mod tidy removes it. Hence the fix might be to actually get renovate to do the go tidy as if it adds it then go tidys it away then there will be nothing changed & should avoid force push.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not saying it's the cause. I am saying it could be some sort of safeguard though. And looking at collector and collector-contrib made me wonder if that's the same reason they don't specify the ignored authors either.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They differ as they don't update indirect. The safeguard of removing the gitIgnoreAuthors is the same as auto adding the stop updating label. |
||
| matchDepTypes: ["indirect", "replace"], | ||
| matchUpdateTypes: ["minor", "patch"], | ||
| matchCategories: [ | ||
| 'golang', | ||
| ], | ||
| enabled: true, | ||
| separateMajorMinor: false, | ||
| separateMultipleMajor: false, | ||
|
Comment on lines
+172
to
-184
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not following
Is what you are thinking is that the presence of a major triggers gomodTidy to not be run? I would be inclined to leave but instead adjust when the rebase is done as well as adjust the postupdateoptions.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah exactly, I'll refer to renovate's actual code here again for reference just like I did in our Slack conversation: https://github.com/renovatebot/renovate/blob/34c7bcb7a50cafe7c8fd7f94fc679d0325bb3ccc/lib/modules/manager/gomod/artifacts.ts#L273-L278 As you can see later on in that same file, actually each variant of So "keep majors and adjust postupdateoptions" won't make any difference here. There is no possible way to make renovate run any of the That last part is especially important and it took me a while to understand myself, but in go new major versions are actually new module paths. So for example an offending module I observed in one of the logs was You can see the tidy skip happen in job https://developer.mend.io/github/open-telemetry/opentelemetry-lambda/-/job/733c6999-a1c0-47f6-8e53-ac6ba49c67ee where you will see lines like: and a similar one for another dep All this to simply say, we lose nothing by excluding majors from the indirect rule. As explained above, those indirect major "updates" can't ever land in a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for sharing the code, i think it points out the actual issue: Based on that code the likely cause of our issue is that
Based on the above code, if we set both
Not the case, If you take a look at https://github.com/open-telemetry/opentelemetry-lambda/pull/2495/changes#diff-84e81f625eb3580b5a4892a5b5ee1d4c441707ce0655c99621c1cbf3f1d80fb4L41 there is 3 examples of major updates being successful through renovate. |
||
| schedule: [ | ||
| 'before 8am on Wednesday', | ||
| ], | ||
| postUpdateOptions: [ | ||
| 'gomodTidy', | ||
| 'gomodTidyAll', | ||
| ], | ||
| } | ||
| ], | ||
|
|
@@ -199,7 +191,7 @@ | |
| ], | ||
| }, | ||
| postUpdateOptions: [ | ||
| 'gomodTidy', | ||
| 'gomodTidyAll', | ||
| ], | ||
| semanticCommits: 'enabled', | ||
| semanticCommitType: 'build', | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think removing this is not necessary as it stops the rebase frequency but does so by putting the pr in an edited state blocking updates and then it potentially error if more updates become available. See below for an alternative.
The issue is renovate is seeing that it is out of date as a transitive has changed hence it triggers a force push to update those transitive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't think those force pushes are driven by transitive changes. I verified this looking specifically into PR #2542 -> 200 force-pushes contain just 17 distinct trees. 182 consecutive pushes are identical, e.g.1f1ce2e2 and 342e6846 this can be checked via the gh api or using the cli:
gh api repos/open-telemetry/opentelemetry-lambda/git/commits/<commit hash> --jq .tree.sha.All 200 overwrote a tidy commit by otelbot through the gh workflow we have for that, with un-tidy content. The "edited state" after removal is intentional and I was even more confident in this change when I cross-referenced with the collector and contrib repos, and noticed it's exactly how they run the same tidy workflow (they don't set
gitIgnoredAuthors).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure some of them could be the same but some are transitive. If the concern is qty, then what about setting commitLimit to 1 on the lockfile, this way we maintain the ci running. With removing this we block renovate from updating the collector pr's etc.