Page MenuHomePhabricator

Convert old release branches to tags
Closed, ResolvedPublic

Description

From T303828, I have mentioned using branch.py --core --core-bundle wmf_core --bundle wmf_branch --delete <VERSION> which has support for converting branches to tag (via T250095 and c3f8dc8e96b8c91f11444cc53f6b2b7dcc7f702c).

I went to run it for release branches with a dry run (--noop) mode:

$ ./branch.py --noop --delete --abandon --bundle wmf_core REL1_19
Repo mediawiki/extensions/3D doesn't have a branch named REL1_19
Would create tag REL1_19 pointing to c103fac20fa7dd63d439ce2817901d89f6d368ec
Would delete branch REL1_19 in mediawiki/extensions/AbuseFilter

But when running it without --noop:

$ ./branch.py --delete --abandon --bundle wmf_core REL1_19
Repo mediawiki/extensions/3D doesn't have a branch named REL1_19
Created https://gerrit.wikimedia.org/g/mediawiki/extensions/AbuseFilter/+/refs/tags/REL1_19

It has deleted the branch and created the tag pointing to master!!!

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
make-release: fix tag conversion of branchrepos/releng/release!137hasharfix-make-release-convert-to-tagmain
Customize query in GitLab

Related Objects

Event Timeline

Mentioned in SAL (#wikimedia-releng) [2024-11-26T09:58:20Z] <hashar> Semi manually converted REL1_19 branch to tags on currently wmf deployed repositories # T380841

Logs:

REL1_20P71192
REL1_21P71193
REL1_22P71194
REL1_23P71195
REL1_24P71196
REL1_25P71197
REL1_26P71198
REL1_27P71199
REL1_28P71200
REL1_29P71201
REL1_30P71202
REL1_31P71203
REL1_32P71204
REL1_33P71205
REL1_34P71206
REL1_35P71207
REL1_36P71208
REL1_37P71209
REL1_38P71210

Mentioned in SAL (#wikimedia-releng) [2024-11-26T21:15:01Z] <hashar> Converted legacy MediaWiki release branches to tags from repositories currently deployed on Wikimedia cluster. REL1_20, REL1_21, REL1_22, REL1_23, REL1_24, REL1_25, REL1_26, REL1_27, REL1_28, REL1_29, REL1_30, REL1_31, REL1_32, REL1_33, REL1_34, REL1_35, REL1_36, REL1_37, REL1_38 # T380841

To get rid of the legacy branch from a local clone:

git fetch origin --prune

For the superprojects mediawiki/extensions or mediawiki/skins use:

git -c fetch.prune=1 submodule update --init
hashar claimed this task.
hashar triaged this task as Low priority.

I forgot to clean the superprojects mediawiki/skins and mediawiki/extensions. I did it with:

$ TAG=REL1_27 bash -c 'git tag -s "$TAG" "remotes/origin/$TAG" -m "Tagging legacy $TAG branch"'
$ TAG=REL1_28 bash -c 'git tag -s "$TAG" "remotes/origin/$TAG" -m "Tagging legacy $TAG branch"'
$ TAG=REL1_29 bash -c 'git tag -s "$TAG" "remotes/origin/$TAG" -m "Tagging legacy $TAG branch"'
$ TAG=REL1_30 bash -c 'git tag -s "$TAG" "remotes/origin/$TAG" -m "Tagging legacy $TAG branch"'
$ TAG=REL1_31 bash -c 'git tag -s "$TAG" "remotes/origin/$TAG" -m "Tagging legacy $TAG branch"'
$ TAG=REL1_32 bash -c 'git tag -s "$TAG" "remotes/origin/$TAG" -m "Tagging legacy $TAG branch"'
$ TAG=REL1_33 bash -c 'git tag -s "$TAG" "remotes/origin/$TAG" -m "Tagging legacy $TAG branch"'
$ TAG=REL1_34 bash -c 'git tag -s "$TAG" "remotes/origin/$TAG" -m "Tagging legacy $TAG branch"'
$ TAG=REL1_35 bash -c 'git tag -s "$TAG" "remotes/origin/$TAG" -m "Tagging legacy $TAG branch"'
$ git push --tags
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 8 threads
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 5.93 KiB | 1.98 MiB/s, done.
Total 9 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Processing changes: refs: 9, done
To ssh://gerrit.wikimedia.org:29418/mediawiki/skins.git
 * [new tag]           REL1_27 -> REL1_27
 * [new tag]           REL1_28 -> REL1_28
 * [new tag]           REL1_29 -> REL1_29
 * [new tag]           REL1_30 -> REL1_30
 * [new tag]           REL1_31 -> REL1_31
 * [new tag]           REL1_32 -> REL1_32
 * [new tag]           REL1_33 -> REL1_33
 * [new tag]           REL1_34 -> REL1_34
 * [new tag]           REL1_35 -> REL1_35
$ 

Same for mediawiki/extensions with the addition of the REL1_22 tag.

I then deleted the branches from the web UI.