fix: handle CI workflow skip by path filters - #275
Conversation
## Problem When PRs contain only documentation changes (e.g., `.md` files), the CI workflow is not triggered due to path filters. This causes check-ci-status to wait indefinitely for Quality Gate, eventually timing out after 15 minutes. ### Example: PR #274 - Changes: `.claude/devcontainer-recommendations.md` - CI workflow: Not triggered (path filters exclude `.md`) - check-ci-status: Waits for Quality Gate that never appears - Result: Times out after 900s, claude-review never runs ## Solution Added logic to detect when CI is skipped by path filters: ### Detection Logic 1. After 2 minutes (120s) of waiting 2. If Quality Gate hasn't appeared 3. Check if Detect Changes job exists 4. If both are missing → CI skipped by path filters 5. Set `ci_passed=true` to allow claude-review to proceed ### Behavior **Code changes** (CI runs): - Waits for Quality Gate completion - Validates all checks passed - Runs claude-review after CI success **Documentation-only changes** (CI skipped): - Detects no CI after 2 minutes - Allows claude-review to proceed immediately - No unnecessary 15-minute wait ### Status Messages - ✅ CI workflow skipped by path filters (no code changes detected) - Claude Code Review will proceed without waiting for CI ## Impact - PR #274 and similar doc-only PRs will get claude-review - No more 15-minute timeouts for non-code changes - Maintains CI validation for code changes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Warning Rate limit exceeded@keito4 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 41 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:30:34: Double quote to prevent globbing and word splitting [shellcheck]
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:54:31: Double quote to prevent globbing and word splitting [shellcheck]
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:64:31: Double quote to prevent globbing and word splitting [shellcheck]
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:72:28: Double quote to prevent globbing and word splitting [shellcheck]
There was a problem hiding this comment.
📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:78:27: Double quote to prevent globbing and word splitting [shellcheck]
Code Review - PR #275概要ドキュメント専用PRでCI workflowがpath filtersによってスキップされる場合に、不要な15分のタイムアウトを防ぐための改善です。良い問題の特定と適切な解決策です。 ✅ 良い点
🔍 潜在的な問題1. Critical: シェルスクリプトのロジックエラー
|
| 項目 | 評価 |
|---|---|
| 問題の特定 | ⭐⭐⭐⭐⭐ |
| 解決策の妥当性 | ⭐⭐⭐⭐ |
| コード品質 | ⭐⭐⭐ |
| テストカバレッジ | ⭐⭐ |
総合: ⭐⭐⭐⭐ (4/5)
📝 推奨アクション
必須
- シェルスクリプトのロジック改善 - else節を追加
- jqクエリの堅牢化 - slurp modeを使用
推奨
- 待機時間の調整検討
- テストの追加
詳細なレビューコメントは別途提供します。
レビュー実施: Claude Sonnet 4.5
詳細レビュー - 技術的な改善提案1. シェルスクリプトのロジック改善現在の実装では、Detect Changesが存在する場合の処理が明示されていません。 推奨: else節を追加して、異常状態を検出・警告する 2. jqクエリの堅牢化現在のjq selectは最初のマッチのみ返します。複数の同名check runs対応のため、slurp mode使用を推奨: jq -s 'map(select(.name == "Quality Gate")) | .[-1] // empty' 3. CI queue遅延への対応2分待機でも稀にCI未開始の可能性があります。Workflow runs APIで直接確認する方法を追加検討。 4. テストカバレッジCLAUDE.mdでは70%+カバレッジが要求されています。test-act.ymlでの統合テスト追加を推奨。 5. セキュリティ・パフォーマンス✅ セキュリティ: 問題なし まとめ良い改善ですが、特に1と2の修正を適用することで、より堅牢な実装になります。 |
コード修正例推奨修正1: else節の追加現在のコード(58-68行目)に以下のelse節を追加することで、Detect Changesが存在するのにQuality Gateが来ない異常状態を検出できます。 推奨修正2: jqクエリの改善56行目と61行目のjqコマンドを変更: Before:
After:
メリット:
その他の推奨事項テストの追加:
モニタリング:
これらの修正により、エッジケースでの動作が大幅に改善されます。 |
レビューサマリーPR #275のレビューを完了しました。 総合評価: ⭐⭐⭐⭐ (4/5)良い点:
改善推奨:
次のステップ上記のCritical項目(1と2)の修正を適用することを強く推奨します。これらは小さな変更ですが、エッジケースでの堅牢性が大幅に向上します。 修正後、このPRはマージ可能な状態になると考えます。 詳細は上記のコメントを参照してください。質問があればお気軽にどうぞ。 レビュー実施: Claude Sonnet 4.5 @ 2025-01-02 |
Summary
claude-code-review workflow now properly handles cases where CI is skipped by path filters, preventing unnecessary 15-minute timeouts for documentation-only PRs.
Problem
PR #274 revealed a critical issue:
.claude/devcontainer-recommendations.md.mdfilesSolution
Added intelligent detection for path filter skips:
Detection Logic
After 2 minutes (120s) of waiting:
ci_passed=trueto allow review to proceedBehavior Matrix
Status Messages
CI Running:
CI Skipped by Path Filters:
Type of Change
Impact
Before
After
Testing
This PR will test the detection logic:
Expected for PR #274:
Related Issues
Fixes the timeout issue discovered in #274
🤖 Generated with Claude Code