ci: Add a scheduled prune for stale deploy branches#127
Draft
DanielKellerM wants to merge 2 commits into
Draft
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
util/deploy.pycommits one__deploy__<src7>__<branch>branch of generated RTL per push (make -B idma_hw_allregenerates from scratch each time). These accumulated to 120+ refs, and the gitlab-ci action'sgit push --mirrorre-syncs every branch to the GitLab CI mirror — withauto_cancel_pending_pipelinesenabled, 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:__deploy__<src7>__master, derived from the newestvX.Y.Ztag's-srcparent).devel/masterdeploy branch newer than 60 days.Safety:
case __deploy__*guard makesdevel/master/non-deploy refs structurally untouchable.workflow_dispatch); scheduled runs prune for real.Nothing references
__deploy__branches — downstream Bender deps pin thevX.Y.Ztag (the deploy commit the branch tip carries), which is untouched. Deploy regenerates from scratch, so pruning can't break a future deploy.Companion changes
deployjob to mainlines, stopping new feature-branch deploy refs at the source.__deploy__d15cf7e__neopxdma-tbenz, was rejected by a branch-protection hook).