Skip to content

fix(branch-retention): exempt next/hotfixes/dev in the default so releases don't delete integration branches - #308

Merged
Shinrai merged 2 commits into
nextfrom
fix/branch-retention-exempt-integration-branches
Sep 17, 2026
Merged

Shinrai merged 2 commits into
nextfrom
fix/branch-retention-exempt-integration-branches

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

No other changes

👥 Contributors

…eases don't delete integration branches

branch-retention deletes a merged PR's head branch when nothing exempts it. The
persistent next→master / hotfixes→master release PR merges with `next` / `hotfixes`
as its HEAD, so on every release branch-retention deleted the integration branch —
and GitHub auto-closes EVERY open PR whose base branch is deleted, silently killing
in-flight feature PRs. next-reset recreates the branch but not the closed PRs.
(Real incident: CLDMV/slothlet v3.16.3 closed PRs #405 and #409 unmerged.)

The reusable default exempt_patterns was ["master","main","badges","gh-pages"] —
missing the integration branches — even though this repo's own
local-branch-retention.yml already exempts next/hotfixes/dev. Promote that same
protection into the reusable default so every consumer inheriting it is covered:
next is never deleted on release, in-flight PRs stay open, and the reset
force-resets next in place (step 7) instead of recreating it (step 9).
@cldmv-bot cldmv-bot Bot added ! fix → next v4 flow: fix contributor PR targeting the next integration branch type: ci Changes to CI workflows, actions, or build pipelines labels Sep 17, 2026
…t/hotfixes) from deletion

The org 'Protect Next' / 'Protect Hotfixes' rulesets carry a deletion rule,
but the bot App is a bypass actor on them (bypass_mode: always) because it
needs the bypass to force-reset next during a release — and that same bypass
lets a delete through. So the ruleset cannot be the guardrail against the very
actor that runs branch-retention. Enforce the guardrail in the action itself:
refuse to delete master/main/next/hotfixes regardless of exempt_patterns or a
matching retention rule. Complements the default exempt_patterns fix.
@cldmv-bot cldmv-bot Bot added the area: core Touches core library / runtime source code label Sep 17, 2026
@Shinrai
Shinrai merged commit d7c5d4b into next Sep 17, 2026
14 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/branch-retention-exempt-integration-branches branch September 17, 2026 13:42
Shinrai added a commit that referenced this pull request Sep 17, 2026
…s… (#307)

## 🚀 What's Changed

### 💥 Breaking Changes
_No breaking changes_

### ✨ Features
_No new features_

### 🐛 Bug Fixes
- #308
- fix(branch-retention): hard-guard permanent branches
(master/main/next/hotfixes) from deletion (966d724)
- fix(branch-retention): exempt next/hotfixes/dev in the default so
releases don't delete integration branches (34aa592)

### 📦 Dependencies
_No dependency updates_

### 🔧 Other Changes
- #306
- ci(examples): inherit max_node_major in individual-repo workflow
templates (1dde0be)



<details>
<summary>👥 Contributors</summary>

- @Shinrai

</details>

<!-- co-authors -->

Co-authored-by: Shinrai <[email protected]>

---------

Co-authored-by: Shinrai <[email protected]>
Co-authored-by: Nathaniel H <[email protected]>
Co-authored-by: cldmv-bot[bot] <230771808+cldmv-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Touches core library / runtime source code ! fix → next v4 flow: fix contributor PR targeting the next integration branch type: ci Changes to CI workflows, actions, or build pipelines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant