Conversation
Co-authored-by: HappyOnigiri <nodemeld+happy-onigiri@gmail.com>
|
Cursor Agent can help with this pull request. Just |
📝 WalkthroughWalkthroughCodeRabbitのレート制限検出と自動リジューム機能を追加。設定キー Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ 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/pr_reviewer.py`:
- Around line 132-140: The block that calls subprocess.run and parses
result.stdout must not treat failures as "no comments" by returning []; instead
propagate the error so callers (which set active_rate_limit) can treat failures
safely. Change the handling around subprocess.run/result.returncode and the
json.loads JSONDecodeError: either raise a descriptive exception (e.g.,
RuntimeError) including result.stderr or the JSON error, or return a distinct
sentinel (not []) that callers can detect; update the code that calls this
function (which currently assumes [] means "no comments" and sets
active_rate_limit to None) to handle the new error/sentinel path safely. Ensure
references to subprocess.run, result.returncode, result.stderr, result.stdout,
and json.loads are updated accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2ff2247d-11ec-4f28-8163-122d45eda8e0
📒 Files selected for processing (7)
.refix.yaml.sampleREADME.ja.mdREADME.mdsrc/auto_fixer.pysrc/pr_reviewer.pytests/test_auto_fixer.pytests/test_pr_reviewer.py
結果の取得失敗やJSON解析エラー時に[]ではなくRuntimeErrorを投げるように変更し、呼び出し側(auto_fixer.py)でエラーを正しく検知・スキップできるようにした。
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 1311-1327: 現在の認証は関数 _is_coderabbit_login() が
login.startswith("coderabbitai") を使っており "coderabbitai-foo"
のような任意ユーザーも通してしまうため、レート制限判定で悪用されうるので、_is_coderabbit_login()
を厳密一致で判定するよう修正してください(受け入れる値は "coderabbitai" と "coderabbitai[bot]"
のような正確なログイン文字列に限定し、startswith を使わない)。ループ内で使われる該当関数(for comment in
issue_comments: ... if not _is_coderabbit_login(login):
continue)をそのまま使い、関数本体だけを修正して正確な比較ロジックに置き換えてください。
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a399056c-059c-4293-868d-53add9094027
📒 Files selected for processing (2)
src/auto_fixer.pysrc/pr_reviewer.py
…変更し完全一致判定に対応 startswith による判定から、完全一致のみを受け付けるロジック (`coderabbitai`, `coderabbitai[bot]`) へ修正。これに伴い定数名も PREFIX から正確な名前にリネームした。
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/auto_fixer.py (1)
1614-1623: 広範な例外キャッチは最小限に留めることを検討してください。
RuntimeErrorの後にExceptionをキャッチしていますが、これにより予期しないバグが隠れる可能性があります。ただし、ファイル内の他の箇所(例:lines 1604-1607)と一貫したパターンであり、PR 処理の継続性を確保するための防御的プログラミングとして許容範囲です。将来的には、
fetch_issue_commentsが発生させうる具体的な例外タイプを特定し、それらを明示的にキャッチすることを検討してください。🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/auto_fixer.py` around lines 1614 - 1623, The current try/except around fetch_issue_comments catches RuntimeError then a broad Exception, which can mask unexpected bugs; update the try/except in the block around fetch_issue_comments to catch only the specific exceptions that fetch_issue_comments can raise (e.g., network errors, HTTPError, JSONDecodeError or a custom FetchError) instead of Exception, keep the same error logging to stderr and set pr_fetch_failed = True/continue for those specific cases, and if unknown exceptions are still desired to be surfaced during development consider re-raising them or logging them separately so they are not silently swallowed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/auto_fixer.py`:
- Around line 1614-1623: The current try/except around fetch_issue_comments
catches RuntimeError then a broad Exception, which can mask unexpected bugs;
update the try/except in the block around fetch_issue_comments to catch only the
specific exceptions that fetch_issue_comments can raise (e.g., network errors,
HTTPError, JSONDecodeError or a custom FetchError) instead of Exception, keep
the same error logging to stderr and set pr_fetch_failed = True/continue for
those specific cases, and if unknown exceptions are still desired to be surfaced
during development consider re-raising them or logging them separately so they
are not silently swallowed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 643b92a1-ff6f-4341-9e50-5fa1decf70de
📒 Files selected for processing (1)
src/auto_fixer.py
許容範囲で将来的には対応した方が良い水準の指摘は不要です。 |
|
Tip For best results, initiate chat on the files or code changes.
✏️ Learnings added
|
Summary
refix:done) and auto-merging.@coderabbitai resumecomments after the rate limit waiting period.Related issues
https://github.com/HappyOnigiri/PixelRefiner/pull/4#issuecomment-4039292941)Changes
refix:runningstate (removesrefix:doneif present, addsrefix:running).review-fixand auto-merge processes are skipped.coderabbit_auto_resume(defaultfalse) to enable automatic@coderabbitai resumecomments.README.md,README.ja.md, and.refix.yaml.sampleto document the new feature and configuration.Testing
make testpassed (113 tests).make cipassed.pytestsuite with new test cases covering rate limit detection, automatic resume posting, and conditional skipping ofreview-fixsteps.Checklist
Summary by CodeRabbit
新機能
ドキュメント
テスト