style(auto_fixer): refix:merged ラベルのデフォルト色を GitHub マージアイコンに合わせて紫色に変更#65
style(auto_fixer): refix:merged ラベルのデフォルト色を GitHub マージアイコンに合わせて紫色に変更#65HappyOnigiri merged 5 commits intomainfrom
Conversation
📝 WalkthroughWalkthroughプロジェクトにPyrightのプロジェクトレベル仮想環境設定を追加し、 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ❌ 3❌ Failed checks (3 warnings)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/auto_fixer.py`:
- Around line 1556-1558: The code treats failure to add the
refix:auto-merge-requested label as success; change the calls to
_edit_pr_label(repo, pr_number, add=True,
label=REFIX_AUTO_MERGE_REQUESTED_LABEL) so you check its return value and only
proceed/return True when it succeeded, otherwise return/propagate failure; apply
the same check in both places where this call appears and ensure that
_mark_pr_merged_label_if_needed() and _backfill_merged_labels() are only invoked
when the label-add returned success.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e03b5651-77df-4c67-bc4c-539bd10e58bd
📒 Files selected for processing (4)
pyrightconfig.jsonsrc/auto_fixer.pysrc/summarizer.pytests/test_auto_fixer.py
_edit_pr_label() の戻り値が無視されていた2箇所を修正し、 ラベル追加が失敗した場合は False を返すようにする。
🤖 Refix Status処理済みレビュー一覧 (System Use Only)
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/auto_fixer.py`:
- Around line 2123-2126: The current stop condition uses len(modified_prs) +
backfilled_count but backfilled_count is per-repo, so merged-label backfills
from previously processed repos aren’t counted; change the logic to track a
global backfilled total (e.g., total_backfilled_count) or add per-repo backfill
increments into the shared modified_prs count when you perform backfills, and
then use len(modified_prs) + total_backfilled_count (or the updated modified_prs
length) in the if condition that references modified_prs and backfilled_count to
enforce max_modified_prs across all repos.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f305a7f2-b18b-4700-a382-6c1e000da856
📒 Files selected for processing (1)
src/auto_fixer.py
PR が already merged の場合、ラベル追加はベストエフォートとし 結果に関わらず True を返すようにする。
…s_per_run を正確に適用 - global_backfilled_count: list[int] を main() で生成し process_repo に渡す - 各リポジトリの backfill 件数をグローバル集計に加算し、次リポジトリへの超過分を防ぐ - 初回 backfill_limit・PR ループの上限チェック・2 回目 backfill remaining の いずれも全リポジトリ合計値を参照するよう修正
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/auto_fixer.py (1)
1563-1566:⚠️ Potential issue | 🟠 Major
already merged分岐でもラベル付与失敗を成功扱いしています。Line 1565 で
_edit_pr_label()の戻り値を無視したままTrueを返しているため、refix:auto-merge-requestedの付与に失敗しても後続が成功扱いになります。その場合、_mark_pr_merged_label_if_needed()/_backfill_merged_labels()の前提が崩れ、refix:mergedを取りこぼします。ここもラベル追加が成功したときだけ成功扱いにしてください。修正案
if "already merged" in combined_lower: print(f"PR #{pr_number} is already merged.") - _edit_pr_label(repo, pr_number, add=True, label=REFIX_AUTO_MERGE_REQUESTED_LABEL) - return True + return _edit_pr_label( + repo, pr_number, add=True, label=REFIX_AUTO_MERGE_REQUESTED_LABEL + )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/auto_fixer.py` around lines 1563 - 1566, "already merged" 判定ブロックは `_edit_pr_label(repo, pr_number, add=True, label=REFIX_AUTO_MERGE_REQUESTED_LABEL)` の戻り値を無視して常に True を返しているため、ラベル付与失敗でも成功扱いになっています。`_edit_pr_label` の戻り値を受け取り、ラベル追加が成功したときのみ True を返すよう修正し(失敗時は False を返す/伝播する)、この結果に基づいて後続の `_mark_pr_merged_label_if_needed()` や `_backfill_merged_labels()` の前提が壊れないようしてください(参照: combined_lower, pr_number, REFIX_AUTO_MERGE_REQUESTED_LABEL)。
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/auto_fixer.py`:
- Around line 1563-1566: "already merged" 判定ブロックは `_edit_pr_label(repo,
pr_number, add=True, label=REFIX_AUTO_MERGE_REQUESTED_LABEL)` の戻り値を無視して常に True
を返しているため、ラベル付与失敗でも成功扱いになっています。`_edit_pr_label` の戻り値を受け取り、ラベル追加が成功したときのみ True
を返すよう修正し(失敗時は False を返す/伝播する)、この結果に基づいて後続の `_mark_pr_merged_label_if_needed()` や
`_backfill_merged_labels()` の前提が壊れないようしてください(参照: combined_lower, pr_number,
REFIX_AUTO_MERGE_REQUESTED_LABEL)。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 883e746a-a203-4cdc-9f3e-84bdcd69579c
📒 Files selected for processing (2)
src/auto_fixer.pytests/test_auto_fixer.py
🚧 Files skipped from review as they are similar to previous changes (1)
- tests/test_auto_fixer.py
概要 / Summary
refix:mergedラベルのデフォルト色を GitHub のマージアイコンに合わせて紫色に変更。CI の pyright 設定を修正。変更内容 / Changes
REFIX_MERGED_LABEL_COLORを1D76DB(青)から6F42C1(GitHub マージアイコンと同じ紫)に変更pyrightconfig.jsonにvenvPathとvenvを追加し、pyright が venv 内の pytest を解決できるようにするテスト / Testing
make ciで全チェックパス済み。関連 issues / Related issues
なし
Summary by CodeRabbit
スタイル
テスト
設定
リファクタ