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

オープン
#29 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
半日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
bash, github, json
領域
devtools

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Shell
スター
8
フォーク
2
平均マージ
2日 18時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rossoctl/repoman のほかの issue

rossoctl/repoman の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。