Skip to content

Approve/merge enumerate the session's PRs by feature branch; gitignore inventory snapshots - #82

Merged
silug merged 1 commit into
simp:mainfrom
silug:pr-enumeration
Aug 10, 2026
Merged

Approve/merge enumerate the session's PRs by feature branch; gitignore inventory snapshots#82
silug merged 1 commit into
simp:mainfrom
silug:pr-enumeration

Conversation

@silug

@silug silug commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Combined change per the workflow discussion: make the harvest plans self-contained, and demote the dynamic-inventory snapshot to an informational artifact.

Approve/merge: the PRs are the ground truth

puppetsync::approve_github_prs and ::merge_github_prs no longer consume a repo inventory. They enumerate the session's open PRs directly from the GitHub API — search by org + head branch (git.feature_branch) + author (github.pr_user), then hydrate each PR's base ref — via the new list_github_prs task and repo_targets_from_prs function (each target's branch comes from its PR's base, not from any list).

Why this beats any inventory:

  • Exact alignment with reality: a repo that failed before the PR stage has no PR (a snapshot would include it → approval noise); a repo added to the org after the sync has no PR (regenerating inventory at harvest time would include it → failure noise).
  • Zero handoff state: any approver, any machine, any time — the session config alone suffices. This makes the bare bolt plan run puppetsync::approve_github_prs invocation (config via the latest symlink) fully self-contained, which is exactly the shape scheduled runs (Scheduled org-wide puppetsync runs (continuous baseline enforcement) #56) need.
  • github.org is a new optional config key (default simp).

Live-verified against the real session: list_github_prs enumerated exactly the 71 open PRs from the 20260731-release-rpms-ghcr run — the two unchanged repos correctly absent, all base refs hydrated.

Snapshot demoted to informational

data/sync/repolists/generated-*.yaml is now gitignored; the sync's completion message, github-org.yaml, and the README no longer direct operators to hand it to approve/merge. (The generated-latest.yaml naming from symlink-driven runs made it a poor artifact of record anyway.) repos_config remains a parameter on both plans for CLI compatibility, documented as deprecated/unused.

Testing

  • BoltSpec approve/merge suites rewritten for the new flow: enumeration params asserted (org/branch/author), per-PR task params including base-ref propagation, failure summarization, no-open-PRs fail-fast, and stage-list opt-out. 17 plan examples, 0 failures.
  • New list_github_prs subprocess spec (injection-based, matching the list_github_repos pattern); 199 plain examples, 0 failures; idempotency e2e green.
  • puppet parser validate --tasks, bolt plan show for both plans, and the stage-list dry run all green.

Suggested test-for-real

Merge this, rebase #80 on top, then harvest the live session with the new flow: bolt plan run puppetsync::approve_github_prs / ::merge_github_prs with no repolist argument at all.

🤖 Generated with Claude Code

…onal

The approve/merge plans no longer consume a repo inventory: they
enumerate the session's open PRs directly from the GitHub API by
git.feature_branch (+ pr_user as author) via the new list_github_prs
task, building targets from the results (each repo's branch = its PR's
base ref, via the new repo_targets_from_prs function).

The PRs are the ground truth for the harvest, so this is strictly more
accurate than any inventory: repos that failed before the PR stage
aren't approached, repos that joined/left the org between sync and
harvest can't drift in, and no snapshot handoff state is needed — any
approver on any machine needs only the session config. That also makes
the no-arguments invocation (config/repolist via the latest symlinks)
fully self-contained for scheduled runs (simp#56).

Consequently the dynamic-inventory snapshot (generated-*.yaml) is now
informational: gitignored, and the sync's message no longer tells
operators to hand it to approve/merge. repos_config remains a plan
parameter for CLI compatibility but is deprecated/unused in these two
plans.

Verified against the live session: list_github_prs enumerated exactly
the 71 open PRs from the 20260731-release-rpms-ghcr run (the unchanged
repos correctly absent, all base refs hydrated). BoltSpec approve/merge
suites rewritten for the new flow (+ no-open-PRs fail-fast specs);
17 plan examples and 199 plain examples green, e2e green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@silug
silug merged commit 9af55e1 into simp:main Aug 10, 2026
2 checks passed
@silug
silug deleted the pr-enumeration branch August 10, 2026 17:55
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.

2 participants