t1419: switch contribution-watch scan to notifications with managed repo filtering#4298
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
⌛ 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. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe changes refactor contribution-watch from a polling-based approach to a GitHub Notifications API-driven architecture, add filtering to exclude managed repos (marked with Changes
Sequence DiagramsequenceDiagram
participant Scan as Scan Process
participant GH as GitHub API
participant State as State DB
participant Filter as Repo Filter
Note over Scan,Filter: Old Flow (Polling)
loop For each tracked item
Scan->>GH: Fetch issue/PR metadata
GH-->>Scan: Full item details
Scan->>State: Update state
end
Note over Scan,Filter: New Flow (Notifications)
Scan->>GH: Fetch notifications (participating=true)
GH-->>Scan: Notification payloads
Scan->>Filter: Get managed repos (pulse: true)
Filter-->>Scan: Excluded repo list
loop For each notification
Scan->>Filter: Is managed repo?
Filter-->>Scan: Yes/No
alt Not managed & valid signal
Scan->>Scan: Extract item_key, type, title, timestamp
Scan->>State: Upsert normalized entry
State-->>Scan: State updated
end
end
Scan->>Scan: Aggregate counts & report summary
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Thu Mar 12 23:32:01 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.agents/scripts/contribution-watch-helper.sh (2)
65-67:SIGNAL_REASONSconstant is defined but never used.The constant on line 67 duplicates the pattern hardcoded in
_is_signal_reason()at line 228. Either use the constant in the function or remove it to avoid drift.♻️ Proposed fix — use the constant in the predicate
_is_signal_reason() { local reason="$1" if [[ -z "$reason" ]]; then return 1 fi - if [[ "$reason" =~ ^(author|comment|mention|review_requested|subscribed)$ ]]; then + if [[ "$reason" =~ ^(${SIGNAL_REASONS})$ ]]; then return 0 fi return 1 }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.agents/scripts/contribution-watch-helper.sh around lines 65 - 67, The SIGNAL_REASONS regex constant is declared but not used; update the _is_signal_reason() function to reference the SIGNAL_REASONS variable instead of the duplicated hardcoded pattern (or remove the constant if you prefer to keep the inline pattern), ensuring the function uses SIGNAL_REASONS for its regex match so the two definitions don't drift apart; target the SIGNAL_REASONS symbol and the _is_signal_reason function when making the change.
546-548: Consider clarifying the date comparison logic.The expression
! "$updated" > "$last_notified"relies on bash's string comparison and negation precedence. While correct for ISO 8601 dates, the intent ("skip if already notified") is subtle.✨ Optional: make intent explicit
- if [[ -n "$last_notified" && ! "$updated" > "$last_notified" ]]; then + # Skip if we've already notified about this update or a newer one + if [[ -n "$last_notified" ]] && [[ ! "$updated" > "$last_notified" ]]; then continue fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.agents/scripts/contribution-watch-helper.sh around lines 546 - 548, The conditional using last_notified and updated is relying on negation precedence and is hard to read; change the test to explicitly group the negation (e.g., use [[ -n "$last_notified" && ! ( "$updated" > "$last_notified" ) ]] ) so it's clear you're skipping when updated is not greater than last_notified, and add a short comment that this relies on ISO‑8601 lexicographic ordering; reference the variables last_notified and updated and the existing conditional to locate where to change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.agents/scripts/contribution-watch-helper.sh:
- Around line 65-67: The SIGNAL_REASONS regex constant is declared but not used;
update the _is_signal_reason() function to reference the SIGNAL_REASONS variable
instead of the duplicated hardcoded pattern (or remove the constant if you
prefer to keep the inline pattern), ensuring the function uses SIGNAL_REASONS
for its regex match so the two definitions don't drift apart; target the
SIGNAL_REASONS symbol and the _is_signal_reason function when making the change.
- Around line 546-548: The conditional using last_notified and updated is
relying on negation precedence and is hard to read; change the test to
explicitly group the negation (e.g., use [[ -n "$last_notified" && ! (
"$updated" > "$last_notified" ) ]] ) so it's clear you're skipping when updated
is not greater than last_notified, and add a short comment that this relies on
ISO‑8601 lexicographic ordering; reference the variables last_notified and
updated and the existing conditional to locate where to change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ee04d64f-6c85-4e06-844c-e2429fc9960f
📒 Files selected for processing (2)
.agents/AGENTS.md.agents/scripts/contribution-watch-helper.sh
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Thu Mar 12 23:38:06 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
|
Linked issue: #4297 (closed by merge). |



Summary
Verification
Closes #4297
Summary by CodeRabbit
Documentation
Refactor