Page MenuHomePhabricator

Consider deleting the `list` Git tag from the mediawiki/core repository
Closed, ResolvedPublic

Description

It looks like there was a new list Git tag added to the mediawiki/core repo in November, that (AFAICS) points to the same commit as the 1.45.0-rc.0 tag:

$ git log -1 list
commit b84962afc779883c9b6e010909f8ac68db98449f (tag: list, tag: 1.45.0-rc.0)
Author: Atieno <pnjira@wikimedia.org>
Date:   Wed Nov 19 20:47:12 2025 +0300

    Prep 1.45.0-rc.0

    Bug: T408472
    Change-Id: I96c702bf9a8ccae739d61349da4f3c34f3be946d
$ git for-each-ref --format="%(creatordate)" refs/tags/list
Wed Nov 19 22:24:54 2025 +0300
$ git for-each-ref --format="%(creatordate)" refs/tags/1.45.0-rc.0
Wed Nov 19 22:49:52 2025 +0300

I'm guessing that the list tag may have been an inadvertent additional tag created while tagging 1.45.0-rc.0 (T408472: Release MW 1.45.0-rc.0).
Am I missing something here? & if it was an inadvertently-added tag, is it worth deleting it from the repo (to avoid unintentionally cluttering the list of tags, and to potentially prevent future confusion)?


cc @Atieno & MW-Interfaces-Team

Details

Event Timeline

Atieno triaged this task as Medium priority.

Checking on this

Tagging @Krinkle @thcipriani @Arlolra @MSantos I have in my command history git tag list that was supposed to be git tag --list that has caused this.

Does this still fall under "we don't delete tags"? cc @A_smart_kitten

[…] I have in my command history git tag list that was supposed to be git tag --list that has caused this.

Not exactly. That command creates a tag in your local clone. It was published to Gerrit and created in the central Git repo only later in a command like git push --tags.

krinkle@sandbox$ git tag v1.2.3
krinkle@sandbox$ git tag --list
v1.2.0
v1.2.3
krinkle@sandbox$ git tag example
krinkle@sandbox$ git tag --list
example
v1.2.0
v1.2.3
krinkle@sandbox$ git push --tags
 * [new tag]               example -> example
 * [new tag]               v1.2.3 -> v1.2.3

This would have been prevented by running git tag --delete example before pushing.

Does this still fall under "we don't delete tags"?

The policy applies to tags with names relating to stable releases. It is fine to delete accidents and experiments, unless those occopy release tags names.

When someone publishes 1.x.y or 1.x.y.-foo we musn't delete or overwrite such a tag, because that would cause conflicts for all other developers and consumers of the MediaWiki git repository. See T400729 for an example of such incident.

Note that accidental tags and temporary experiments will forever remain in most people's local clones after they pulled them from the central Git repo (i.e. Gerrit). Even if we delete them from the central Git repo in Gerrit, that will only remove them from the Gerrit UI and from new clones by future contributors. Tags are immutable. The same applies to non-personal clones (such as Phab mirror, GitHub mirror, and other replicas) where these would also remain. And this is the reason for having a policy about not deleting or overwriting release tags, and why tags should not be used (on purpose) for temporary things.

It is recommended for beginners to review tags before publishing them, because it gives you space to undo the mistake before it goes live on Gerrit. I assume the reason you wanted to run git tag --list was to review local tags before pushing to Gerrit. When you noticed the mistake, and decided to run the correct command instead, that is when you could have undone the mistake tag by deleting it. This would not have been visible to anyone. It is only when you run git push that any new tags are published and created in the central Git repo.

Change #1224021 had a related patch set uploaded (by Hashar; author: Hashar):

[mediawiki/core@refs/meta/config] Prevent people from pushing a "list" tag

https://gerrit.wikimedia.org/r/1224021

Change #1224021 merged by Hashar:

[mediawiki/core@refs/meta/config] Prevent people from pushing a "list" tag

https://gerrit.wikimedia.org/r/1224021

git tag only act with your local tags, never with the remote ones. Your local tags are not supposed to be pushed to the remote repository unless explicitly asked for (using git push --tags). Thus you must have pushed that list tag and I guess missed noticing in the output that a list tag has been created as a result.

The list of tags for mediawiki/core can be seen from https://gerrit.wikimedia.org/r/admin/repos/mediawiki/core,tags and I think you could have deleted that list tag from there. An alternative is to push a null reference for the tag which results in having it deleted, the magic command would be git push --delete refs/tags/list.

I have deleted the list tag that was pointing at b84962afc779883c9b6e010909f8ac68db98449f.

I have changed the repository configuration to hopefully deny further pushes of that list tag: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1224021/2/project.config

You can delete the local tag using git tag -d list.

Thanks @hashar :)

Given what @Krinkle said in T413213#11498700, I wonder if there's any chance of the tag also being manually deleted from the MW GitHub mirror? :p

I might not have deleted the tag properly earlier so I have deleted it from Gerrit.

The Gerrit replication plugin pushes +refs/tags/*:refs/tags/* which should have deleted the tag.

Here are the replication logs for the other Gerrit replicas:

[2026-01-07 11:14:56,125] Push to gerrit2@gerrit2002.wikimedia.org:/srv/gerrit/git/mediawiki/core.git references: RemoteRefUpdate{refSpec=null:refs/tags/list, status=NOT_ATTEMPTED, id=(null)..AnyObjectId[0000000000000000000000000000000000000000], force=yes, delete=yes, ffwd=no} [CONTEXT PLUGIN="replication" project="mediawiki/core" pushOneId="82254395" request="REST /r/*/mediawiki%2Fcore/*/list" ]
[2026-01-07 11:14:56,131] Push to gerrit@gerrit2003.wikimedia.org:/srv/gerrit/git/mediawiki/core.git references: RemoteRefUpdate{refSpec=null:refs/tags/list, status=NOT_ATTEMPTED, id=(null)..AnyObjectId[0000000000000000000000000000000000000000], force=yes, delete=yes, ffwd=no} [CONTEXT PLUGIN="replication" project="mediawiki/core" pushOneId="e2fd1ffa" request="REST /r/*/mediawiki%2Fcore/*/list" ]

They pushes the refspec null:refs/tags/list which did delete the tag (I have verified on the bare repo on each of the hosts).

For GitHub the replication log states:

[2026-01-07 11:15:05,984] Replication to git@github.com:wikimedia/mediawiki-core started... [CONTEXT PLUGIN="replication" project="mediawiki/core" pushOneId="a24de74a" request="REST /r/*/mediawiki%2Fcore/*/list" ]
[2026-01-07 11:15:06,123] Replication to git@github.com:wikimedia/mediawiki-core completed in 139ms, 15000ms delay, 0 retries [CONTEXT PLUGIN="replication" project="mediawiki/core" pushOneId="a24de74a" request="REST /r/*/mediawiki%2Fcore/*/list" ]

I have filed T413966 to find out why Gerrit does not replicate the tag deletion to GitHub :]

Thanks all. Marking this as resolved.

hashar claimed this task.