You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+142-6
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ The feature management library supports appsettings.json as a feature flag sourc
80
80
"Name":"TimeWindow",
81
81
"Parameters": {
82
82
"Start":"Wed, 01 May 2019 13:59:59 GMT",
83
-
"End":"Mon, 01 July 2019 00:00:00 GMT"
83
+
"End":"Mon, 01 Jul 2019 00:00:00 GMT"
84
84
}
85
85
}
86
86
]
@@ -131,7 +131,7 @@ A `RequirementType` of `All` changes the traversal. First, if there are no filte
131
131
"Name":"TimeWindow",
132
132
"Parameters": {
133
133
"Start":"Mon, 01 May 2023 13:59:59 GMT",
134
-
"End":"Sat, 01 July 2023 00:00:00 GMT"
134
+
"End":"Sat, 01 Jul 2023 00:00:00 GMT"
135
135
}
136
136
},
137
137
{
@@ -163,7 +163,7 @@ The feature management library also supports the usage of the [`Microsoft Featur
163
163
"name":"Microsoft.TimeWindow",
164
164
"parameters": {
165
165
"Start":"Mon, 01 May 2023 13:59:59 GMT",
166
-
"End":"Sat, 01 July 2023 00:00:00 GMT"
166
+
"End":"Sat, 01 Jul 2023 00:00:00 GMT"
167
167
}
168
168
}
169
169
]
@@ -565,13 +565,149 @@ This filter provides the capability to enable a feature based on a time window.
565
565
"Name":"Microsoft.TimeWindow",
566
566
"Parameters": {
567
567
"Start":"Wed, 01 May 2019 13:59:59 GMT",
568
-
"End":"Mon, 01 July 2019 00:00:00 GMT"
568
+
"End":"Mon, 01 Jul 2019 00:00:00 GMT"
569
569
}
570
570
}
571
571
]
572
572
}
573
573
```
574
574
575
+
The time window can be configured to recur periodically. This can be useful for the scenarios where one may need to turn on a feature during a low or high traffic period of a day or certain days of a week. To expand the individual time window to recurring time windows, the recurrence rule should be specified in the `Recurrence` parameter.
576
+
577
+
**Note:**`Start` and `End` must be both specified to enable `Recurrence`.
578
+
579
+
```JavaScript
580
+
"EnhancedPipeline": {
581
+
"EnabledFor": [
582
+
{
583
+
"Name":"Microsoft.TimeWindow",
584
+
"Parameters": {
585
+
"Start":"Fri, 22 Mar 2024 20:00:00 GMT",
586
+
"End":"Sat, 23 Mar 2024 02:00:00 GMT",
587
+
"Recurrence": {
588
+
"Pattern": {
589
+
"Type":"Daily",
590
+
"Interval":1
591
+
},
592
+
"Range": {
593
+
"Type":"NoEnd"
594
+
}
595
+
}
596
+
}
597
+
}
598
+
]
599
+
}
600
+
```
601
+
602
+
The `Recurrence` settings is made up of two parts: `Pattern` (how often the time window will repeat) and `Range` (for how long the recurrence pattern will repeat).
603
+
604
+
#### Recurrence Pattern
605
+
606
+
There are two possible recurrence pattern types: `Daily` and `Weekly`. For example, a time window could repeat "every day", "every 3 days", "every Monday" or "on Friday per 2 weeks".
607
+
608
+
Depending on the type, certain fields of the `Pattern` are required, optional, or ignored.
609
+
610
+
-`Daily`
611
+
612
+
The daily recurrence pattern causes the time window to repeat based on a number of days between each occurrence.
613
+
614
+
| Property | Relevance | Description |
615
+
|----------|-----------|-------------|
616
+
|**Type**| Required | Must be set to `Daily`. |
617
+
|**Interval**| Optional | Specifies the number of days between each occurrence. Default value is 1. |
618
+
619
+
-`Weekly`
620
+
621
+
The weekly recurrence pattern causes the time window to repeat on the same day or days of the week, based on the number of weeks between each set of occurrences.
622
+
623
+
| Property | Relevance | Description |
624
+
|----------|-----------|-------------|
625
+
|**Type**| Required | Must be set to `Weekly`. |
626
+
|**DaysOfWeek**| Required | Specifies on which day(s) of the week the event occurs. |
627
+
|**Interval**| Optional | Specifies the number of weeks between each set of occurrences. Default value is 1. |
628
+
|**FirstDayOfWeek**| Optional | Specifies which day is considered the first day of the week. Default value is `Sunday`. |
629
+
630
+
The following example will repeat the time window every other Monday and Tuesday
631
+
632
+
```javascript
633
+
"Pattern": {
634
+
"Type":"Weekly",
635
+
"Interval":2,
636
+
"DaysOfWeek": ["Monday", "Tuesday"]
637
+
}
638
+
```
639
+
640
+
**Note:**`Start` must be a valid first occurrence which fits the recurrence pattern. Additionally, the duration of the time window cannot be longer than how frequently it occurs. For example, it is invalid to have a 25-hour time window recur every day.
641
+
642
+
#### Recurrence Range
643
+
644
+
There are three possible recurrence range type:`NoEnd`, `EndDate` and `Numbered`.
645
+
646
+
-`NoEnd`
647
+
648
+
The `NoEnd` range causes the recurrence to occur indefinitely.
649
+
650
+
| Property | Relevance | Description |
651
+
|----------|-----------|-------------|
652
+
|**Type**| Required | Must be set to `NoEnd`. |
653
+
654
+
-`EndDate`
655
+
656
+
The `EndDate` range causes the time window to occur on all days that fit the applicable pattern until the end date.
657
+
658
+
| Property | Relevance | Description |
659
+
|----------|-----------|-------------|
660
+
|**Type**| Required | Must be set to `EndDate`. |
661
+
|**EndDate**| Required | Specifies the date time to stop applying the pattern. Note that as long as the start time of the last occurrence falls before the end date, the end time of that occurrence is allowed to extend beyond it. |
662
+
663
+
The following example will repeat the time window every day until the last occurrence happens on April 1st, 2024.
664
+
665
+
``` javascript
666
+
"Start": "Fri, 22 Mar 2024 18:00:00 GMT",
667
+
"End": "Fri, 22 Mar 2024 20:00:00 GMT",
668
+
"Recurrence":{
669
+
"Pattern": {
670
+
"Type": "Daily",
671
+
"Interval": 1
672
+
},
673
+
"Range": {
674
+
"Type": "EndDate",
675
+
"EndDate": "Mon, 1 Apr 2024 20:00:00 GMT"
676
+
}
677
+
}
678
+
```
679
+
680
+
-`Numbered`
681
+
682
+
The `Numbered` range causes the time window to occur a fixed number oftimes (based on the pattern).
683
+
684
+
| Property | Relevance | Description |
685
+
|----------|-----------|-------------|
686
+
|**Type**| Required | Must be set to `Numbered`. |
687
+
|**NumberOfOccurrences**| Required | Specifies the number of occurrences. |
688
+
689
+
The following example will repeat the time window on Monday and Tuesday until the there are 3 occurrences, which respectively happens on April 1st(Mon), April 2nd(Tue) and April 8th(Mon).
690
+
691
+
``` javascript
692
+
"Start": "Mon, 1 Apr 2024 18:00:00 GMT",
693
+
"End": "Mon, 1 Apr 2024 20:00:00 GMT",
694
+
"Recurrence":{
695
+
"Pattern": {
696
+
"Type": "Weekly",
697
+
"Interval": 1,
698
+
"DaysOfWeek": ["Monday", "Tuesday"]
699
+
},
700
+
"Range": {
701
+
"Type": "Numbered",
702
+
"NumberOfOccurrences": 3
703
+
}
704
+
}
705
+
```
706
+
707
+
To create a recurrence rule, you must specify both `Pattern` and `Range`. Any pattern type can work with any range type.
708
+
709
+
**Advanced:** The time zone offset of the `Start` property will apply to the recurrence settings.
710
+
575
711
### Microsoft.Targeting
576
712
577
713
This filter provides the capability to enable a feature for a target audience. Anin-depth explanation of targeting is explained in the [targeting](./README.md#Targeting) section below. The filter parameters include an audience object which describes users, groups, excluded users/groups, and a default percentage of the user base that should have access to the feature. Each group object that is listed in the target audience must also specify what percentage of the group's members should have access. If a user is specified in the exclusion section, either directly or if the user is in an excluded group, the feature will be disabled. Otherwise, if a user is specified in the users section directly, or if the user is in the included percentage of any of the group rollouts, or if the user falls into the default rollout percentage then that user will have the feature enabled.
@@ -666,8 +802,8 @@ IFeatureManager fm;
666
802
TargetingContext targetingContext = new TargetingContext
0 commit comments