Skip to content

feat(config): allow weekday ranges to wrap around the end of the week - #5579

Open
TheMeier wants to merge 1 commit into
prometheus:mainfrom
TheMeier:issues/3213
Open

TheMeier wants to merge 1 commit into
prometheus:mainfrom
TheMeier:issues/3213

Conversation

@TheMeier

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Please check all the applicable boxes.

Which user-facing changes does this PR introduce?

[ENHANCEMENT] CONFIG: allow weekday ranges to wrap around the end of the week

@TheMeier
TheMeier requested a review from a team as a code owner September 20, 2026 08:59
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

⚙️ Run configuration

Configuration used: Repository: prometheus/alertmanager/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 24d0267c-22a1-4531-a3dd-eaaba46bd2ea

📥 Commits

Reviewing files that changed from the base of the PR and between 6090520 and 8733d5e.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: prometheus/alertmanager/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 71472891-53d6-4995-a295-09edafa0afae

📥 Commits

Reviewing files that changed from the base of the PR and between 8ff4dea and 6090520.

📒 Files selected for processing (1)
  • timeinterval/timeinterval_test.go

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

Weekday ranges now support wraparound values such as friday:monday. Parsing accepts these ranges, matching includes both sides of the week boundary, and documentation and tests cover the behavior.

Changes

Weekday range wraparound

Layer / File(s) Summary
Parse and match wrapped weekday ranges
timeinterval/timeinterval.go, docs/configuration.md
WeekdayRange permits ranges where Begin exceeds End. ContainsTime matches weekdays across the week boundary. The documentation describes this syntax.
Validate wrapped range behavior
timeinterval/timeinterval_test.go
Tests cover wrapped, unsorted, and single-day weekday ranges, including contained and excluded weekdays.

Priority: ⬇️ Low

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

Severity of issue fixed: Low

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the configuration enhancement and accurately describes support for weekday ranges that wrap around the end of the week.
Description check ✅ Passed The description includes the issue reference, confirms feature tests and documentation updates, records sign-off and contribution commitments, and provides a valid release note.
Linked Issues check ✅ Passed The changes satisfy the coding requirements in #3213. WeekdayRange accepts Begin > End, and ContainsTime evaluates ranges that cross the week boundary. Tests cover friday:monday, `saturday:mon…
Out of Scope Changes check ✅ Passed The changes remain within #3213. The implementation, tests, and documentation directly support weekday ranges that wrap around the end of the week. No unrelated changes are identified.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

❤️ Share

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

@SoloJacobs SoloJacobs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like it! Technically a new feature, so it should be signed off in a meeting, or at least approved in our slack channel. We can also consider removing the first day of the week from the docs, since it is no longer relevant.

Fixes prometheus#3213

Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
@TheMeier
TheMeier force-pushed the issues/3213 branch 2 times, most recently from 6090520 to 8733d5e Compare September 21, 2026 13:55
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.

Document first day of week for time intervals

2 participants