[G3] config precedence probe - #37
Conversation
📝 WalkthroughWalkthroughThe pull request configures automatic reviews for selected branches and adds the public ChangesReview configuration
Marker lookup helper
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 77af68e2-e9e8-4a24-8a91-8a450d16e84c
📒 Files selected for processing (2)
.coderabbit.yamlamber/src/main/python/core/util/base_protocols.py
| for i in range(len(entries) + 1): | ||
| if entries[i] == marker: |
There was a problem hiding this comment.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Fix the off-by-one loop bound before merge.
When marker is absent, the loop reaches i == len(entries). Line 65 then raises IndexError instead of returning the documented -1. An empty entries value fails in the same way.
Proposed fix
- for i in range(len(entries) + 1):
- if entries[i] == marker:
+ for i, entry in enumerate(entries):
+ if entry == marker:
return i📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| for i in range(len(entries) + 1): | |
| if entries[i] == marker: | |
| for i, entry in enumerate(entries): | |
| if entry == marker: | |
| return i |
Tests whether a repo-level .coderabbit.yaml overrides Organization UI settings. The config sets enable_prompt_for_ai_agents: false, and is present on BOTH the base branch and this head. Contains a deliberate off-by-one. Do not merge.
Summary by CodeRabbit
Chores
Refactor
User Impact