-
Notifications
You must be signed in to change notification settings - Fork 914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add compatibility with composer v2.4+ #6503
Add compatibility with composer v2.4+ #6503
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
composer
to2.5.x
- Add a commit remove the optional checks, such that
setAudit
is always called. - Merge... so hopefully we'll be back up to
composer
latest
by EOD 👍
// For all potential options, see UpdateCommand in composer | ||
$install | ||
->setUpdate(true) | ||
->setInstall(false) | ||
->setDevMode(true) | ||
->setUpdateAllowTransitiveDependencies(Request::UPDATE_LISTED_WITH_TRANSITIVE_DEPS) | ||
->setDumpAutoloader(false) | ||
->setRunScripts(false) | ||
->setIgnorePlatformRequirements(false); | ||
->setPlatformRequirementFilter(PlatformRequirementFilterFactory::fromBoolOrList(false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍 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=true
I 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::setRunScripts
instead of deprecatedInstaller::setRunScripts
Installer::setPlatformRequirementFilter
instead of deprecatedInstaller::setIgnorePlatformRequirements
setAudit(false)
if Installer has that method