Skip to content

[G3] config precedence probe - #37

Open
sshiv012 wants to merge 2 commits into
coderabbit-eval/basefrom
g3-config-test
Open

[G3] config precedence probe#37
sshiv012 wants to merge 2 commits into
coderabbit-eval/basefrom
g3-config-test

Conversation

@sshiv012

@sshiv012 sshiv012 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

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

    • Updated automated review configuration for improved consistency across supported branches.
  • Refactor

    • Added internal utility support for locating markers in sequences.
  • User Impact

    • No visible changes to the product experience.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request configures automatic reviews for selected branches and adds the public locate_marker helper. The helper returns the marker index or -1, but can raise IndexError when the marker is absent.

Changes

Review configuration

Layer / File(s) Summary
Automatic review branch configuration
.coderabbit.yaml
Automatic reviews now target main, coderabbit-eval/base, and branches matching replay/.*. Prompt disabling remains enabled.

Marker lookup helper

Layer / File(s) Summary
Marker lookup implementation
amber/src/main/python/core/util/base_protocols.py
Adds public locate_marker(entries, marker), which returns the marker index or -1. The loop can access beyond the end of entries when the marker is absent.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the pull request as a configuration precedence probe, which matches the stated objective and main changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch g3-config-test

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e99b91c and bf1db35.

📒 Files selected for processing (2)
  • .coderabbit.yaml
  • amber/src/main/python/core/util/base_protocols.py

Comment on lines +64 to +65
for i in range(len(entries) + 1):
if entries[i] == marker:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Suggested change
for i in range(len(entries) + 1):
if entries[i] == marker:
for i, entry in enumerate(entries):
if entry == marker:
return i

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant