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

Abierto
#29 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
Medio día
Aptitud para principiantes
42/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
bash, github, json
Área
devtools

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Shell
Estrellas
8
Forks
2
Merge medio
2 d 18 h
PR fusionados (30 d)
5

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rossoctl/repoman

Todos los issues de rossoctl/repoman

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.