Skip to content

create-branches: Push the new ref without disabling CI

Emanuele Aina requested to merge wip/em/branching-without-disabling-ci into main

When we create the new branch we do not want to trigger a pipeline, as that would overwhelm GitLab with thousands of useless jobs.

Even worse, with the latest infrastructure/ci-package-builder> this would trigger a horribly time consuming rebuild on OBS.

Unfortunately the GitLab API does not allow us to skip CI when creating a new branch.

We worked around that by disabling CI completely on the repo, creating the new branch, and then re-enabling CI. However, it does not work reliably: when GitLab is under load, it ends up processing the branch creation asynchronously, once CI has been already re-enabled.

When pushing via git, the ci.skip option does exactly what we want, but we do not want to check out thousands of git repotories either.

But we do not have to check them out if we learn to speak the minimal subset of the git HTTP protocol needed to push a single new ref!

Let's then manually craft the right HTTP request to emulate a git push of the new ref over HTTP, passing the ci.skip option to create the new branch without triggering any pipeline.

Edited by Emanuele Aina

Merge request reports