Core requirement rewriter can result in a bad constraint
Problem/Motivation
The .amend-core-requirements-drupal-11 code in include.drupalci.main.yml is looking for 11, but when it doesnt contain 11, but the contraint otherwise supports 11, the string will be rewritten and result in a bad constraint.
Steps to reproduce
For example, Key project has the >=10.2 <12 constraint. This accepts Drupal 11, but it doesnt mention the string '11'.
The current code rewrites this constraint to ">=10.2 <12" || ^11, which is invalid.
Proposed resolution
Use a more intelligent constraint validation. Im sure there is a utility, or a small php script using https://github.com/composer/semver, somewhere that can test the constraint in info.yml accepts 11.0.0. If it doesnt then rewrite and revalidate the constraint.- If the constraint does not contain
^11then simply replace the entire constraint with^11 -
After rewriting a constraint, there should be some kind of validator to make sure it is a valid constraint.(not necessary)
Related issue: Issue #3456092
Edited by drupalbot