-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Normalizing of version constraints not suitable for all use-cases - can it be made disable/confgurable in some way ? #1287
Comments
The introduced scheduled job dispatcher failes due to insufficient permissions. To mitigate, a proper permission request needs to be added. This change modifes the `scheduled.yml` GitHub action workflow to request required permissions. Note: composer normalizer is disabled temporarly due to a unwanted behaviour. Todo comment for disabled workflow action is added. [1] [1] ergebnis/composer-normalize#1287 Resolves: #2 Releases: main
The introduced scheduled job dispatcher failes due to insufficient permissions. To mitigate, a proper permission request needs to be added. This change modifes the `scheduled.yml` GitHub action workflow to request required permissions. Note: composer normalizer is disabled temporarly due to a unwanted behaviour. Todo comment for disabled workflow action is added. [1] [1] ergebnis/composer-normalize#1287 Resolves: #2 Releases: main
The introduced scheduled job dispatcher failes due to insufficient permissions. To mitigate, a proper permission request needs to be added. This change modifes the `scheduled.yml` GitHub action workflow to request required permissions. Note: composer normalizer is disabled temporarly due to a unwanted behaviour. Todo comment for disabled workflow action is added. [1] [1] ergebnis/composer-normalize#1287 Resolves: #2 Releases: main
As an example, compare https://semver.madewithlove.com/?package=composer%2Fcomposer&constraint=%5E2.5 with https://semver.madewithlove.com/?package=composer%2Fcomposer&constraint=%5E2.5+%7C%7C+%5E2.6 It looks like you intended to say Note that by saying |
The example you have provided is where this tool removes a completely redundant set of constraints. Is this the only use-case that you don't like, or is there another example you can provide? |
As mentioned, different opinions. Ack, technical it's redunant and there is no point against it. However, from a human readable point, expresession them in that way can be taken as "these are official supported minor php versions branches, newer once may work work or not. Which allows using higher php version to test it until it is added. Using the stricter variant
means that only these can be used and forbids newer php version per default. And if PHP 8.4 is released at some point requireing projects/packages needs to wait until it is added or using nasty platform-ignore-req hacks which opens other can of worms. It's matter of reading and understanding, not the pure technical aspect what it means and acts like. Don't get me wrong - it was simply a question and I know a lot of people not using composer-normalize exactly out of this reason / behaviour. I'm not asking for a default change in behaviour - only for a configurable opt-in. If that's not wanted it's fully okay. I don't want to fight about it. If a option is not reasonable to disable/change that behaviour I will simply not use composer normalizer as it is not suitable for me. (and maybe others). Doing the work to fork the dependency chain and maintain it is not worth for me. |
The hyped `"ergebnis/composer-normalize"` composer plugin to normalize composer.json file and using it as a pipeline check operats strictly on semver and not allowing a more practical approach regardin the version handling of dependencies. Due to the fact that having another mindset then this plugin, it's not usable until it can be controlled. [1] Therefore, the plugin is removed again until this point which may never come. Handling the composer.json file manually in shape is doable. Used command(s): ```terminal > Build/Scripts/runTests.sh -s composer \ -- remove --dev "ergebnis/composer-normalize" ``` [1] ergebnis/composer-normalize#1287 Releases: main
The hyped `"ergebnis/composer-normalize"` composer plugin to normalize composer.json file and using it as a pipeline check operats strictly on semver and not allowing a more practical approach regardin the version handling of dependencies. Due to the fact that having another mindset then this plugin, it's not usable until it can be controlled. [1] Therefore, the plugin is removed again until this point which may never come. Handling the composer.json file manually in shape is doable. Used command(s): ```terminal > Build/Scripts/runTests.sh -s composer \ -- remove --dev "ergebnis/composer-normalize" ``` [1] ergebnis/composer-normalize#1287 Releases: main
The hyped `"ergebnis/composer-normalize"` composer plugin to normalize composer.json file and using it as a pipeline check operats strictly on semver and not allowing a more practical approach regardin the version handling of dependencies. Due to the fact that having another mindset then this plugin, it's not usable until it can be controlled. [1] Therefore, the plugin is removed again until this point which may never come. Handling the composer.json file manually in shape is doable. Used command(s): ```terminal > Build/Scripts/runTests.sh -s composer \ -- remove --dev "ergebnis/composer-normalize" ``` [1] ergebnis/composer-normalize#1287 Releases: main
The hyped `"ergebnis/composer-normalize"` composer plugin to normalize composer.json file and using it as a pipeline check operats strictly on semver and not allowing a more practical approach regardin the version handling of dependencies. Due to the fact that having another mindset then this plugin, it's not usable until it can be controlled. [1] Therefore, the plugin is removed again until this point which may never come. Handling the composer.json file manually in shape is doable. Used command(s): ```terminal > Build/Scripts/runTests.sh -s composer \ -- remove --dev "ergebnis/composer-normalize" ``` [1] ergebnis/composer-normalize#1287 Releases: main
Allowing to configure Having said that, I agree with @fredden's comment #1287 (comment). ExampleRunning composer require composer/semver and creating a file <?php
declare(strict_types=1);
use Composer\Semver;
require_once __DIR__ . '/vendor/autoload.php';
$parser = new Semver\VersionParser();
$one = $parser->parseConstraints('^7.4 || ^8.0 || ^8.1 || ^8.2 || ^8.3');
$two = $parser->parseConstraints('^7.4 || ^8.0');
var_dump(
$one->matches($two),
$two->matches($one),
); and running php test.php yields bool(true)
bool(true) The example above confirms what @fredden said in #1287 (comment). Documenting PHP version supportIf you want to document your PHP version support and prevent installation of a package on unsupported versions of PHP you could use the For reference, see |
Steps required to reproduce the problem
composer require "php":"^7.4 || ^8.0 || ^8.1 || ^8.2 || ^8.3"
composer normalize
Expected Result
Actual Result
Remarks
I know that there are different opionons out there about how to deal with dependecy version constraints, and therefore I'd say a option to disable the dependency version constraint normalization at whole would be nice.
For me this means, the normalizer is not usable because of this - but I would pretty much use all
the other normalization this tools offers - specially as a pipeline check.
Can we made this a config / command option in some way ?
The text was updated successfully, but these errors were encountered: