Skip to content

Conversation

@linglingye001
Copy link
Contributor

No description provided.

@linglingye001 linglingye001 marked this pull request as ready for review November 4, 2025 09:14
Copy link

Copilot AI left a 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 adds recurrence functionality to the TimeWindow feature filter, allowing feature flags to be enabled/disabled based on recurring time patterns (daily or weekly). This enables scenarios like "enable feature Monday-Friday 9AM-5PM" or "enable feature every other day."

  • Adds comprehensive recurrence support with daily and weekly patterns
  • Implements validation for recurrence parameters including pattern types, intervals, and range constraints
  • Provides extensive test coverage including edge cases and timezone handling

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
featuremanagement/time_window.go Extended TimeWindowFilter to support recurrence parameters and evaluation logic
featuremanagement/recurrence_model.go Defines data models and enums for recurrence patterns, ranges, and specifications
featuremanagement/recurrence_validator.go Implements validation and parsing logic for recurrence parameters
featuremanagement/recurrence_evaluator.go Contains the core algorithm for matching current time against recurring patterns
featuremanagement/recurrence_utils.go Helper functions for day-of-week calculations and date arithmetic
featuremanagement/recurrence_test.go Unit tests for recurrence validation and evaluation logic
featuremanagement/time_window_test.go Integration tests for time window filter with recurrence patterns

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

name: "Tuesday Dec 24 (occurrence 10 - last)",
testTime: time.Date(2024, 12, 24, 18, 0, 1, 0, time.UTC),
expected: false,
reason: "Tenth occurrence would be Tuesday Dec 17, so Dec 24 is beyond 10 occurrences",
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

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

The reason text is incorrect. The test starts on Tuesday Dec 10 with weekdays (Mon-Fri) and 10 occurrences. The occurrences are: Tue Dec 10 (1), Wed Dec 11 (2), Thu Dec 12 (3), Fri Dec 13 (4), Mon Dec 16 (5), Tue Dec 17 (6), Wed Dec 18 (7), Thu Dec 19 (8), Fri Dec 20 (9), Mon Dec 23 (10). The 10th occurrence is Monday Dec 23, not Tuesday Dec 17. The reason should state 'The tenth occurrence is Monday Dec 23, so Tuesday Dec 24 is beyond 10 occurrences'.

Suggested change
reason: "Tenth occurrence would be Tuesday Dec 17, so Dec 24 is beyond 10 occurrences",
reason: "The tenth occurrence is Monday Dec 23, so Tuesday Dec 24 is beyond 10 occurrences",

Copilot uses AI. Check for mistakes.
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.

2 participants