Page MenuHomePhabricator

Striker-created Diffusion mirrors of GitLab repos are empty (due to master vs main branch name mismatch)
Closed, ResolvedPublicBUG REPORT

Description

Wikimedia GitLab repos created by Striker mirrored to Wikimedia Phabricator Diffusion (thanks to T317345: Mirror Striker managed GitLab repos in Diffusion) show empty in Diffusion:

Screenshot from 2023-10-04 13-36-08.png (635×1 px, 61 KB)

This is due to using the default branch name main in Wikimedia GitLab due to T281593: Rename mainline Git branch from "master" to "main" on all WMF-hosted repositories during GitLab migration.
Screenshot from 2023-10-04 13-35-55.png (780×1 px, 133 KB)

After correcting the default branch in Diffusion, mirroring works as expected:
Screenshot from 2023-10-04 13-36-41.png (750×1 px, 71 KB)

https://phabricator.wikimedia.org/conduit/method/diffusion.repository.edit/ allows to pass a defaultBranch.

Event Timeline

Aklapper triaged this task as Medium priority.
Aklapper created this task.

Change 963292 had a related patch set uploaded (by Aklapper; author: Aklapper):

[labs/striker@master] Set default branch to "main" for GitLab repos mirrored to Diffusion

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

This is due to using the default branch name main in Wikimedia GitLab due

Does Striker create the main branch explicitely or is that just the default on people's local Git installs?

@taavi: I think the answer to your question is "default" but let me elaborate to avoid misunderstanding:
Phabricator Diffusion assumes that the default name of the default branch to create when creating a repo is master. (This was/is also the case in our Wikimedia Gerrit setup.) However in GitLab, the default branch name is main. Thus Striker currently sets up the mirror repo in Diffusion not setting a branch name at all, so Diffusion assumes by default that the branch to pull from in GitLab is called master while it is called main, thus mirroring fails, thus Striker code needs to explicitly tell the Diffusion API to set the non-default branch name main of the repository to mirror from GitLab into Diffusion.

Change 963292 merged by jenkins-bot:

[labs/striker@master] Set default branch to "main" for GitLab repos mirrored to Diffusion

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

Change 967247 had a related patch set uploaded (by BryanDavis; author: Bryan Davis):

[operations/puppet@production] striker: Bump container version to 2023-10-19-160227-production

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

Thanks! Note to myself: I found at least one toolforge-repos project using a master branch in GitLab which seems to have been recently created, which is unexpected. But that should go to another ticket.

Change 967247 merged by Majavah:

[operations/puppet@production] striker: Bump container version to 2023-10-19-160227-production

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