Problem/Motivation

As shown in #3392616: Update to Symfony 6.4 \Drupal\BuildTests\Composer\Template\ComposerProjectTemplatesTest::testMinimumStabilityStrictness struggles with the dev release versions returned by composer info.

Those version strings are ending in the first seven digits of the commit ID, and are passed as-is to \Composer\Semver\VersionParser::parseStability where they fall-through and are marked as 'stable'

Steps to reproduce

The fail shows in #3392616: Update to Symfony 6.4 (where we use a lot of dev-versions of Symfony 6.4) with a friendly

1) Drupal\BuildTests\Composer\Template\ComposerProjectTemplatesTest::testMinimumStabilityStrictness
Failed asserting that an array contains 'dev'.

/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:122
/var/www/html/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55
/var/www/html/core/tests/Drupal/BuildTests/Composer/Template/ComposerProjectTemplatesTest.php:136
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684
/var/www/html/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651
/var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php:144
/var/www/html/vendor/phpunit/phpunit/src/TextUI/Command.php:97

Proposed resolution

Strip the first seven digits of the commit ID, when present.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3392814

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Spokje created an issue. See original summary.

spokje’s picture

Issue summary: View changes
StatusFileSize
new1.04 KB

So the fail shows in #3392616: Update to Symfony 6.4 , if we apply the fix to that we get the attached patch, which should have 4 failures instead of the 5 it has in https://www.drupal.org/pift-ci-job/2781978

spokje’s picture

StatusFileSize
new99.2 KB

Meh, let's try uploading the correct patch this time...

spokje’s picture

Ok, I could have named the patch a bit better, but at least the failure from the IS is gone.

The actual fix is in the MR.

spokje’s picture

Status: Active » Needs review

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Wasn't entirely too sure how to test. The comment made it very clear. #3 did resolve the issue in the IS.

longwave’s picture

Status: Reviewed & tested by the community » Needs work

Some little style nits but this looks good to me and will help with these upgrades now and in the future.

spokje’s picture

Status: Needs work » Needs review

Thanks @longwave, back to NR.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Feedback item has been addressed.

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Committed fcb8618 and pushed to 11.x. Thanks!

Don't think this is worth backporting given we will only need -dev releases in 11.x/10.3.x from here onwards that I can see.

  • longwave committed fcb86180 on 11.x
    Issue #3392814 by Spokje, longwave: testMinimumStabilityStrictness...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.