MM-70112: Add business-days option for PR review SLA due dates - #1046
Conversation
Allow admins to count the review target in Mon–Fri business days so short SLAs requested on Friday are not overdue by Monday. Overdue age and digest buckets remain calendar days; calendar mode stays the default.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe plugin adds a configurable review SLA day type. It supports calendar days and Monday–Friday business days. The setting flows through server calculations, digest messages, client state, sidebar controls, and SLA badges. ChangesSLA day type support
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Configuration
participant getSidebarData
participant SidebarButtons
participant GithubItems
participant getReviewSLAStatus
Configuration->>getSidebarData: provide review_target_day_type
getSidebarData->>SidebarButtons: expose reviewTargetDayType
getSidebarData->>GithubItems: expose reviewTargetDayType
SidebarButtons->>getReviewSLAStatus: evaluate overdue reviews with day type
GithubItems->>getReviewSLAStatus: calculate badge status with day type
getReviewSLAStatus-->>SidebarButtons: return SLA status
getReviewSLAStatus-->>GithubItems: return SLA status
Poem
🚥 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
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@server/plugin/sla_digest.go`:
- Line 90: Use a single normalized day-type snapshot throughout the SLA digest
flow: compute it before scanning, pass it into collectAllOverdueSLAItems, and
reuse that same value when buildSLADigestMessage constructs the header instead
of rereading cfg via reviewTargetDayType().
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 620e1862-c362-4ea1-a9e1-6fa05c705e60
📒 Files selected for processing (18)
plugin.jsonserver/plugin/configuration.goserver/plugin/plugin.goserver/plugin/sla_digest.goserver/plugin/sla_digest_test.goserver/plugin/utils.goserver/plugin/utils_test.gowebapp/src/components/sidebar_buttons/index.jswebapp/src/components/sidebar_buttons/sidebar_buttons.jsxwebapp/src/components/sidebar_buttons/sidebar_buttons.test.jsxwebapp/src/components/sidebar_right/github_items.tsxwebapp/src/components/sidebar_right/index.jsxwebapp/src/components/sidebar_right/sidebar_right.jsxwebapp/src/reducers/index.tswebapp/src/selectors.tswebapp/src/types/github_types.tswebapp/src/utils/sla.test.tswebapp/src/utils/sla.ts
Reuse one config snapshot so overdue evaluation and the digest header cannot diverge if settings change mid-scan.
avasconcelos114
left a comment
There was a problem hiding this comment.
LGTM! Nice to see this being included 😄
Summary
Adds a System Console setting for PR review SLA day type: Calendar days (default, existing behavior) or Business days (Mon-Fri). Business mode only changes how the due date is computed from "PR review target (days)"; overdue age and digest buckets stay calendar days.
QA:
2and day type to Calendar days. Request a review Friday > Monday shows overdue./github todo, RHS badges, and overdue digest stay consistent with the selected mode.Ticket Link
https://mattermost.atlassian.net/browse/MM-70112
Screenshots
N/A
Release Note
Change Impact: 🟡 Medium
Reasoning: The change spans configuration, shared SLA utilities, frontend selectors, badges, todo views, and digests. Existing behavior remains unchanged by default, with tests covering key calendar and business-day paths.
Regression Risk: Medium. Shared SLA utilities and user-facing review status flows changed. Weekend boundaries, configuration propagation, and consistent configuration snapshots require validation.
QA Recommendation: Perform focused manual QA for calendar and business-day settings across
/github todo, RHS badges, and overdue digests. Skipping manual QA carries moderate risk.Generated by CodeRabbitAI