-
Notifications
You must be signed in to change notification settings - Fork 2.1k
App Configuration: recurring time window filter #40093
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
Merged
ivywei0125
merged 70 commits into
Azure:feature/spring-boot-3
from
ivywei0125:yuwe/recurring-time-window-filter
Jun 28, 2024
Merged
App Configuration: recurring time window filter #40093
ivywei0125
merged 70 commits into
Azure:feature/spring-boot-3
from
ivywei0125:yuwe/recurring-time-window-filter
Jun 28, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… to time window settings
API change check APIView has identified API level changes in this PR and created following API reviews. |
mrm9084
requested changes
May 10, 2024
...pring/cloud/feature/management/implementation/timewindow/recurrence/RecurrenceValidator.java
Outdated
Show resolved
Hide resolved
...pring/cloud/feature/management/implementation/timewindow/recurrence/RecurrenceValidator.java
Outdated
Show resolved
Hide resolved
...pring/cloud/feature/management/implementation/timewindow/recurrence/RecurrenceValidator.java
Outdated
Show resolved
Hide resolved
...pring/cloud/feature/management/implementation/timewindow/recurrence/RecurrenceValidator.java
Outdated
Show resolved
Hide resolved
...pring/cloud/feature/management/implementation/timewindow/recurrence/RecurrenceValidator.java
Outdated
Show resolved
Hide resolved
mrm9084
requested changes
May 13, 2024
...in/java/com/azure/spring/cloud/feature/management/implementation/models/RecurrenceRange.java
Outdated
Show resolved
Hide resolved
.../java/com/azure/spring/cloud/feature/management/implementation/models/RecurrencePattern.java
Outdated
Show resolved
Hide resolved
...pring/cloud/feature/management/implementation/timewindow/recurrence/RecurrenceValidator.java
Show resolved
Hide resolved
mrm9084
requested changes
Jun 3, 2024
...rc/main/java/com/azure/spring/cloud/feature/management/implementation/models/Recurrence.java
Show resolved
Hide resolved
...in/java/com/azure/spring/cloud/feature/management/implementation/models/RecurrenceRange.java
Outdated
Show resolved
Hide resolved
...in/java/com/azure/spring/cloud/feature/management/implementation/models/RecurrenceRange.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Matthew Metcalf <mrm9084@gmail.com>
Co-authored-by: Matthew Metcalf <mrm9084@gmail.com>
…/com/azure/spring/cloud/feature/management/filters/TimeWindowFilter.java Co-authored-by: Matthew Metcalf <mrm9084@gmail.com>
…m/ivywei0125/azure-sdk-for-java into yuwe/recurring-time-window-filter
mrm9084
requested changes
Jun 5, 2024
...gement/src/main/java/com/azure/spring/cloud/feature/management/filters/TimeWindowFilter.java
Show resolved
Hide resolved
…ead of catching the exception
mrm9084
approved these changes
Jun 27, 2024
feature-v: | ||
enabled-for: | ||
- | ||
name: TimeWindowFilter |
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.
Can we change all of these TimeWindowFilter
filters to Microsoft.TimeWindow
, that is the name when creating through the portal.
Netyyyy
pushed a commit
to Netyyyy/azure-sdk-for-java
that referenced
this pull request
Jun 28, 2024
* add base class: recurrence range, recurrence pattern * add object mapper in time window filter for parsing the config string to time window settings * implement the logic about recurrence evaluator * add validations * add test case for validator * add test case for evaluator * add more test case * add more test case * add calculateClosestStart method to calculate the closest occurrence * rename function * add cache logic * update README.md * update cache service * ci * ci * move to parent path to make the package name shorter * update copy right * address comments: update README.md * address comment: update the parameter to keep consistent * address comment: update the sescription to be clearer * address comment: update logic * address comment: rename symbol to make easier understanding * address comment: extract common function to a util class * address comment: rename symbol to make easier understanding * address comment: simplify code * address comment: move to models folder * revert cache logic * address comment: make the functions of RecurrenceEvaluator as static functions * address comment: move the validations to each property file * add test case in FeatureManagerTest * address comment: simplify code * address comment: throw exceptions directly * address comment: move the related logic to the function to improve the readability * address comment: make as static method * address comment: extract variables to avoid multi caller * address comment: remove `convertToWeekDayNumber` method, no need any more * address comment: simplify code * address comment: remove unused code * address comment: rename symbol * address comment: add invalid settings check. Start and End must both non-null when Recurrence is not null * address comment: code style * address comment: add more test cases * address comment: removed unused method * address comment: update symbols * address comment: adjust spaces * address comment: add more test case * address comment: update the README.md * address comment: code style * address comment: typo error fix * address comment: typo error fix * address comment: update README.md * address comment: update README.md * Update sdk/spring/spring-cloud-azure-feature-management/README.md Co-authored-by: Matthew Metcalf <mrm9084@gmail.com> * Update sdk/spring/spring-cloud-azure-feature-management/README.md Co-authored-by: Matthew Metcalf <mrm9084@gmail.com> * address comment: fix error in yaml example * address comment: update README.md * Update sdk/spring/spring-cloud-azure-feature-management/src/main/java/com/azure/spring/cloud/feature/management/filters/TimeWindowFilter.java Co-authored-by: Matthew Metcalf <mrm9084@gmail.com> * address comment: add @throws to java doc * address comment: add "ignoreUnknown" annotation * address comment: add year info to make it clearer * address comment: add test case for time with RFC format * address comment: fix build error * address comment: update the test case. Should use `assertThrows` instead of catching the exception * address comment: update the error message to make it clearer * update README file * log error and then throw exception * address comment: update to support handler lower camel case * address comment: update code style * address comment: update to use "Microsoft.TimeWindow" --------- Co-authored-by: Matthew Metcalf <mrm9084@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add "Recurrence" parameter for TimeWindowFilter using Outlook-style schema:
https://learn.microsoft.com/en-us/graph/outlook-schedule-recurring-events#using-patterns-and-ranges-to-create-recurring-events
Example:
The main logic of how to check whether current time is within any recurring time window:
Find the previous occurrence of the recurring time window, let's call it prevOccurrenceStart
Check whether the current time: time is within the time window: prevOccurrenceStart ~ prevOccurrenceStart + End - Start