postUpgradeTasks with executionMode: "update" silently drops file changes when modifying the same file as the manager update
#42263
Unanswered
kdeldycke
asked this question in
Request Help
Replies: 2 comments
-
|
Same issue reproduced again on kdeldycke/repomatic#2537 . Here the checksum was not updated despite the proper |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
As a temporary measure, I had to create a dedicated workflow that triggers on |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How are you running Renovate?
Self-hosted Renovate CLI
Which platform you running Renovate on?
GitHub.com
Which version of Renovate are you using?
43.101.1
Please tell us more about your question or problem
Current behavior
When a
postUpgradeTaskscommand (withexecutionMode: "update") modifies the same file that the custom regex manager already changed, the post-upgrade modifications are silently dropped from the commit. The debug logs confirm the command runs successfully, Renovate detects the modified file, logs"Post-upgrade file saved"and"1 file(s) to commit", but the resulting commit only contains the manager's version change, not the post-upgrade modifications.Expected behavior
The commit should include both the manager's change (version bump) and the
postUpgradeTaskschange (checksum update) since they modify different lines of the same file.Setup
I maintain a Python tool registry in
repomatic/tool_runner.pywhere each tool entry has aversionfield and achecksumsdict with SHA-256 hashes for binary downloads:A custom regex manager in
renovate.json5detects version bumps in this file. ApostUpgradeTasksrule (withexecutionMode: "update"andmatchFileNames: ["repomatic/tool_runner.py"]) runs a CLI command that downloads the new binary and updates the checksum in-place:Full config:
renovate.json5lines 59-68 (postUpgradeTasksrule) and lines 162-175 (custom regex manager forbiome).Reproduction
This has been reproduced across three independent Renovate runs on PR #2435 (branch
renovate/biomejs-biome-2.x). The PR diff consistently shows only the version bump, never the checksum update.Run 1:
43.86.1: initial PR creation (biome2.4.5→2.4.7)Workflow run: 23431508867
The command executes successfully and computes the new checksum (line 6963):
Renovate detects the modified file and saves it (line 6978):
But the commit summary only shows 1 insertion / 0 deletions — just the version line, not the checksum replacement (line 6984):
Run 2:
43.101.1: branch rebase (biome2.4.5→2.4.8)Workflow run: 23763622841
Same behavior. Command succeeds with new checksum (line 7172):
File saved (line 7187), "1 file(s) to commit" (line 7200), but commit only has 1 insertion / 1 deletion (line 7202):
If both the version bump and checksum replacement were committed, the summary would show
insertions: 2, deletions: 2.Subsequent runs skip the task entirely
Once the branch exists with the version-only commit, subsequent runs log (example from run 23762428803):
This means the checksum can never be fixed by re-running Renovate: only the initial commit-creating run executes the task, and it drops the result.
Hypothesis
Renovate appears to build the commit content from its own stored copy of the file (with just the manager's version change) rather than from the working directory state after the
postUpgradeTaskscommand has run. When the post-upgrade task modifies the same file the manager already changed, the manager's stored version overwrites the post-upgrade version during commit creation.This may only affect
executionMode: "update"whenfileFilterstargets the same file as the manager'smatchFileNames.Note: I have other
postUpgradeTasksrules targeting workflow files (different files from the manager target), and those work correctly. The checksum updates do appear in the commit. The issue seems specific to the case where thepostUpgradeTaskmodifies the same file the regex manager updated.Platform
43.86.1and43.101.1(both affected)renovatebot/github-actionin GitHub Actionsbiomejs/biometo2.4.10kdeldycke/repomatic#2435All the workflow runs, config files, and PR are public. Happy to create a minimal reproduction repo if needed.
Beta Was this translation helpful? Give feedback.
All reactions