-
Notifications
You must be signed in to change notification settings - Fork 46
1.15.0 breaks CI pipelines #213
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
Comments
Same issue here. If I allow |
came here to report this very same problem. it seems adding a composer plugin is kind of a breaking change and should use a new major version. we depend on |
This comment was marked as outdated.
This comment was marked as outdated.
Same issue here. First impression is that is seems a bit "much" to install dependencies like that. Isn't the point of PSR libraries to offer dependency inversions for common use cases / components? |
This comment was marked as outdated.
This comment was marked as outdated.
Same issue here |
Adding conflict or locking are the worst solutions.
This can be done on the command line with |
My analysis: no BC break here. Breaking CI is what they are for: detecting something you might need to adapt to. This is especially true for CI that run |
Enforcing a manual change in composer.json is no problem for local dev environments, but you are asking people to update hundreds of projects due to a change in a minor version of an indirect dependency. That's breaking enough in my opinion. |
It's also a dependency that we don't personally have. Sentry includes this package so it's not as easy as just setting it to false ourselves. |
Here is the command-line to do it if needed: The rationale behind the current behavior of composer is described in composer/composer#10912 |
This is definitely a breaking change, as e.g. also create-projects can now fail - where one cannot change the allow-plugins before initial setup - at least not without using e.g. an issue for It would have been better to create a separate package for the plugin, that one can install or not. |
Backward compatibility is not about ensuring stability of installation commands. It's about the API of PHP code. Thanks for the hint for Sulu, here is the fix: sulu/skeleton#212 |
It might not count as a BC break in the sense that the APIs and so on remain unchanged. But this change is definitely highly disruptive, and achieves a feature, I don't really understand why you would want. As I understand the point of having the generic interfaces from PSR, is that we should be able to depend solely on the interface and not worry about concrete implementations. So forcing specific implementations seems counterproductive to me. Also for highly modular setups, it's not about just adjusting one composer.json, but going through a lot of individual packages, to allow or disallow something I didn't ask for in the first place. And I actually don't even want it. I actually just wanted a multipart stream builder, but now I have to deal with this due to php-http/multipart-stream-builder having a dependency on this package. Since Composer 2.2, my colleagues and I have actually made efforts to avoid packages that uses composer plugins. It shouldn't generally be necessary to hook into the package manager like that, and it is just unwanted overhead to have to consider if a script that you didn't ask for is allowed to run or not. (In most cases we get these plugins as a dependency of a dependency). |
@thomasnordahl-dk that another discussion. You might want to check https://github.com/FriendsOfPHP/well-known-implementations for some explanations about why this fills a hole in the ecosystem. But it's fine to disable the plugin if you want explicit manual control over your deps. The good news with the new approach is that you won't be forced to install fallback packages anymore, as many third party libs currently require since there is no other way to provide a nice out-of-the-box experience. |
One big takeaway here is that CI should not run interactive, make sure you have You can also set |
It might be disruptive but is indeed not a direct breaking change, because if your CI fails because of an added plugin, it was not implemented correctly in the first place because it means you are not running composer in non interactive mode in your CI pipeline Make sure you use the
@Seldaek beat me to it |
Using create-project with non-interactive still fails if the referenced project does not have the corresponding allow-plugin section. |
My 2cents... I manually ran composer update - said yes to this plugin - and now composer update never ever completes, it just keeps running and running, over and over and over again... surely that cannot be the expected feature? (on my Mac, interactively) |
Yes this is a bug in the plugin, being discussed in the PR |
Guess this becomes my problem not the packages. But in a CI that I can't edit top level composer.json and that is non interactive https://www.drupal.org/pift-ci-job/2589961 it stops. |
I have composer running with --no-interaction. What I should have mentioned is that it fails later on due to "php-http/discovery contains a Composer plugin which is blocked by your allow-plugins config." |
Awesome - thanks. So there are two conversations, 1 is the bug and 1 is for the non-interactive nature. |
I'm checking the bug now. @ekes check the last line of #213 (comment) |
The infinite loop will be fixed by #214 |
Releasing a new major version will not help in any way: as soon as a library requires discovery |
In a way I also think that the main issue is that composer does not seem to have an option where plugins that are not defined in the allowed-plugin list are assumed to be disallowed, which could be used in combination with no-interaction in e.g. CI/CD enviornments or other automation scripts. Sure, the user would not use the new plugin then but that was basically the same as prior to the dependency update. I created a corresponding composer issue - as the only one I found that fit the bill was closed already with some info text being added to the CLI output (composer/composer#11314). |
Would it expect too much to have this added to the docs somewhere?
|
one solution I found to avoid tihngs like this in the future is to run:
and if a new plugin is supposed to be allowed:
the disadvantage is that one is never notified about potentially new plugins. and that config is always active - independent of CI/CD. Though it could probably be set in CI/CD temporarily. In which case it would always be at the end, so
would be enough. Though I am not sure if the order of allow-plugins is always used as it is defined in the file. So in case of create-project it would be:
|
💯 this Here is a PR to improve composer in this regards: composer/composer#11315 This would close this issue. |
It would still fail if a new plugin is added that is optional but the maintainer did not use the corresponding flag. So the user has no option to just "ignore" this in the CI/CD. Hoewver, in most cases it should be enough, as plugin developers hopefully take care of this - and if not it would probably be a breaking change anyway. |
Thank you all for the discussion. As far as this package is concerned, I think we did everything we could. |
Thanks for improving Composer and taking some responsibility. I still think it would have been wiser to revert the breaking change in a 1.15.1 release and push the new plugin in a 2.0 version. While I agree that sooner or later people will have to deal with allowing/disallowing the plugin, the push could have been done more gracefully. Giving package maintainers (like Sentry) a choice and chance to stick to a specific version for now, bump a major as well later on (and communicate why) or replace the dependency. I don't want to nag too much about this because it is easily resolved (and already done and communicated within my company), but the 'the damage is done, deal with it' attitude is a bit too careless for my taste. Lot's of people and package maintainers were impacted by this. The comparison with a Composer change that required a manual change sounds fair, but people could easily compare this mistake with the left-pad NPM debacle as well. |
+1 for lots of disruption caused, especially as this is just a dependancy of another package - not something we're using directly ourselves. Consideration of the developer ecosystem needs to happen, not just brute forcing something through because it doesn't warrant a breaking chance according to standards. |
as per php-http/discovery#213 (comment) > The right solution is to disable the plugin, you likely don't need it anyway in your CI
I still see endless loops on |
Please open a dedicated issue with the details. |
PHP version: 8.1.15
Composer version: 2.5.2
Description
Composer asks if I want to trust "php-http/discovery" when 1.15.0 gets required. This breaks CI pipelines when php-http/discovery is an indirect dependency.
How to reproduce
composer require php-http/discovery
Possible Solution
Use a new major version (2.0.0) for breaking changes.
Additional context
$ composer require php-http/discovery
./composer.json has been created
Running composer update php-http/discovery
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
php-http/discovery contains a Composer plugin which is currently not in your allow-plugins config. See https://getcomposer.org/allow-plugins
Do you trust "php-http/discovery" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?]
The text was updated successfully, but these errors were encountered: