Bug or configuration error? (PHP Version used) #13637
-
Hi, I'm investigating implementing renovate for Laminas framework (https://getlaminas.org/). The configuration I'm testing is here: laminas/.github#19. There is an issue when updating the lockfile and the problem is one mentioned in a previous discussion. The highest available PHP version is always used. For example a constraint of The checks run using each of those versions and since packages are installed that require PHP 8, our checks for PHP 7.4 fail and we would be unable to get any lock file updates. I would suggest that the lowest minor PHP version is used as PHP 7 code will for the vast majority of cases, work on PHP 8. However the reverse is not true. That's not a rule that applies to everyone though, so a configuration option here might be preferable, highest vs lowest language version. An example of this issue occurring can be found here: https://github.com/internalsystemerror/laminas-servicemanager/pull/4. One possible workaround that I've not tried is to manually specify the PHP version in the config section of each composer.json file. There are a lot of repositories and this would then have other implications so I would rather avoid this at all costs. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 16 replies
-
Add https://docs.renovatebot.com/configuration-options/#constraints |
Beta Was this translation helpful? Give feedback.
-
I'm not a regular PHP/Composer user, so I can't tell from your example immediately what's wrong. Do you mean that Renovate is implicitly "upgrading" the PHP version within that changed lockfile? e.g. it could be compared to going from npm@6 to npm@7 where the lock file format changed? And if so, is there some obvious field or other way in which Renovate could automatically detect the version of PHP in use for the existing lockfile, in order to reuse the same? |
Beta Was this translation helpful? Give feedback.
-
Looks like #13657 will improve this a lot |
Beta Was this translation helpful? Give feedback.
Add
constraints.php="~7.4"
to renovate config.https://docs.renovatebot.com/configuration-options/#constraints