Skip to content

docs: add branch-protection runbook from src/zsh-eza audit findings - #477

Merged
ss-o merged 5 commits into
mainfrom
feature-branch-protection-runbook
Jul 25, 2026
Merged

docs: add branch-protection runbook from src/zsh-eza audit findings#477
ss-o merged 5 commits into
mainfrom
feature-branch-protection-runbook

Conversation

@ss-o

@ss-o ss-o commented Jul 24, 2026

Copy link
Copy Markdown
Member

Closes #476. Impact review (per runbooks/instruction-update.md) is in that issue.

Summary

  • Adds runbooks/branch-protection.md: the checklist for provisioning and auditing repository settings/rulesets on next -> main repos, written from an audit of z-shell/src and z-shell/zsh-eza that found the same three gaps in both independently (missing renovate.json baseBranches, no guard against direct-to-main PRs, delete_branch_on_merge deleting the next branch itself after a promotion merge).
  • Cross-links from runbooks/dependency-management.md, runbooks/new-repository.md, and ADR-0008's Consequences/References.
  • Registers runbook-branch-protection in .github/instruction-surfaces.json.

Opened as a draft: this documents a real incident and its fix, but the runbook content and the manifest route are a maintainer call, not something I should land unilaterally.

Test plan

  • python3 scripts/validate-agent-policy.py -- passes
  • python3 -m unittest scripts/test_validate_agent_policy.py -v -- 68 tests pass
  • trunk check on all changed files -- no issues

Adds runbooks/branch-protection.md, the checklist for provisioning and
auditing repository settings and rulesets on next -> main repositories
(decisions/0008-branching-model.md). Written from an audit of
z-shell/src and z-shell/zsh-eza that found the same three gaps in
both, independently: renovate.json missing baseBranches (Renovate
bypassing next), no required check blocking direct-to-main PRs, and
delete_branch_on_merge deleting the next branch itself after a
promotion merge -- the ruleset deletion rule did not stop it under an
admin bypass.

Cross-links from dependency-management.md, new-repository.md, and
ADR-0008's Consequences/References. Registers runbook-branch-protection
in .github/instruction-surfaces.json.

Closes #476
Copilot AI review requested due to automatic review settings July 24, 2026 08:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new operational runbook to standardize how nextmain repositories are provisioned and audited (rulesets + repo settings + automation defaults), based on real audit findings, and wires it into the routed instruction surfaces so it’s consistently applied during bootstrap and branch-protection tasks.

Changes:

  • Add runbooks/branch-protection.md checklist covering rulesets, repo settings (delete_branch_on_merge), and automation configuration (Renovate baseBranches, main-branch guard check).
  • Cross-link the new runbook from runbooks/new-repository.md, runbooks/dependency-management.md, and ADR-0008 (decisions/0008-branching-model.md).
  • Register the runbook as a required routed surface via .github/instruction-surfaces.json (runbook-branch-protection).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
runbooks/new-repository.md Adds explicit guidance to apply the branch-protection runbook for nextmain repos during bootstrap.
runbooks/dependency-management.md Clarifies Renovate baseBranches is mandatory for nextmain repos and links to the runbook.
runbooks/branch-protection.md New runbook documenting the audit/provisioning checklist and incident learnings.
decisions/0008-branching-model.md Adds references tying the ADR policy to the enforcement/provisioning runbook.
.github/instruction-surfaces.json Routes the new runbook as required for relevant tasks/consumers.

Comment thread runbooks/branch-protection.md Outdated
@ss-o
ss-o marked this pull request as ready for review July 24, 2026 22:02
@ss-o
ss-o requested a review from a team as a code owner July 24, 2026 22:02
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sal <59910950+ss-o@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 24, 2026 22:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (4)

runbooks/new-repository.md:129

  • Same terminology consistency issue here: this section uses next -> main, while ADR-0008 and other guidance typically use nextmain. Aligning to makes this easier to grep and reduces ambiguity.
If this repository uses the `next` -> `main` model
(`decisions/0008-branching-model.md`), follow `runbooks/branch-protection.md`
in full before opening the bootstrap pull request. Trunk-on-`main`
repositories still need a `main` ruleset, but can skip the `next`-specific
items (the guard workflow, `renovate.json` override).

runbooks/branch-protection.md:38

  • For consistency with ADR-0008 and other docs in this repo, use nextmain (Unicode arrow) rather than next -> main here. This keeps terminology consistent and improves searchability.
Run every item below for a repository whose `decisions/0008-branching-model.md`
row is `next` -> `main`. Skip repositories that are trunk-on-`main`.

runbooks/branch-protection.md:43

  • Same terminology consistency issue: next -> main is inconsistent with ADR-0008’s nextmain wording. Using the same arrow symbol here makes searches and cross-references more reliable.
      `gh api repos/<org>/<repo> --jq .delete_branch_on_merge`. If `true`,
      any PR that uses `next` as its head branch (i.e. every `next` -> `main`
      promotion) risks GitHub deleting `next` right after merge, regardless of

runbooks/branch-protection.md:76

  • This line uses next -> main, but ADR-0008 and related docs use nextmain. Aligning on keeps terminology consistent across the documentation set.
When squash-merging a `next` -> `main` promotion PR without an explicit

Comment thread runbooks/new-repository.md
Comment thread runbooks/dependency-management.md Outdated
Comment thread runbooks/branch-protection.md Outdated
Copilot flagged 8 spots using ASCII -> instead of the Unicode ->
already used by ADR-0008 and the rest of the runbook set.
Copilot AI review requested due to automatic review settings July 24, 2026 22:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread runbooks/branch-protection.md
Copilot review: AGENTS.md only disallows Co-authored-by; there is no
blanket no-trailer policy and Signed-off-by is not itself prohibited.
Copilot AI review requested due to automatic review settings July 24, 2026 23:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

…tion-runbook

# Conflicts:
#	decisions/0008-branching-model.md
Copilot AI review requested due to automatic review settings July 25, 2026 01:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@ss-o
ss-o merged commit da0b007 into main Jul 25, 2026
7 checks passed
@ss-o
ss-o deleted the feature-branch-protection-runbook branch July 25, 2026 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: add branch-protection runbook from src/zsh-eza audit findings

2 participants