0

I've set up renovatebot on GitLab to keep package versions in another repository up to date. But outside of the relevant lock file there are other files which also reference certain package versions. For example, in the readme:

If you don't want to install anything you can use
[mypy Playground](https://mypy-play.net/?flags=strict&mypy=1.3.0&python=3.8) to
verify your type annotations in a browser.

The mypy=1.3.0 part of that URL should be kept in sync with the mypy version in poetry.lock. Is this possible? Based on the documentation I've come up with this naive implementation, but I'm not sure how to test it or whether it'll work:

{
  "postUpgradeTasks": {
    "commands": ["sed -i -e \"s/mypy=.*&/mypy=/$(poetry show mypy | grep ' version .*' | cut --delimiter=: --fields=2 | cut --delimiter=' ' --fields=2)\" README.md"],
    "fileFilters": ["poetry.lock", "README.md"],
    "executionMode": "update"
  }
}
l0b0
  • 55,365
  • 30
  • 138
  • 223

1 Answers1

1

Rather postUpgradeTasks you probably want to use a regexManager.

If the depNames are identically or have the same groupName they also will be combined in a single PR/MR.

secustor
  • 3,001
  • 2
  • 14
  • 20
  • Thank you, that was the missing link! I've come up with [this change](https://gitlab.com/engmark/mypy-exercises/-/merge_requests/392), but I don't really know how to test it before merging. – l0b0 May 29 '23 at 04:03
  • Sadly there is no way to directly test on a branch, but you can create a separate repo to test this. – secustor May 29 '23 at 21:50
  • I'm afraid [you're right about testing](https://github.com/renovatebot/renovate/discussions/22477). :( Just gotta change the configuration and hope for the best (or spend hours setting things up to test a single change). – l0b0 May 30 '23 at 09:32