From ccf04608f5e8373d033f2e74bc434a32871ba41f Mon Sep 17 00:00:00 2001 From: Thore Cimbal Date: Tue, 18 Aug 2026 12:00:00 +0000 Subject: [PATCH] ci(canonize): prune the Gitea remote, or deleted branches never disappear Observed rather than reasoned: after the leftover rotation branch was deleted on both remotes, pipeline 492 still reported it. The runner recycles its workspace under GIT_STRATEGY=fetch, and git fetch without --prune keeps remote-tracking refs for branches that no longer exist upstream. The job would have kept naming a branch nobody can find, indefinitely - and before the previous commit it would have kept failing on it, with deletion offering no way out. Co-Authored-By: Claude Opus 5 --- .gitlab-ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 82f314b..37bf76d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,7 +72,12 @@ canonize_rotation: - git config --global user.email "ci@axion1337.chat" - git config --global user.name "TURN-Rotation (automatische Kanonisierung)" - git remote add gitea https://rohana.axion1337.de/sorb/axion1337.chat-gitops.git - - git fetch --quiet gitea + # --prune ist Pflicht, nicht Kosmetik: der Runner recycelt seinen Workspace + # (GIT_STRATEGY=fetch), und ohne prune bleiben remote-tracking-Refs geloeschter + # Zweige stehen. Der Job saehe einen laengst entfernten Rotationszweig sonst + # dauerhaft weiter - live beobachtet am 2026-08-18, Pipeline 492: beide Remotes + # waren nachweislich leer, der Job meldete den Zweig trotzdem. + - git fetch --quiet --prune gitea # Kein 'fetch origin' noetig: der Runner hat main schon ausgecheckt (GIT_DEPTH 0), # CI_COMMIT_SHA ist der Stand von main beim Anlegen der Pipeline. - git checkout -B main "$CI_COMMIT_SHA"