Problem/Motivation
Follow-up from #3294814: [Policy] Branch Naming: Use an 11.x branch for HEAD, then use 'main' when d.o can support it. https://www.drupal.org/about/core/blog/new-drupal-core-branching-scheme-... has more of a write-up.
Drupal.org currently doesn't support having a 'main' branch since some logic is tied to version numbers, when it does, or when the relevant functionality is moved to gitlab, we should stop using 11.x as the development target and use main instead.
We're hoping this can happen before we need to open a '12.x' branch.
There are going to be core issues with having a non-numeric version too - we might have to solve that but setting Drupal::VERSION to the current major version target and updating that every so often (11, 12, 13 etc.)
The branching strategy would otherwise be the same as the current one with '11.x'.
Steps to reproduce
Proposed resolution
Remaining tasks
- #3445259: Update core subtree splitter to handle major.x & main branches
- #3445262: Update core packaging to support a main branch
User interface changes
API changes
Data model changes
Release notes snippet
Issue fork drupal-3382815
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:
- 3382815-branch-alias-main
changes, plain diff MR !13528
Comments
Comment #2
drummTagging 11.0.0-alpha1 was a good way of spotting 2 technical blockers:
Comment #4
drummI’ve been testing subtree splitting a main branch on staging. The composer.json branch alias added by the MR here was required for subtree splits to complete successfully.
Comment #5
drummI think I’ve taken this MR as far as I can. The approach can probably be improved to be less duplicitous.
The changes in #3445262: Update core packaging to support a main branch have not been deployed to production yet, and I am also working on one more change to the subtree splitter that is needed.
Comment #6
drummAll changes I believe are needed in Drupal.org infrastructure are now deployed.
Getting https://git.drupalcode.org/project/drupal/-/merge_requests/13528 reviewed and merged should be the next step. I don’t think there are any disadvantages to having this change in the 11.x branch; it will be on all future branches anyway.
To test CI ahead of branching, another repository could be used.
Then I think all knowable blockers for creating a main branch might be resolved, the branch can be created, and we start looking for unanticipated things to do.
Comment #7
larowlanThe approach here looks good to me
For those interested here's the composer docs on branch-alias
Looks like there's a conflict on the composer.lock file now
Comment #8
frobCan I ask why? Why do this?
Comment #9
catchEvery time we have a new major release, we have to retarget thousands of MRs (and issues) to the new major branch, e.g. 10.x to 11.x, or 11.x to 12.x.
With a 'main' branch, all issues and MRs, except for backports, will target 'main' in perpetuity.
The '11.x' branch itself was a move towards this - before we opened that, we used to have to retarget issues and MRs everything six months when a new minor branch opened, we only started using 11.x because some d.o things blocked using main, which they now don't.
Comment #11
longwaveBumping to critical, from a release management POV we need to open a new major branch very soon. Let's try this for
mainfirst and fall back to12.xif we run into unsolvable blockers.Comment #12
longwaveNeeds rebase first.
Comment #15
quietone commentedRebase and tests passing
Comment #16
godotislateOne question about the
plugin-api-versionchange in composer.lock from2.9.0to2.6.0. My guess is that the changes were generated locally with composer 2.8.x or lower, but I'm not sure how much this matters.Comment #17
mstrelan commentedOnce we have main, or even 12.x, what happens to 11.x? Does it continue to receive backports to stay current with 11.4.x?
Also an observation regarding the urgency in #11 - we could probably just open 12.0.x and branch main (or 12.x) from there when we're ready. But better to try open main now anyway.
Comment #18
longwave@mstrelan the urgency is more around the issue version field on d.o which has to be bulk updated when we open a new branch, which is tedious and can only be done by the DA; if we successfully open main then hopefully we never have to do that again.
Comment #19
mstrelan commentedGood point, I realised that after I posted
Comment #20
catchThat's a good question.
For the actual 11.x branch, I think we can leave it in place, and use it as the HEAD of 11.x, so that we we only branch 11.4.x and 11.5.x when we're ready to tag beta/rc/stable releases. It means an extra branch to commit to during beta/rc but otherwise not much overhead.
Longer term I'm less sure, we don't currently have a '10.x' branch so we needed to open 10.6.x, 10.5.x etc. as soon as we got to beta of the previous minor, but we could have used a 10.x branch as 'HEAD' and then opened them only as release branches later on. However we don't need to make a firm decision on that for approximately two years when we start committing things to what will become 13.0.0 - as long as we don't mind keeping the 11.x branch around nothing else will change.
The main thing that having 11.x vs not changes in practice is backports - e.g. it would provide a stable target for a backport MR, but with backports we tend to do them either very quickly after a commit (at least within the same six month minor window), or not at all, it's rare the target branch changes during the backport process.
Needs work for the plugin API version change, we should set that back to what it was. Otherwise this looks ready to go.
For next steps, my preference would be to commit this asap, open the main branch (we'll need to let the DA know we're ready to try it), and then we can make sure that tests actually pass on the actual main branch on CI which they still might not, open issues for bulk issue updates, figure out if we can bulk update all the MR targets with a bot or start doing that manually etc (hopefully for the last time).
Comment #21
quietone commentedFixed the plugin api version. Back to needs review.
Comment #22
longwaveOnly change is the plugin API version, back to RTBC.
Comment #23
drummYes, leave 11.x in place and keep using it. You can tag the highest 11.minor.* releases off of 11.x, and only branch when the previous minor series needs to diverge.
It would be good to have a couple commits on 11.x after this is merged, then open main after we know that’s working well.
Comment #25
catchCommitted/pushed to 11.x, thanks!
We can definitely do a couple more commits on 11.x (or more than that) prior to actually branching main.
Comment #28
drummThis made it through packaging with no errors or anything amiss that I can see: https://github.com/drupal/core-recommended/commit/47a79a2b24a5e7832ec26f...
Did we want this issue open for tracking all the way through main branch opening?
Comment #29
dwwOne thing, not sure if it's for here or a new drupalorg issue, is that I don't know what project_release is going to do with all its version fields if you try to create a release node pointing to a branch called 'main'. Way, way, way back, we actually had release nodes that pointed to "HEAD". See https://www.drupal.org/node/86863 for some gory details circa 20 years ago. 😂 Lots has changed, but not everything. We might need some changes to drupalorg_project* somewhere to special case 'main' and do something creative with the underlying version_* fields so that once main exists, we can create a release node for d.o so that issues can target that version.
Or, we hurry up and migrate core to GitLab issues. 😬 But I think this ship is probably going to sail before that happens, so we're still going to have to work around the project_issue vs. project_release stuff.
Comment #30
drummI already tested that and made changes that should work in #3445262: Update core packaging to support a main branch
Comment #31
dww@drumm re: #30: Fantastic, thanks!
Comment #32
nicxvan commentedI'm not sure where to record this, but when we are ready to retarget core MRs to main we should be able to do that programmatically:
It looks like:
Where ### is the number of the MR
We can get that list with this I suspect:
References:
https://docs.gitlab.com/cli/mr/list/
https://docs.gitlab.com/cli/mr/update/
Comment #33
dwwRe: #33: that’s handy, thanks. But we’d still need the manual effort of rebasing the issue forks, etc. I’m not sure how useful bulk updating the MR metadata is without also getting the branches in Git right at the same time.
Comment #34
drummI haven’t spotted any packaging issues after the pushes around tagging 10.6.2 & 11.3.2, so I can’t think of any Drupal.org or infrastructure blockers for branching. Be sure to create the release for main after branching.
For MR updating, having a person’s eyes on each to generally review the issue to see if something else has changed or needs updating is useful.
Comment #35
catchI don't think we'd need to rebase? 11.x and main will be identical at the point where they're branched. Eventually, main will diverge, but that's no different to new commits on 11.x. So it should be OK for a little while until it's not.
Comment #36
nicxvan commentedYeah, if you're retargeting an MR to a new future branch of the original source you only need to rebase if you already needed to.
If we do this automated then it will prevent a lot of pain of realizing that 11.x was still unintentionally targeted.