fix: enable delete_branch_on_merge and add settings enforcement script#104
Conversation
Closes #90 Adds .github/scripts/apply-repo-settings.sh — an idempotent script that applies all required repository settings from the org standard: https://github.com/petry-projects/.github/blob/main/standards/github-settings.md Settings enforced: - delete_branch_on_merge: true (compliance fix for #90) - allow_auto_merge: true - allow_squash_merge / merge_commit / rebase_merge: true - has_issues: true, has_wiki: false - squash_merge_commit_title: PR_TITLE - squash_merge_commit_message: COMMIT_MESSAGES Also applied delete_branch_on_merge: true directly via GitHub API so the next compliance audit run will see the correct value without waiting for the script to be executed manually. Co-authored-by: don-petry <don-petry@users.noreply.github.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hey @don-petry — this PR is ready for review and merge. It fixes the compliance finding by explicitly enabling |
There was a problem hiding this comment.
Pull request overview
This PR addresses org compliance for GitHub repository settings by adding a repo-local enforcement script intended to keep the petry-projects/markets repository aligned with the org’s standard defaults (including delete_branch_on_merge: true).
Changes:
- Added an idempotent
.github/scripts/apply-repo-settings.shscript that PATCHes the repository settings viagh api. - Script prints a focused subset of resulting repository settings for quick verification after applying changes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Superseded by automated re-review at
|
Adds `.github/scripts/apply-repo-settings.sh` — an idempotent script that applies all repository settings required by the org standard: https://github.com/petry-projects/.github/blob/main/standards/github-settings.md Settings enforced: - delete_branch_on_merge: true (compliance finding #90) - allow_auto_merge: true - allow_squash_merge / allow_merge_commit / allow_rebase_merge: true - has_issues: true, has_wiki: false - squash_merge_commit_title: PR_TITLE - squash_merge_commit_message: COMMIT_MESSAGES The setting has also been applied directly via the GitHub API this run. Supersedes PRs #104 and #118 (same intent, never merged). Closes #90 Co-authored-by: don-petry <don-petry@users.noreply.github.com>
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: LOW
Reviewed commit: a6a83ffb7b99f604dd608a6bb643f9fa1ac9fe0e
Review mode: triage-approved (single reviewer)
Summary
PR #104 adds a single idempotent bash script (.github/scripts/apply-repo-settings.sh, 48 lines) that enforces org-standard repository settings via gh api -X PATCH. This directly resolves compliance issue #90 (delete_branch_on_merge must be true). No production code is changed — the script is a manual admin tool requiring an explicit GH_TOKEN with admin scope at runtime. No substantive code changes since the prior cascade review (only merge commits and a CI retrigger).
Linked issue analysis
- Closes #90 — Compliance audit flagged
delete_branch_on_mergeasnull(expectedtrue). The script setsdelete_branch_on_merge=truealong with all other org-standard defaults. The setting was also applied directly via the API per the PR description. Issue is substantively addressed.
Findings
No blocking issues. Minor observations (informational only, not blocking):
- [info]
-F(typed field) is used for string enum values likesquash_merge_commit_title=PR_TITLE. TheghCLI handles this correctly, though-f(raw string) would be slightly more self-documenting for non-boolean/non-numeric values. - [info]
REPOis hardcoded topetry-projects/markets. This is intentional and appropriate for a compliance-enforcement script scoped to this repository.
CI status
All checks passed:
- ✅ CodeQL (actions) — SUCCESS
- ✅ SonarCloud — SUCCESS (0 new issues, 0 security hotspots)
- ✅ AgentShield — SUCCESS
- ✅ CodeRabbit — SUCCESS
- ✅ Dependency audit — ecosystem detection SUCCESS, language-specific audits SKIPPED (no applicable ecosystems)
- ✅ CI — ecosystem detection SUCCESS, Backend/Frontend SKIPPED (no changes to those layers)
Reviewed automatically by the don-petry PR-review agent (single-reviewer, triage-approved). Reply with @don-petry if you need a human.
|
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: LOW
Reviewed commit: 9dc7ccc17a930df3c94139156b1562b24606dfb4
Review mode: triage-approved (single reviewer)
Summary
PR #104 adds a single idempotent bash script (.github/scripts/apply-repo-settings.sh, +48 lines) that enforces org-standard GitHub repository settings via gh api -X PATCH, directly resolving compliance issue #90 (delete_branch_on_merge: true). The script requires an explicit admin GH_TOKEN at runtime — no automation is introduced, no secrets are hardcoded, and no production code is changed. Confirming the triage tier's low-risk assessment.
Linked issue analysis
- Closes #90 — The compliance audit flagged
delete_branch_on_mergeasnull(expectedtrue). The script setsdelete_branch_on_merge=trueplus the rest of the org-standard defaults (allow_auto_merge,allow_squash_merge,allow_merge_commit,allow_rebase_merge,has_issues=true,has_wiki=false,squash_merge_commit_title=PR_TITLE,squash_merge_commit_message=COMMIT_MESSAGES). The PR description also notes the setting was applied directly to the repo via API. Substantively addressed.
Changes since prior review
Since a6a83ffb (prior approval), the only changes are merge commits from main and unrelated PRs (CODEOWNERS updates, dependabot bumps, workflow fixes for the dependabot-rebase reusable). The PR-introduced file (.github/scripts/apply-repo-settings.sh) is byte-identical to the prior reviewed state. No new code to assess.
Findings
No blocking issues. Minor informational notes carried forward from prior review (not blocking):
- [info]
.github/scripts/apply-repo-settings.sh:26-35—-F(typed field) is used for string enum values likesquash_merge_commit_title=PR_TITLEandsquash_merge_commit_message=COMMIT_MESSAGES.ghCLI handles this correctly, though-f(raw string) would be slightly more self-documenting for non-boolean/non-numeric values. - [info]
.github/scripts/apply-repo-settings.sh:15—REPOis hardcoded topetry-projects/markets. Intentional and appropriate for a compliance-enforcement script scoped to this repository.
CI status
All required checks green:
- ✅ CodeQL (Analyze actions) — SUCCESS
- ✅ CodeQL — SUCCESS
- ✅ CodeRabbit — SUCCESS
- ✅ SonarCloud — Quality Gate passed (0 new issues, 0 security hotspots)
Merge state is BLOCKED, presumably awaiting the formal review from @petry-projects/org-leads per branch-protection policy.
Reviewed automatically by the PR-review agent (single-reviewer mode: opus 4.7). Reply if you need a human review.
Superseded by automated re-review at 9dc7ccc.
Automated review — human attention neededThis PR has been through 3 automated review cycles (cap: 3) without converging on an approval-and-merge state. Further automated review has been paused to avoid infinite loops. Please take a look manually, or close this PR if it's no longer needed. Once a human review resolves the situation, remove the Posted by the donpetry-bot PR-review cascade. |
|
@dev-lead - please fix this PR |
|



Summary
delete_branch_on_merge: truedirectly to the repository via GitHub API to resolve the compliance finding.github/scripts/apply-repo-settings.sh— an idempotent script that enforces all required repository settings from the org standardSettings enforced by the script
delete_branch_on_mergetrueallow_auto_mergetrueallow_squash_mergetrueallow_merge_committrueallow_rebase_mergetruehas_issuestruehas_wikifalsesquash_merge_commit_titlePR_TITLEsquash_merge_commit_messageCOMMIT_MESSAGESTest plan
delete_branch_on_merge: trueconfirmed viagh api repos/petry-projects/markets --jq .delete_branch_on_merge.github/scripts/apply-repo-settings.shwith an admin token to verify idempotencyCloses #90
Generated with Claude Code