Skip to content

ci: Add a scheduled prune for stale deploy branches#127

Draft
DanielKellerM wants to merge 2 commits into
develfrom
ci/prune-deploy-branches
Draft

ci: Add a scheduled prune for stale deploy branches#127
DanielKellerM wants to merge 2 commits into
develfrom
ci/prune-deploy-branches

Conversation

@DanielKellerM

Copy link
Copy Markdown
Collaborator

Why

util/deploy.py commits one __deploy__<src7>__<branch> branch of generated RTL per push (make -B idma_hw_all regenerates from scratch each time). These accumulated to 120+ refs, and the gitlab-ci action's git push --mirror re-syncs every branch to the GitLab CI mirror — with auto_cancel_pending_pipelines enabled, that mass re-sync cancels PR child pipelines (the "all jobs skipped" failures we've been seeing).

What

A weekly (workflow_dispatch-able) prune with the retention policy:

  • Keep the latest release's deploy branch (__deploy__<src7>__master, derived from the newest vX.Y.Z tag's -src parent).
  • Keep any devel/master deploy branch newer than 60 days.
  • Prune everything else — and always prune feature-branch deploys (pure CI cruft).

Safety:

  • Allow-listed: a case __deploy__* guard makes devel/master/non-deploy refs structurally untouchable.
  • Dry-run by default on manual runs (workflow_dispatch); scheduled runs prune for real.
  • Idempotent + paginated.

Nothing references __deploy__ branches — downstream Bender deps pin the vX.Y.Z tag (the deploy commit the branch tip carries), which is untouched. Deploy regenerates from scratch, so pruning can't break a future deploy.

Companion changes

The deploy job commits one __deploy__<src7>__<branch> branch of generated
RTL per push; these accumulated to 100+ refs and polluted the GitLab CI
mirror (git push --mirror re-syncs every branch, churning pipelines).
Add a weekly workflow that keeps the latest release deploy branch and any
mainline deploy newer than 60 days, and prunes the rest. Feature-branch
deploys are always pruned. Allow-listed to __deploy__ refs with a dry-run
default on manual runs. Nothing references these branches; downstream
Bender deps pin the vX.Y.Z tag, which is unaffected.
Copilot AI review requested due to automatic review settings June 15, 2026 07:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Address review: (1) refuse to prune if no release tag is found instead of
falling through and deleting the (>60-day-old) latest release branch when
KEEP_BRANCH is empty; (2) derive the kept branch hash with `rev-parse | cut
-c1-7` to exactly match deploy.py's [0:7] (rev-parse --short can extend past
7 on ambiguity and mismatch); (3) skip a branch on any transient API/date
failure instead of aborting the whole run under set -e.
@DanielKellerM DanielKellerM marked this pull request as draft June 15, 2026 08:04
@DanielKellerM DanielKellerM added the enhancement New feature or request label Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants