-
Notifications
You must be signed in to change notification settings - Fork 144
ci: reduce office-hours reminder spam by posting only on most recent PR per user #1150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: reduce office-hours reminder spam by posting only on most recent PR per user #1150
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThe office-hours GitHub Actions workflow now selects and processes only the most recent open PR per author by using a richer PR_DATA payload and a jq pipeline that groups PRs by author, sorts by creation time, and extracts the latest PR per user before posting reminders. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR reduces notification spam from the office-hours reminder bot by ensuring each user receives only one reminder on their most recent open pull request, rather than posting to all of their open PRs.
Key Changes:
- Modified the workflow to fetch PR metadata (number, author, createdAt) and use jq to group by author and select the most recent PR per user
- Updated CHANGELOG.md to document this enhancement
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/bot-office-hours.yml |
Implements intelligent PR filtering using jq to group PRs by author and select only the most recent one per user for notification |
CHANGELOG.md |
Documents the spam reduction improvement in the Changed section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
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 details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/bot-office-hours.yml(2 hunks)CHANGELOG.md(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Agent
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: StepSecurity Harden-Runner
🔇 Additional comments (3)
CHANGELOG.md (1)
56-56: LGTM!The changelog entry accurately describes the change and correctly references the linked issue #1121.
.github/workflows/bot-office-hours.yml (2)
62-63: LGTM!The
jqpipeline correctly groups PRs by author, sorts each group by creation time descending, and extracts the most recent PR number per user. ISO 8601 date strings sort lexicographically as expected.
65-72: LGTM!The comment deduplication logic is preserved correctly. The
grep -Fwith|| trueproperly handles both the presence and absence of prior notifications.
…PR per user Signed-off-by: Tianyang Ren <[email protected]>
f4b6abe to
00c4349
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1150 +/- ##
=======================================
Coverage 91.11% 91.11%
=======================================
Files 139 139
Lines 8451 8451
=======================================
Hits 7700 7700
Misses 751 751 🚀 New features to boost your workflow:
|
|
Thank you @TianyangRen for this excellent improvement! |
…PR per user (hiero-ledger#1150) Signed-off-by: Tianyang Ren <[email protected]> Signed-off-by: prajeeta pal <[email protected]>
Description
Reduces spam from office-hours reminders by ensuring each user receives only one notification on their most recent open pull request, even if they have multiple PRs open.
Problem
Currently, the office-hours bot posts reminders on all open PRs. When users have multiple PRs open, this creates unnecessary spam and redundant notifications.
Solution
Modified
.github/workflows/bot-office-hours.ymlto intelligently filter PRs by author and only notify on the most recent one per user.Implementation Details
The workflow now:
Retrieves all open PRs with metadata
gh pr list --json number,author,createdAtto fetch PR data including author and timestampsGroups and sorts by author
jqto group PRs byauthor.logincreatedAtin descending order (newest first)Selects only the most recent PR per user
group_by(.author.login) | .[] | sort_by(.createdAt) | reverse | .[0]Changes
.github/workflows/bot-office-hours.ymlCHANGELOG.mdTesting
The changes can be tested by:
workflow_dispatchRelated Issue
Closes #1121
Checklist
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.