ci: switch from dependabot to renovate - #1075
Conversation
|
Thanks @nielspardon. Can we include a description in the PR body for why we should switch from dependabot to renovate? I think it has something to do with how dependabot interacts with pixi but it would be great to have it in writing somewhere so we can reference it in the future if something comes up. Thank you! |
|
updated the description. let me know if the description looks good for you. |
| @@ -16,8 +16,11 @@ jobs: | |||
| echo 'module.exports = { | |||
| // Workaround for https://github.com/dependabot/dependabot-core/issues/5923 | |||
There was a problem hiding this comment.
Is this comment still relevant if we no longer use dependabot?
There was a problem hiding this comment.
Is there a way to validate that this works before merging?
There was a problem hiding this comment.
I've been testing this on my private fork and I found that the current pixi support for Renovate is only covering the direct Pixi dependencies in [tool.pixi.dependencies] e.g. NodeJS which when it does update the version also updates the pixi.lock file: https://github.com/nielspardon/substrait/pull/5/changes
When it updates one of the dependencies in the dev dependency group in [dependency-groups] it does not update those using the Pixi manager and Renovate thus also not updating the pixi.lock file currently: https://github.com/nielspardon/substrait/pull/7/changes
There was a problem hiding this comment.
I logged a feature request with Renovate to help us fix this gap: renovatebot/renovate#43260
There was a problem hiding this comment.
FYI: Renovate also supports postUpgradeTasks if you are hosting it yourself. When using the hosted one with the Github App it does not allow custom commands for security reasons.
There was a problem hiding this comment.
Thanks for investigating. Hopefully we can figure out something that will work for our setup.
There was a problem hiding this comment.
do we need dependency groups? in our case, what's the difference between dependencies and a dev dependency group? isn't the whole thing a single dev environment anyway?
There was a problem hiding this comment.
maybe we should discuss this in a separate issue. feels unrelated to switching from dependabot to renovate.
There was a problem hiding this comment.
yeah, just a possible shortcut 😆 doesn't really matter though if the issue is being addressed in renovate anyway
There was a problem hiding this comment.
The issue with Renovate is not caused by the dependencies being in a dependency group. We would have the same issue if they were regular Python dependencies in [project.dependencies] in pyproject.toml. The issue is that the pixi support in Renovate today would only update the pixi.lock file when suggesting a dependency update in pixi.toml or in [tool.pixi.dependencies] in pyproject.toml. This is better than dependabot which has no pixi support at all but wouldn't help since we are using pyproject.toml in this repo and no pixi.toml.
The PR I opened in Renovate which got one approval already makes sure the pixi.lock file gets updated when Python dependencies in pyproject.toml (outside of [tool.pixi.dependencies]) get bumped including dependency groups.
Whether we should declare the dependencies as project dependencies or in a dev dependency group is orthogonal in my opinion.
There was a problem hiding this comment.
Also, when the Renovate "configure Renovate" / onboarding PR is raised, y'all will see what's pending from it - you can even put these config changes into that branch (requires write access to repo) and it'll update the PR description to show changes it'll make :)
b0b0843 to
64ceb39
Compare
Signed-off-by: Niels Pardon <par@zurich.ibm.com>
64ceb39 to
c2903e6
Compare
|
I ran this end to end on my fork so we can see the behaviour before deciding. The setup there is identical to what this PR proposes, only the GitHub App is mine rather than a The result we were after: nielspardon#28 bumps From the run log, the part that the hosted App cannot do: Dependency Dashboard: nielspardon#27 lists everything Renovate detected, including the rate-limited updates queued behind the default limit of two PRs per hour, and gives us checkboxes to pull any of them forward. Dependabot has no equivalent. A few things the fork run surfaced that are worth knowing before review:
@benbellick to answer your earlier question about the commitlint comment: the dependabot ignore patterns still need to stay, because #1061, #1092, #1125, #1126 and #1135 were opened by dependabot and would start failing the PR Title Check without them. I have scoped the One correction to my earlier comments on this PR: I said the gap was that Renovate only updated |
When I get an internal PR review, we'll be setting |
That's great to hear. Thanks. |
We are currently using dependabot which has a very limited feature set, for example it can not handle managing a
pixi.lockfile as demonstrated in https://github.com/substrait-io/substrait/actions/runs/25411815587/job/74535026421?pr=1072Renovate is also free to use and a much more powerful dependency auto update tool compared to dependabot. It can handle
pixi.lockfiles among other things like e.g. it could also be used to update Git submodules to tags instead of just the latest commit (https://docs.renovatebot.com/modules/manager/git-submodules/#updating-to-specific-tag-values).It gives more flexibility and helps to address the issue with dependabot not handling the
pixi.lockfile properly.Why this runs on our own GitHub Actions workers
Renovate only learned to refresh
pixi.lockafter bumping dependencies declared inpyproject.tomlin renovatebot/renovate#44004, released in Renovate 44.0.0. Becausepixi lockcan execute arbitrary code from conda package hooks, that same change gated the behaviour behind the globalallowedUnsafeExecutionsoption. That option isglobalOnly, so it can never be set from a repository'srenovate.json, and it is not allow-listed on the hosted Renovate App's workers.The gate applies to the
piximanager too, as an explicit breaking change. So from Renovate 44.0.0 on, the hosted App would not refreshpixi.lockfor any dependency update. Running Renovate ourselves is the only way to get dependency PRs whose lock file actually matches the manifest, which is the entire problem we set out to fix.Changes
renovate.jsonconfig file configuring semantic commits as the commit style for Renovate and the commit type asbuildand scope asdepsto match the dependabot style following: https://docs.renovatebot.com/configuration-options/#semanticcommitscope:semanticCommitTypeAll(build)is needed for thebuildtype to actually take effect.config:recommendedpulls in:semanticPrefixFixDepsChoreOthers, which contributes amatchPackageNames: ["*"]rule setting the type tochore, and package rules override top-level config.pyproject.tomldependency bumps into one PR. The Python dev dependencies and the conda dependencies all share a singlepixi.lock, so ungrouped PRs would each rewrite that file and conflict with one another as soon as the first one merges. Major bumps still get their own PR.python. Renovate treats bothrequires-pythonand the[tool.pixi.dependencies]pin as dependencies, but changing the supported Python version is a project decision rather than a routine bump. Leaving it enabled also puts apep440: failed to calculate newValuewarning on the Dependency Dashboard, because the range>=3.13,<3.14cannot be rewritten against a Python pre-release.pre-commitmanager, which is off by default. Our.pre-commit-config.yamlhas drifted well behindpyproject.toml(for exampleruffv0.8.4there against>=0.15.22here) and dependabot cannot see that file at all..github/workflows/renovate.ymlworkflow running self-hosted Renovate every three hours, plus a manual trigger with dry-run and log-level inputs for debugging. It authenticates as a GitHub App the same wayrelease.ymlalready does, and grantsallowedUnsafeExecutions: pixisopixi.lockis kept in sync. The pinned Renovate version carries a# renovate:comment so Renovate keeps its own version up to date via thecustomManagers:githubActionsVersionspreset.dependabot.ymlconfiguration file to disable dependabot.Needed before this can be merged
A
substrait-io-owned GitHub App has to be created and installed on this repository, withContents,Issues,Pull requests,ChecksandCommit statusesset to read and write,Workflowsset to read and write, andAdministration,Dependabot alerts,MembersandMetadataset to read. TheWorkflowspermission is required for Renovate to be able to open PRs that touch.github/workflows, which is what dependabot does for us today. Its client ID and private key then go into theRENOVATE_APP_CLIENT_IDandRENOVATE_APP_PRIVATE_KEYrepository secrets.The self-hosted workflow is removable later
A Renovate maintainer has confirmed that Mend will add
pixitoallowedUnsafeExecutionson the hosted Renovate App once an internal review lands, at which point self-hosting is no longer required forpixi.lockto be refreshed.renovate.jsonis identical either way, so migrating later means deleting.github/workflows/renovate.ymland the twoRENOVATE_APP_*secrets and installing the App, with no config change. Self-hosting in the meantime is what makes the lock file correct today.The companion PRs for the other two pixi repositories are therefore config-only, relying on the hosted App: substrait-io/substrait-python#244 and substrait-io/substrait-packaging#52.
What changes about the PRs we receive
Renovate covers ground that our dependabot configuration never did, so expect a batch of new PRs on the first run:
[tool.pixi.dependencies], which dependabot'spipecosystem never looked at. They are all within their declared ranges right now, so they only show up via lock file maintenance until one of them moves out of range.go.mod, which had no dependabot ecosystem entry at all. Note that we have no Go job in CI, so those PRs arrive without coverage. Add"gomod": { "enabled": false }if we would rather not receive them.pre-commithooks described above. Renovate attaches a note to those PRs saying thepre-commitmanager is not supported by the pre-commit maintainers.Dependencies declared as ranges only get a PR once the new version falls outside the range, so a quiet dependency like
ruff>=0.15.22,<1is expected rather than a sign that something is broken.lockFileMaintenancecovers the rest by refreshing the transitive pins inpixi.lockweekly.This change is