pr-review: make the trigger label configurable (blank = no label filter)

Aperta
#29 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
Mezza giornata
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
bash, github, json
Ambito
devtools

Direzione di ricerca

The hardcoded label is LABEL="ready-for-ai-review" near line 86 of scripts/pr-review-scanner.sh, and it feeds the gh pr list --label call. Start there, then check how pr-review.json config is read and where open_labeled.jsonl eviction is computed. Done means a blank trigger_label lists all open PRs with a --limit or pagination, keeps the reviewed-SHA marker behaviour, and the change is mirrored to the vendored copy.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Problem

pr-review-scanner.sh hardcodes its trigger label:

LABEL="ready-for-ai-review"            # scripts/pr-review-scanner.sh:86
...
gh pr list --repo "$repo" --label "$LABEL" --state open \
  --json number,author,headRefOid,isDraft,reviewDecision

So a PR is only reviewed if someone remembers to add the label. In cortex that requirement is getting in the way of adoption. Also, labels_required in ~/.repoman/programs/pr-review.json only declares what the program needs. Changing it doesn't change which PRs get scanned.

Request

Make the trigger label configurable, and let it be turned off:

  • Read the label from program config (e.g. pr-review.json → trigger_label), optionally overridable per repo. Default stays ready-for-ai-review.
  • Blank value = no label filter: the scanner lists all open PRs and still applies its current filters (no drafts, no bot-authored PRs, no APPROVED PRs). The <!-- reviewed: <sha> --> marker still means each head commit is reviewed only once.

Notes

  • I checked gh pr list --label "" with gh 2.102.0: it returns the same set as omitting --label (rossoctl/cortex 9/9, rossoctl/rossoctl 10/10). This is undocumented behaviour, so add an explicit branch that drops --label when the value is blank instead of passing "".
  • The scanner doesn't pass --limit, so gh's default cap of 30 applies. Without the label filter, a busy repo would be silently cut off at 30, so add an explicit --limit (or paginate).
  • The eviction logic uses the label-filtered list (open_labeled.jsonl). With no label, eviction should key on open/closed state.
  • repoman-check / labels_required should not insist that the label exists when it's blank.
  • The scanner is vendored from rossoctl/automation (_vendor.json), so the change probably belongs there and then gets re-vendored (see #27).

Interim

A cortex workflow that auto-applies the label on opened / reopened / ready_for_review is being proposed separately.

Requested in Slack by Jim Cadden; raised by @huang195 (Hai Huang) for cortex.

Lingua principale
Shell
Stelle
8
Fork
2
Merge medio
2g 18h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rossoctl/repoman

Tutte le issue di rossoctl/repoman

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.