Add compatibility with composer v2.4+#6503
Conversation
There was a problem hiding this comment.
Oh perfect timing, I was planning to work on #5720 / #6385 / #6385 (comment) later this week!
I suspect life is simpler if we just keep on the latest composer and don't worry about backwards compatibility for options... I assume most folks run dependabot within the context of our bundled dependabot-core image, so they'll be using whatever version of composer is bundled with that. If you think differently for some reason, please let me know.
For simplicity of working across timezones / PR rebases, does the following sound reasonable?
- Merge this
- Rebase the Dependabot PR to bump
composerto2.5.x - Add a commit remove the optional checks, such that
setAuditis always called. - Merge... so hopefully we'll be back up to
composerlatestby EOD 👍
There was a problem hiding this comment.
😍 for fixing this, as a non-PHP expert, I would have muddled for a while before realizing it needed another import...
- Use `eventDispatcher::setRunScripts` instead of deprecated `Installer::setRunScripts` - Use `Installer::setPlatformRequirementFilter` instead of deprecated `Installer::setIgnorePlatformRequirements` - Use `setAudit(false)` if Installer has that method
83376ae to
5b89b08
Compare
That sounds completely reasonable. 👍 |
When running the dependabot-script with `DEBUG_HELPERS=true` I saw this error: ``` PHP Deprecated: Installer::setIgnorePlatformRequirements is deprecated since Composer 2.2, use setPlatformRequirementFilter instead. in /opt/composer/v2/vendor/composer/composer/src/Composer/Installer.php on line 1289 ``` So this commit resolves the deprecations and also added a forward compatible change to [disable the audit](#6385 (comment)). Applied changes: - Use `eventDispatcher::setRunScripts` instead of [deprecated `Installer::setRunScripts`](https://github.com/composer/composer/blob/2.5.1/src/Composer/Installer.php#L1241) - Use `Installer::setPlatformRequirementFilter` instead of [deprecated `Installer::setIgnorePlatformRequirements`](https://github.com/composer/composer/blob/2.5.1/src/Composer/Installer.php#L1297) - Use `setAudit(false)` if Installer has that method Co-authored-by: Stefan Grootscholten <stefan.grootscholten@tripolis.com>
When running the dependabot-script with
DEBUG_HELPERS=trueI saw this error:In this PR I work around the deprecations (there was one more, which was not verbose) and also added a forward compatible change to disable the audit.
Applied changes:
eventDispatcher::setRunScriptsinstead of deprecatedInstaller::setRunScriptsInstaller::setPlatformRequirementFilterinstead of deprecatedInstaller::setIgnorePlatformRequirementssetAudit(false)if Installer has that method