Problem/Motivation
Follow-up for #3331168: Limit trusted Composer plugins to a known list, allow user to add more. The core-mvp UX is:
Allow specifying additional allowed
composerplugins through configuration (with initially just a$config['package_manager.settings']…line)
But ideally:
- There is a UI
- That UI should warn the user about the risks and potential implications
- Whenever the user uses Package Manager (no matter whether it's installing new modules through https://www.drupal.org/project/project_browser or installing updates that require different composer plugins)
- Related: there should be a status report entry both warning the user that they've configured additional allowed
composerplugins and it should be considered an error if some of those additions are no longer present in the codebase
Steps to reproduce
Use additional composer plugins beyond:
drupal/core-vendor-hardeningdrupal/core-composer-scaffolddrupal/core-project-messagedealerdirect/phpcodesniffer-composer-installerphpstan/extension-installercweagans/composer-patches
(The first 3 are Drupal core's (of which the first comes with an associated excluder: VendorHardeningExcluder), the 4th and 5th are used for Drupal core development and don't interfere with php-tuf/composer-stager and the last one comes with explicit validation: ComposerPatchesValidator.)
Proposed resolution
TBD
Comments
Comment #2
wim leersComment #3
tedbowI am not convinced this should be UI.
Comment #4
wim leersI think you're saying that requiring manual modification to the configuration is sufficient?
If so: fair enough. I can see arguments either way. But what should still happen IMHO is improving the message: right now
ComposerPluginsValidatorjust tells the user a composer plugin is not supported:",
[
'@package_name' => $raw_allowed_plugin_name,
]
),
$unsupported_plugins
);
$summary = $this->formatPlural(
count($unsupported_plugins),
'An unsupported Composer plugin was detected.',
'Unsupported Composer plugins were detected.',
);
$event->addError($unsupported_plugins_messages, $summary);
→ this just generates a list, without providing the user a course of action.
Stupidly, I went 99% of the way in #3331168: Limit trusted Composer plugins to a known list, allow user to add more because I provided a
hook_help()entry:but failed to link to it from the validation message 🙈🙈🙈
Maybe that's the only remaining thing to do here? 😊
Comment #5
wim leersd.o rendering fail 🤷♀️
Comment #6
tedbowComment #7
wim leersNote that in #3340022: Tighten ComposerPluginsValidator: support only specified version constraint,
ComposerPluginsValidatoris becoming stricter. But this same UX can be used to trust unsupported versions of supported Composer plugins 👍Comment #8
ressaIt's great to see all the efforts going into getting Automatic Updates ready, so thanks for that.
If you have https://www.drupal.org/project/openai installed, you get this message on /admin/reports/updates/update:
Does this mean that Automatic Updates will not work, or might it work, but not guaranteed to work?
Should I create a separate issue for Automatic Update support for this Composer plugin?