Require reviewed pull requests on main with no admin bypass

Open
#398 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
github, github-actions, python
Domain
devops, security

Research direction

Start by reading the Protect main ruleset at gh api repos/openpickleball/backend/rulesets/26885646, then review CLAUDE.md and CONTRIBUTING.md. The issue also calls for recording the founding phase decision and tracking tier 4 as a follow-up. Done means the agreed ruleset settings are in place, both contribution guides describe reviewed pull requests, and the listed acceptance criteria are met.

Written by the indexing model from the issue text.

Description

area:infra area:security priority:p1 size:S status:blocked type:chore

Epic: #397

Problem: Scorecard gives Branch-Protection 3/10 and Code-Review 3/10. The Protect main ruleset blocks deletion and force pushes and requires pull requests and status checks, but it requires 0 approvals, and the Repository admin role can bypass it always. Only 1 of the last 3 changesets Scorecard sampled had an approval. Hard rule 8 lists score confirmation, organizer verification, and identity linking as security-sensitive; a single compromised maintainer account can merge to main today.

Scorecard's tiers (a tier counts only when every tier below it is met):

  • Tier 1 (3): no force push, no deletion. Met.
  • Tier 2 (6): at least 1 approval; branch up to date before merging (or a merge queue); approval of the most recent reviewable push. Not met.
  • Tier 3 (8): at least 1 required status check. Met, but not counted until tier 2 is.
  • Tier 4 (9): at least 2 approvals; code owner review.
  • Tier 5 (10): dismiss stale approvals on push; the rules apply to administrators (Scorecard treats any bypass actor on any rule as not enforced for admins).

Decision needed: this ends the founding phase in CLAUDE.md ("repository admins may push directly to main"). Removing the admin bypass means every change, including Dependabot's, needs a second person's approval. The repository has two admins and the maintainers team (the only code owner) has one member, so:

  • Tier 2 and 3 (score 8) need 1 approval, which the two admins can give each other.
  • Tier 4 needs 2 approvals and a code owner approval from someone other than the author. With one member in maintainers, that member's own pull requests could never merge. Do not turn on tier 4 until the team has at least 3 people able to review.

Scope:

  • Decide whether the founding phase ends now, and record it (ADR or issue #1 decision)
  • In the Protect main ruleset, pull request rule: required_approving_review_count: 1, require_last_push_approval: true, dismiss_stale_reviews_on_push: true
  • Required status checks rule: strict_required_status_checks_policy: true (or add a merge queue rule instead, which avoids rebasing every open pull request after each merge)
  • Remove the Repository admin bypass actor. If an emergency path is wanted, document it as editing the ruleset (which shows in the audit log), not a standing bypass
  • Update CLAUDE.md ("Contribution conventions", founding phase and direct pushes to main) and CONTRIBUTING.md to say every change goes through a reviewed pull request
  • Later, once maintainers has 3 or more reviewers: required_approving_review_count: 2 and require_code_owner_review: true (tier 4). Track as a follow-up issue

Acceptance criteria:

  • gh api repos/openpickleball/backend/rulesets/26885646 shows the settings above and no bypass_actors
  • A pull request without an approval cannot be merged, including by an admin
  • A push after approval needs a new approval
  • The next Scorecard run shows Branch-Protection 8 or higher
  • Code-Review rises as reviewed changes replace the unreviewed ones in Scorecard's ~30 commit window

Out of scope:

  • The Protect release tags ruleset
  • Requiring 2 approvals and code owner review before the team can support it

Size: S

Dominant language
Python
Stars
0
Forks
1
Avg merge
1h 7m
Merged PRs (30d)
206

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openpickleball/backend

All issues in openpickleball/backend

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.