Problem/Motivation
Drupal\Tests\Composer\Generator\BuilderTest fails on the new 12.0.x branch:
https://git.drupalcode.org/project/drupal/-/jobs/12408941
✘ Builder with data set 0
┐
├ Failed asserting that two arrays are equal.
┊ ---·Expected
┊ +++·Actual
┊ @@ @@
┊ 'conflict' => [...]
┊ 'extra' => Array (
┊ 'branch-alias' => Array (
┊ -············'dev-main'·=>·'12.x-dev'
┊ +············'dev-main'·=>·'12.0.x-dev'
┊ )
┊ )
┊ )
│
│ /builds/core/tests/Drupal/Tests/Composer/Generator/BuilderTest.php:81
┴
This is because Composer::drupalVersionBranch() returns the wrong thing now we opened 12.0.x.
Steps to reproduce
Proposed resolution
Either: remove the branch aliases from 12.0.x (they only need to be in main anyway) with the downside that we have to do this again when we open 13.0.x from main
Or: fix BuilderTest and related code so it sets the branch alias correctly in all cases
I lean towards the latter as it will be less work and less remembering how to fix it when we run into this again in two years time with the former solution.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3625553
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
Comment #6
longwaveThis was out of sync across all branches. This should solve it so all branches stay up to date. Before we open 13.0.x, we will change VERSION to 13.x-dev and the branch-alias to 13.x and the test will continue to pass. When we then branch 13.0.x, the test will still continue to pass.
Comment #7
amitgoyal commentedAll 4 branch MRs pass locally (BuilderTest 3/3, PHPCS clean on changed source files).
CI is green on main/12.0.x/11.x. The 11.4.x pipeline shows a failure in default_admin's AdminNodeTest, but this is a pre-existing unrelated flake, not caused by this patch: the same failure reproduces on unmodified 11.4.x nightly pipelines (e.g. #973787, #974396) unrelated to the branch-alias/BuilderTest changes here.
Comment #8
godotislateTest failure on 11.4.x comes from #3618586: default_admin loses the footer group on forms that set #tree, silently unpublishing entities on save. I think we can just fix that by adding #[IgnoreDeprecations] to
Drupal\Tests\default_admin\Functional\AdminNodeTest. Will comment in that issue.Comment #9
longwaveHopefully the title makes sense.
The metapackage builders now always generate the
dev-mainbranch alias asMAJOR.x-dev(for example12.x-dev), instead of the minor branch such as12.0.x-dev. Onmain, this alias is what lets Composer treat the branch as12.x-dev. Without it, constraints such asdrupal/core: 12.x-devcould not resolve tomain. On release branches the alias has no effect, because Composer applies adev-mainalias only to themainbranch. Generating the same value everywhere means that cutting a new release branch no longer changes the metapackages or breaks BuilderTest.Technically we don't need to backport this to 11.x or 11.4.x but to me it makes sense to put everything in sync once and be done.
Comment #14
godotislateI observed something similar opening the 11.4.x branch.
This should hopefully resolve this going forward for minors and for majors as long as we remember to increment the version before creating the new major branch.
Committed to main, 12.0.x, 11.x, and 11.4.x.