Skip to content

Add author-wide repair PR intake - #314

Closed
Jhacarreiro wants to merge 1 commit into
openclaw:mainfrom
Jhacarreiro:feat/pr-intake-author-wide
Closed

Jhacarreiro wants to merge 1 commit into
openclaw:mainfrom
Jhacarreiro:feat/pr-intake-author-wide

Conversation

@Jhacarreiro

@Jhacarreiro Jhacarreiro commented Jun 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds an author-wide mode to repair PR intake:

corepack pnpm run repair:pr-intake -- --author <login> --all-open

The existing repo-scoped mode remains unchanged:

corepack pnpm run repair:pr-intake -- --repo owner/name --author <login>

Why

The current repair intake can only scan one repository at a time. That is the wrong primitive for a maintainer workflow where the useful question is:

Which open PRs authored by this user currently need repair, across GitHub?

This PR makes author usable as the discovery axis. It asks GitHub for open PRs by author, groups the result by repository, and then reuses the existing repo-scoped intake logic for each discovered repository.

Behaviour

In --all-open mode the command:

  1. runs gh search prs --author <login> --state open;
  2. extracts each result's repository.nameWithOwner;
  3. deduplicates repositories;
  4. runs the existing PR intake for each repository with the same author and limit;
  5. writes jobs under <out-dir>/<repo-slug>/inbox/;
  6. returns a single aggregate JSON summary with searched, repos_scanned, scanned, candidates, jobs, and per-repository summaries.

It does not use target_inventory, repository owners, repository dispatch, or GitHub Actions.

Safety model

This mode only discovers and evaluates open PRs authored by the requested login. It does not broaden intake to issues, closed PRs, merged PRs, branches, or repository-owner sweeps.

The generated jobs keep the existing repair-intake guardrails: no merge, no close, human required for merge, and repair-only intent.

Validation

corepack pnpm run build:repair
node --test test/repair/pr-repair-intake.test.ts

Real dry-run against the current token/user:

node dist/repair/pr-repair-intake.js \
  --author Jhacarreiro \
  --all-open \
  --limit 100 \
  --no-comments \
  --dry-run \
  --out-dir jobs/runs/author-wide-dry-run-20260617B

Observed summary:

searched=12
repos_scanned=6
scanned=12
candidates=6
jobs=6

@Jhacarreiro
Jhacarreiro force-pushed the feat/pr-intake-author-wide branch from 430e5bd to b8c518a Compare June 17, 2026 19:41
@Jhacarreiro Jhacarreiro changed the title Add author-wide PR repair intake Add author-wide repair PR intake Jun 17, 2026
@steipete

Copy link
Copy Markdown
Contributor

Landed the reviewed rewrite in #335 via commit 59e2d44.

The final version preserves author-wide intake while restricting discovery to configured public repositories, failing closed on unverifiable metadata, and avoiding persistence of excluded repository names. The original fork is not writable by the maintainer token, so I recreated the final tree as one maintainer commit with João's co-author credit. Thank you for the feature and live dry-run proof.

@steipete steipete closed this Jun 19, 2026
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