GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||
GeezerVison is showing github.com — feat(reconcile): prune merged branches as a second, separately switched job by rishitank · Pull Request #17 · TanksterAI/.github Conversation
|
| Trigger | Mode |
|---|---|
Schedule (nightly) or a push to settings.yml |
apply only if maintenance.prune_merged_branches is literally true; otherwise dry-run |
| workflow_dispatch | Follows the prune input; the default is dry-run |
Run 37881291312 succeeded with prune: dry-run and nothing was deleted.
19 deletable branches:
.github: add-lighthouse-ci, agent-pipeline/auto-merge, agent-pipeline/subscription-auth, tmp-move-tagagent-os: curriculum/skill-acquisition-loop, sentinel/escalation-ladder-driftdrillwright: sync/part-1 … sync/part-9evidence-reply: any-topic-robustness, latest-stable-versionsconnector-readiness: docs/sample-report, feat/readiness-scanner153 report-only branches:
| Category | Count |
|---|---|
| open | 98 |
| keep/protected | 39 |
| closed-unmerged | 12 |
| no-pr | 3 |
| merged-but-moved | 1 (.github:ops/settings-as-yaml-and-dependabot) |
This matches the 9 Oct branch inventory exactly: the inventory's MERGED-SAFE set, minus trading-agent-guard:v0.1, which the keep pattern catches.
prune: dry-run.branch-prune-report. It lists each deletable branch, and each report-only branch with its reason and last commit date.maintenance.prune_merged_branches: true in settings.yml and merge it (the push runs the job), or dispatch with prune: apply.ORG_ADMIN_TOKEN must also hold Contents: read & write and Pull requests: read on the org repos. Deleting refs needs Contents write. The dry run only proves read access.repo-settings-reconcile.yml, which feat: org rulesets (review-gate, ci-gate, auto-merge, long-lived-branches) reconciled from settings.yml, with no per-repo data #8 also rewrites. Expect a trivial conflict at the end of the file, whichever PR lands second.reconcile job's checkout is left as it is (pinned to a tag), to keep this diff focused and away from feat: org rulesets (review-gate, ci-gate, auto-merge, long-lived-branches) reconciled from settings.yml, with no per-repo data #8 and fix(workflows): harden rust-ci, security, workflows-lint and auto-merge-gate #16.gh, covering:
🤖 Generated with Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ed job settings.yml has declared maintenance.prune_merged_branches since 2 Sept, but repo-settings-reconcile.yml never read it. Adds scripts/prune-merged-branches.sh (merged-at-tip only, ruleset and open-PR aware, re-reads the tip before acting, reports everything else) and a `prune` job that applies only when settings.yml says true on schedule/push, or when a hand-run picks prune=apply. Default: dry run. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012rYJxu978iUSGFZ1UuqTsi
branch-prune.yml read the same maintenance.prune_merged_branches switch, so flipping it to true would have armed two deleters, and this one skips the safety rules the new job enforces: it deletes any branch with a merged PR even if commits were pushed after the merge, ignores rulesets, stops at 200 PRs, and does not re-read the tip before deleting. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012rYJxu978iUSGFZ1UuqTsi
There was an error while loading. Please reload this page.
ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe separate branch-pruning workflow was removed. A pruning script and job were added to the repository-settings reconciliation workflow. The job selects dry-run or apply mode from the manual input or policy. The script classifies branches, checks deletion conditions, and writes reports. ChangesMerged Branch Pruning
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ReconcileWorkflow as repo-settings-reconcile.yml
participant PruneScript as prune-merged-branches.sh
participant GitHubAPI
participant ReportUpload as Report upload
ReconcileWorkflow->>PruneScript: Pass organisation and selected mode
PruneScript->>GitHubAPI: Inspect branches and apply deletions when selected
PruneScript-->>ReconcileWorkflow: Return status and write report
ReconcileWorkflow->>ReportUpload: Upload report after the job
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing. Apprentice, the branches face review Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Self-review by Claude (head c317712, after the branch update onto 340ebb9). I read all 3 changed files in full.
scripts/prune-merged-branches.sh (blob 9360696e, the same blob that ran in apply mode in run 37945894623)
--mode accepts only dry-run or apply; anything else exits 2;shift 2 || fail_usage;state=all) and repositories are all listed with --paginate.head_repo == R and head_sha == tip;@uri-encoded ref; gone or error means keep, and a moved tip means merged-but-moved.failed and gives exit 1.gh cannot consume the list. The report and summary use cell escaping for the | and newline characters.repo-settings-reconcile.yml
prune choice input defaults to dry-run.reconcile;contents: read only;persist-credentials: false;true. settings.yml stays false here, so after merge the nightly and push runs are dry runs.branch-prune.yml removal: correct. Leaving it would arm a second, weaker deleter on the same switch.
Evidence from the real apply run 37945894623: 36 repos scanned, 0 unreadable, 19 deletable, 19 deleted, 0 already gone, 0 failed.
Nit (body only, no code change): the Notes section says "#8 also rewrites" the reconcile tail. The conflicting PR is #18, which I am rebasing onto this next.
Result: no defects found and no fixes needed. CI and CodeRabbit are green.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…ing main #17 and this branch both add a dispatch input and a job to this file, so the merge of main conflicts. This commit makes the file identical to main (7fc3700); the next one re-adds the rulesets input, job and header on top, so the merge is clean and the rulesets change is reviewed against main. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012rYJxu978iUSGFZ1UuqTsi
… fake gh executable repo-settings-reconcile.yml is main's version (with #17's `prune` input and job) plus this PR's `rulesets` dispatch input, `rulesets` job and header paragraph, which is now the THIRD JOB since prune is the second. Nothing else in the file differs from main. test/reconcile-rulesets/run.sh: git stores fake-gh as 100644 and run.sh copied it to $bin/gh without the exec bit, so PATH lookup skipped it and the suite called the REAL gh against acme/* (in this sandbox it was refused with 403, and the run aborted at test 1). chmod +x after the copy; 17/17 pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012rYJxu978iUSGFZ1UuqTsi
… 0 (#18) Adds rulesets.review_gate.required_approving_review_count: 0 to settings.yml, scripts/reconcile-rulesets.sh (changes only that number, reads every write back) with 17 tests, and a `rulesets` job and dispatch input in repo-settings-reconcile.yml alongside #17's prune job. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012rYJxu978iUSGFZ1UuqTsi
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.