Skip to content
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

Update composer.json in order to allow development versions instead to set "minimum-stability" #504

Closed
wants to merge 1 commit into from

Conversation

phansys
Copy link

@phansys phansys commented Jul 26, 2019

Update composer.json in order to whitelist (with stability flags) development versions instead to set "minimum-stability".

The problem with the current setup (using "dev" as "minimum-stability"):

  • my-project requires package-A:^2.0, which has a stable release;
  • users perform composer update
  • package-A is resolved to their last available 2 major (stable) version, let's say 2.7.4;
  • package-A requires package-B:^1.0, which has a stable release;
  • package-B is resolved to their last available 1 major (stable) version, let's say 1.0.0;

Until here, everything should be fine, since my-project knows that all the installed packages are stable. Let's see the following:

  • in the PATCH version 2.7.5 the package-A decides to change their requirement from package-B:^1.0 to package-B:2.0-dev, which is not a stable release;
  • users perform composer update
  • package-A is resolved to their last available 2 major (stable) version (2.7.5);
  • package-B is resolved to their last available 2 major (unstable) version (2.0-dev);

At this point, the users which own the responsibility under my-project were installed silently an unstable version of a package which can potentially break some existing feature or behavior in their project.
With the proposed changes, if the users want to use the 2.7.5 version from package-A, they will be restricted to install the unstable version from package package-B, at least if they decide under their own risk and responsibility to trust on that package, whitelisting it until a stable release will be available from what is required from package-A.

Copy link
Collaborator

@jcnventura jcnventura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing a lot of unrelated changes everywhere, including some that introduce errors, please do the simple one/two line change you really want please.

And please explain what is the problem with the current setup.

"behat/mink-selenium2-driver": "^1.3@dev",
"friendsofphp/php-cs-fixer": "^2.15",
"phpunit/phpunit": "^6.5",
"webflo/drupal-core-require-dev": "^8.7"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the above are what webflo/drupal-core-require-dev already does.. Please don't do this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whitelist is required in order to avoid unintended burden of the stability with dangerous dev dependencies, so a more narrow decision is to allow explicitly the non stable packages using stability flags.

for your setup.

After that you can create the project:

```
composer create-project drupal-composer/drupal-project:8.x-dev some-dir --no-interaction
composer create-project drupal-composer/drupal-project:^8.0@dev some-dir --no-interaction
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert. It's correct as it is. There is no 8.0 of this project.. There's only 8.x.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8.0 doesn't exist really, it's the implicit SemVer branch alias which points to 8.x-dev.

README.md Outdated Show resolved Hide resolved
@phansys
Copy link
Author

phansys commented Aug 15, 2019

For those who felt confused about the motivation for these changes, I've added a more detailed example trying to explain how composer works and what my concerns are.

Thank you in advance for your feedback.

@phansys phansys force-pushed the dependencies_stability branch 2 times, most recently from c9ed2c4 to f829c55 Compare August 25, 2019 23:54
@phansys
Copy link
Author

phansys commented Sep 6, 2019

IMHO, #512 is a good example of what happen when a package trust on an unstable dependency, and it gets even worse when that dependency is allowed blindly, like in this case.

@AlexSkrypnyk
Copy link
Collaborator

This pull request/issue has been inactive for over a year and is being closed due to inactivity. If the issue still persists or the contribution is still relevant, please feel free to reopen it or create a new one.

Thank you for your understanding and your contributions to the project!

@leymannx leymannx changed the title Update composer.json in order to whitelist development versions instead to set "minimum-stability" Update composer.json in order to allow development versions instead to set "minimum-stability" May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants