Repository navigation
[Phase 1] ADR: pull-request-limits mechanism + policy decision #506
Copy link
Copy link
Closed
Labels
Description
Story
As a platform maintainer,
I want a decision record that pins down exactly how GitHub's pull request limits work and the policy we will adopt,
so that the implementation stories encode the right mechanism without guessing the API or baking in unconfirmed numbers.
Acceptance Criteria
- A decision doc is added under docs/ (alongside the existing docs/initiatives/*.md analyses) that identifies the exact surface GitHub exposes for pull request limits - repository setting vs. organization setting vs. repository ruleset rule - with a citation to GitHub's official docs/announcement.
- The doc records the precise programmatic mechanism (the REST/GraphQL endpoint or settings/ruleset field needed to set the limit), OR explicitly records, with evidence, that the feature is UI-only with no API.
- The doc enumerates the automation PR sources this targets (Dependabot, auto-rebase fan-out, dev-lead, initiative-driver), a measured baseline of current open automation-PR volume, and proposes candidate limit value(s) and an exempt-actor list - explicitly marked as proposals pending human sign-off, not final.
- The doc states how the chosen mechanism maps onto this repo's existing settings-application pattern (scripts/apply-repo-settings.sh and/or .github/rulesets/) and names the unambiguous integration point for Story 2, including how the new limit reconciles with the existing Dependabot open-pull-requests-limit.
- No repository setting, ruleset, or org policy is mutated by this story - it is documentation only.
Tasks / Subtasks
- Research GitHub's pull request limits feature: locate the official docs + announcement and determine whether it is a repo setting, org setting, or ruleset rule, and whether it has a REST/GraphQL API or is UI-only. (AC: Addressing PR comments #1, Add multi-agent isolation strategy using git worktrees #2)
- Inventory the org's automation PR sources and quantify current open, non-draft PR volume per source as the baseline the limit will reduce. (AC: Add coding standards & principles section to AGENTS.md #3)
- Read .github/dependabot.yml open-pull-requests-limit (existing ecosystem-scoped cap).
- Review scripts/list-prs.sh and the auto-rebase fan-out for the bot-authored PR flow.
- Draft candidate limit value(s) and an exemption list for first-party automation, clearly marked as proposals for human confirmation; record how they reconcile with the Dependabot cap so it is not double-capped. (AC: Add coding standards & principles section to AGENTS.md #3, Add workflow, environment, and orchestration guidance #4)
- Map the chosen mechanism to scripts/apply-repo-settings.sh / .github/rulesets/ and name the Story 2 integration point. (AC: Add workflow, environment, and orchestration guidance #4)
- Commit the decision doc; make no settings/ruleset/org mutations. (AC: Add stacked PR strategy and Epic-level workflow guidance #5)
Dev Notes
- This repo applies repository settings programmatically via scripts/apply-repo-settings.sh (gh api PATCH to repo settings + check-suites preferences); branch rulesets are stored as JSON under .github/rulesets/ (e.g. code-quality.json). The ADR must decide which of these two surfaces PR limits live in.
- Key gap to record: .github/rulesets/code-quality.json is checked in but NO in-repo workflow applies it, and scripts/apply-repo-settings.sh is not invoked by any workflow in this repo (verified by grep). 'Enabling' a limit therefore requires an apply path (Story 3), not just config (Story 2). The ADR must note where the org actually applies rulesets/settings today (likely the central petry-projects/.github standards repo).
- The existing Dependabot open-pull-requests-limit: 10 (.github/dependabot.yml) is the current ecosystem-scoped form of a PR limit; the new feature is broader. The ADR must reconcile the two so Dependabot is not double-capped.
- Cite GitHub's own docs for the exact API/settings field - never guess the API shape (org standard: SHAs and API surfaces are looked up, not guessed). If the feature is UI-only, the ADR must say so and Stories 2/3 adjust accordingly.
- Output is a doc only; follow the docs/initiatives/*.md style (see idea-to-initiative-pipeline.md). WebFetch of the blog was unavailable to the planner, so first-hand confirmation of the mechanism is part of this story's work.
Project Structure Notes
New doc belongs under docs/initiatives/ alongside the existing initiative analyses. No code paths are touched.
References
- scripts/apply-repo-settings.sh
- .github/rulesets/code-quality.json
- .github/dependabot.yml
- scripts/list-prs.sh
- docs/initiatives/idea-to-initiative-pipeline.md
- .github/copilot-instructions.md
Likely target surface
docs/initiatives/
Story prepared by the BMAD Scrum Master (Bob) for epic #505. Status: ready-for-dev.
Reactions are currently unavailable
Activity
don-petry commentedon Jun 21, 2026
Dev-Lead Implementation Plan
Issue: #506 — [Phase 1] ADR: pull-request-limits mechanism + policy decision
Scope
Add a documentation-only ADR that records, with first-hand citations to GitHub's official docs, exactly which surface (repo setting / org setting / ruleset rule / API / UI-only) GitHub exposes for a "max open pull requests" limit, the measured automation-PR baseline, proposed (non-final) limit values + exempt-actor list, and the unambiguous Story 2 integration point against this repo's existing settings-application pattern.
Research findings already gathered (first-hand, this session)
PATCH /repos/{owner}/{repo}): no max-open-PR-count field.open-pull-requests-limit.dev-lead/*30,dependabot/*10,claude/*4, human ~3. In.githubrepo: 10 (7 agent + 3 dependabot). Auto-rebase authors no PRs (it updates existing branches → CI-load amplifier, not a PR source).scripts/apply-repo-settings.shorscripts/apply-rulesets.sh(grep) — they are manual admin runs..github/rulesets/code-quality.jsondoes not exist in this repo; rulesets are generated programmatically byscripts/apply-rulesets.sh(build_ruleset_json).Implementation Checklist
docs/initiatives/pull-request-limits-adr.md(newdocs/initiatives/dir)apply-repo-settings.sh/apply-rulesets.sh, named Story 2 integration point, Dependabot reconciliationTests to Write
Test Command
bash .dev-lead/scripts/dev-lead-lint.shandnpx markdownlint-cli2 docs/initiatives/pull-request-limits-adr.mddon-petry commentedon Jun 21, 2026
Dev-Lead: Implementation Complete
Plan Execution
gh(AC Add coding standards & principles section to AGENTS.md #3)apply-repo-settings.sh/apply-rulesets.sh+ named Story 2 integration point + Dependabot reconciliation (AC Add workflow, environment, and orchestration guidance #4)Key findings (verified, not guessed)
PATCH /repos/{owner}/{repo}(no such field), org PR-review settings (only "who may approve", no count cap). The only native count cap is Dependabot's per-ecosystemopen-pull-requests-limit..github/rulesets/code-quality.jsondoes not exist — rulesets are generated programmatically byapply-rulesets.sh; (2) auto-rebase fan-out authors no PRs (it updates existing branches → CI-load amplifier, not a PR source).Test Results
Pure documentation — Phase 2 (test-first) skipped per the documentation exception. Verification was lint + markdownlint:
Files Changed
docs/initiatives/pull-request-limits-adr.md(new): the ADR — mechanism research with citations, automation-source inventory, measured baseline, proposed (non-final) limits + exempt list, settings-pattern mapping with the named Story 2 integration point, and Dependabot reconciliation.Notes
git statusshows only the newdocs/file.feat: implement issue #506 — [Phase 1] ADR: pull-request-limits mecha…