-
Notifications
You must be signed in to change notification settings - Fork 941
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
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.
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" |
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.
All the above are what webflo/drupal-core-require-dev already does.. Please don't do this.
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.
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 |
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.
Please revert. It's correct as it is. There is no 8.0 of this project.. There's only 8.x.
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.
8.0
doesn't exist really, it's the implicit SemVer branch alias which points to 8.x-dev
.
de9a234
to
04b4dea
Compare
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. |
c9ed2c4
to
f829c55
Compare
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. |
f829c55
to
8a7e11c
Compare
…tead to set "minimum-stability"
8a7e11c
to
531a028
Compare
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! |
composer.json
in order to whitelist development versions instead to set "minimum-stability"composer.json
in order to allow development versions instead to set "minimum-stability"
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
requirespackage-A:^2.0
, which has a stable release;composer update
package-A
is resolved to their last available 2 major (stable) version, let's say2.7.4
;package-A
requirespackage-B:^1.0
, which has a stable release;package-B
is resolved to their last available 1 major (stable) version, let's say1.0.0
;Until here, everything should be fine, since
my-project
knows that all the installed packages are stable. Let's see the following:2.7.5
thepackage-A
decides to change their requirement frompackage-B:^1.0
topackage-B:2.0-dev
, which is not a stable release;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 frompackage-A
, they will be restricted to install the unstable version from packagepackage-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 frompackage-A
.