Skip to content

fix(renovate): improve lockfile maintenance and tidy config - #2546

Open
wpessers wants to merge 3 commits into
open-telemetry:mainfrom
wpessers:fix/renovate-tidy-loop
Open

fix(renovate): improve lockfile maintenance and tidy config#2546
wpessers wants to merge 3 commits into
open-telemetry:mainfrom
wpessers:fix/renovate-tidy-loop

Conversation

@wpessers

Copy link
Copy Markdown
Member

Context
We've been having issues on the lockfile maintenance PRs where the current renovate config causes an infinete loop. This causes a high amount of spam notifications for maintainers, and more importantly consumes a huge amount of unnecessary gh actions minutes.

Solution

  • Removed gitignoredAuthors: renovate will now stop pushing after the custom tidy workflow has ran and the commit attributed to otelbot user has been pushed. This is the actual fix, the ignored authors config is what caused renovate to keep force pushing before.
  • Replaced gomodTidy by gomodTidyAll in the post update options config. This is a recent new feature in renovate, see: https://docs.renovatebot.com/golang/#monorepo-tidying-for-local-replace-directives and feat(gomod): add gomodTidyAll option for indirect dependency updates in Go monorepos renovatebot/renovate#37138
    The gomodTidy used to tidy only the specific module that received an update and leave all the others where it's used with replace directives stale. e.g.:
    replace github.com/open-telemetry/opentelemetry-lambda/collector/lambdacomponents => ./lambdacomponents
    replace github.com/open-telemetry/opentelemetry-lambda/collector/lambdalifecycle => ./lambdalifecycle
    replace github.com/open-telemetry/opentelemetry-lambda/collector/processor/coldstartprocessor => ./processor/coldstartprocessor
    replace github.com/open-telemetry/opentelemetry-lambda/collector/processor/decoupleprocessor => ./processor/decoupleprocessor
    replace github.com/open-telemetry/opentelemetry-lambda/collector/receiver/telemetryapireceiver => ./receiver/telemetryapireceiver

    I'm thinking this might fix the issue alltogether since we wouldn't even need the github action to run, the go.mod files would all already be clean.
  • Only update minor and patch versions in the lockfile maintenance, "updating" majors of indirect deps is a no-op but it has the side-effect of gomodTidy not being run because renovate thinks the branch contains an update major version.

@wpessers
wpessers requested a review from a team as a code owner August 20, 2026 21:08
@wpessers
wpessers requested a review from thompson-tomo August 20, 2026 21:08
@github-actions github-actions Bot added the ci label Aug 20, 2026

@tylerbenson tylerbenson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, but lets get @thompson-tomo to take a look.

Comment thread .github/renovate.json5
Comment on lines -8 to -14
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"
],

@thompson-tomo thompson-tomo Aug 23, 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.

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.

Comment thread .github/renovate.json5
@@ -176,17 +169,16 @@
{
groupName: "Lock file maintenance golang",

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.

I would suggest adding rebasewhen to reduce when the rebase occurs by setting it to behind-base-branch

Comment thread .github/renovate.json5
Comment on lines +172 to -184
matchUpdateTypes: ["minor", "patch"],
matchCategories: [
'golang',
],
enabled: true,
separateMajorMinor: false,
separateMultipleMajor: false,

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.

I am not following

Only update minor and patch versions in the lockfile maintenance, "updating" majors of indirect deps is a no-op but it has the side-effect of gomodTidy not being run because renovate thinks the branch contains an update major version.

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.

Comment thread .github/renovate.json5
'golang',
],
postUpdateOptions: [
'gomodTidy',

@thompson-tomo thompson-tomo Aug 23, 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.

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.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants