-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add json schema for built-in feature filters #903
Open
zhiyuanliang-ms
wants to merge
6
commits into
main
Choose a base branch
from
zhiyuanliang/add-filter-schema
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0352d8b
filter schema added
zhiyuanliang-ms 3aa1c31
update example
zhiyuanliang-ms 88721a0
add default value for first day of week
zhiyuanliang-ms 74e8cf7
move filter schema to filter folder
zhiyuanliang-ms d600a54
require recurrence pattern & range
zhiyuanliang-ms 7d5d2f7
add description
zhiyuanliang-ms File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
106 changes: 106 additions & 0 deletions
106
docs/FeatureManagement/TargetingFilter.v1.0.0.schema.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"definitions": {}, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://azconfig.io/schemas/FeatureManagement/v1.0.0/TargetingFilter.json", | ||
"type": "object", | ||
"title": "A Microsoft Targeting Filter Declaration", | ||
"required": [ | ||
"name" | ||
], | ||
"properties": { | ||
"name": { | ||
"$id": "#/properties/name", | ||
"type": "string", | ||
"title": "Targeting Filter Name", | ||
"enum": [ | ||
"Microsoft.Targeting" | ||
] | ||
}, | ||
"parameters": { | ||
"$id": "#/properties/parameters", | ||
"type": "object", | ||
"title": "Targeting Filter Parameters", | ||
"properties": { | ||
"Audience": { | ||
"$id": "#/properties/parameters/properties/Audience", | ||
"type": "object", | ||
"title": "Targeting Filter Audience Parameter", | ||
"properties": { | ||
"DefaultRolloutPercentage": { | ||
"$id": "#/properties/parameters/properties/Audience/properties/DefaultRolloutPercentage", | ||
"type": "number", | ||
"title": "Targeting Filter Default Rollout Percentage Parameter", | ||
"minimum": 0, | ||
"maximum": 100 | ||
}, | ||
"Users": { | ||
"$id": "#/properties/parameters/properties/Audience/properties/Users", | ||
"type": "array", | ||
"title": "Targeting Filter Users Parameter", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"Groups": { | ||
"$id": "#/properties/parameters/properties/Audience/properties/Groups", | ||
"type": "array", | ||
"title": "Targeting Filter Groups Parameter", | ||
"items": { | ||
"$id": "#/properties/parameters/properties/Audience/properties/Groups/items/Group", | ||
"type": "object", | ||
"title": "Targeting Filter Group Parameter", | ||
"properties": { | ||
"Name": { | ||
"$id": "#/properties/parameters/properties/Audience/properties/Groups/items/Group/Name", | ||
"type": "string", | ||
"title": "Targeting Filter Group Name Parameter" | ||
}, | ||
"RolloutPercentage": { | ||
"$id": "#/properties/parameters/properties/Audience/properties/Groups/items/Group/RolloutPercentage", | ||
"type": "number", | ||
"title": "Targeting Filter Group RolloutPercentage Parameter", | ||
"minimum": 0, | ||
"maximum": 100 | ||
} | ||
}, | ||
"required": [ | ||
"Name", | ||
"RolloutPercentage" | ||
] | ||
} | ||
}, | ||
"Exclusion": { | ||
"$id": "#/properties/parameters/properties/Audience/properties/Exclusion", | ||
"type": "object", | ||
"title": "Targeting Filter Exclusion Parameter", | ||
"properties": { | ||
"Users": { | ||
"$id": "#/properties/parameters/properties/Audience/properties/Exclusion/Users", | ||
"type": "array", | ||
"title": "Targeting Filter Exclusion Users Parameter", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"Groups": { | ||
"$id": "#/properties/parameters/properties/Audience/properties/Exclusion/Groups", | ||
"type": "array", | ||
"title": "Targeting Filter Exclusion Groups Parameter", | ||
"items": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"DefaultRolloutPercentage" | ||
] | ||
} | ||
}, | ||
"required": [ | ||
"Audience" | ||
] | ||
} | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
docs/FeatureManagement/TimeWindowFilter.v1.0.0.schema.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"definitions": {}, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://azconfig.io/schemas/FeatureManagement/v1.0.0/TimeWindowFilter.json", | ||
"type": "object", | ||
"title": "A Microsoft Time Window Filter Declaration", | ||
"required": [ | ||
"name" | ||
], | ||
"properties": { | ||
"name": { | ||
"$id": "#/properties/name", | ||
"type": "string", | ||
"title": "Time Window Filter Name", | ||
"enum": ["Microsoft.TimeWindow"] | ||
}, | ||
"parameters": { | ||
"$id": "#/properties/parameters", | ||
"type": "object", | ||
"title": "Time Window Filter Parameters", | ||
"properties": { | ||
"Start": { | ||
"$id": "#/properties/parameters/properties/Start", | ||
"type": "string", | ||
"title": "Time Window Filter Start Parameter", | ||
"examples": [ | ||
"Wed, 1 May 2024 12:00:00 GMT", | ||
"Wed, 1 May 2024 20:00:00 +0800" | ||
] | ||
}, | ||
"End": { | ||
"$id": "#/properties/parameters/properties/End", | ||
"type": "string", | ||
"title": "Time Window Filter End Parameter", | ||
"examples": [ | ||
"Thu, 2 May 2024 12:00:00 GMT", | ||
"Thu, 2 May 2024 20:00:00 +0800" | ||
] | ||
} | ||
}, | ||
"anyOf": [ | ||
{ "required": [ | ||
"Start" | ||
] | ||
}, | ||
{ "required": [ | ||
"End" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
160 changes: 160 additions & 0 deletions
160
docs/FeatureManagement/TimeWindowFilter.v2.0.0.schema.json
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
{ | ||
"definitions": {}, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://azconfig.io/schemas/FeatureManagement/v2.0.0/TimeWindowFilter.json", | ||
"type": "object", | ||
"title": "A Microsoft Time Window Filter Declaration", | ||
"required": [ | ||
"name" | ||
], | ||
"properties": { | ||
"name": { | ||
"$id": "#/properties/name", | ||
"type": "string", | ||
"title": "Time Window Filter Name", | ||
"enum": [ | ||
"Microsoft.TimeWindow" | ||
] | ||
}, | ||
"parameters": { | ||
"$id": "#/properties/parameters", | ||
"type": "object", | ||
"title": "Time Window Filter Parameters", | ||
"properties": { | ||
"Start": { | ||
"$id": "#/properties/parameter/properties/Start", | ||
"type": "string", | ||
"title": "Time Window Filter Start Parameter", | ||
"examples": [ | ||
"Wed, 1 May 2024 12:00:00 GMT", | ||
"Wed, 1 May 2024 20:00:00 +0800" | ||
] | ||
}, | ||
"End": { | ||
"$id": "#/properties/parameters/properties/End", | ||
"type": "string", | ||
"title": "Time Window Filter End Parameter", | ||
"examples": [ | ||
"Thu, 2 May 2024 12:00:00 GMT", | ||
"Thu, 2 May 2024 20:00:00 +0800" | ||
] | ||
}, | ||
"Recurrence": { | ||
"$id": "#/properties/parameters/properties/Recurrence", | ||
"type": "object", | ||
"title": "Time Window Filter Recurrence Parameter", | ||
"properties": { | ||
"Pattern": { | ||
"$id": "#/properties/parameters/properties/Recurrence/properties/Pattern", | ||
"type": "object", | ||
"title": "Time Window Filter Recurrence Pattern Parameter", | ||
"required": [ | ||
"Type" | ||
], | ||
"properties": { | ||
"Type": { | ||
"$id": "#/properties/parameters/properties/Recurrence/properties/Pattern/properties/Type", | ||
"type": "string", | ||
"title": "Time Window Filter Recurrence Pattern Type Parameter", | ||
"enum": [ | ||
"Daily", | ||
"Weekly" | ||
] | ||
}, | ||
"Interval": { | ||
"$id": "#/properties/parameters/properties/Recurrence/properties/Pattern/properties/Interval", | ||
"type": "number", | ||
"title": "Time Window Filter Recurrence Pattern Interval Parameter", | ||
"default": 1 | ||
}, | ||
"DaysOfWeek": { | ||
"$id": "#/properties/parameters/properties/Recurrence/properties/Pattern/properties/DaysOfWeek", | ||
"type": "array", | ||
"title": "Time Window Filter Recurrence Weekly Pattern DaysOfWeek Parameter", | ||
"items": { | ||
"$id": "#/properties/parameters/properties/Recurrence/properties/Pattern/properties/DaysOfWeek/items", | ||
"type": "string", | ||
"title": "DayOfWeek", | ||
"enum": [ | ||
"Monday", | ||
"Tuesday", | ||
"Wednesday", | ||
"Thursday", | ||
"Friday", | ||
"Saturday", | ||
"Sunday" | ||
] | ||
} | ||
}, | ||
"FirstDayOfWeek": { | ||
zhiyuanliang-ms marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"$id": "#/properties/parameters/properties/Recurrence/properties/Pattern/properties/FirstDayOfWeek", | ||
"type": "string", | ||
"title": "Time Window Filter Recurrence Weekly Pattern FirstDayOfWeek Parameter", | ||
"enum": [ | ||
"Monday", | ||
"Tuesday", | ||
"Wednesday", | ||
"Thursday", | ||
"Friday", | ||
"Saturday", | ||
"Sunday" | ||
] | ||
} | ||
} | ||
}, | ||
"Range": { | ||
"required": [ | ||
"Type" | ||
], | ||
"properties": { | ||
"Type": { | ||
"$id": "#/properties/parameters/properties/Recurrence/properties/Range/properties/Type", | ||
"type": "string", | ||
"title": "Time Window Filter Recurrence Range Type Parameter", | ||
"enum": [ | ||
"NoEnd", | ||
"EndDate", | ||
"Numbered" | ||
] | ||
}, | ||
"EndDate": { | ||
"$id": "#/properties/parameters/properties/Recurrence/properties/Range/properties/EndDate", | ||
"type": "string", | ||
"title": "Time Window Filter Recurrence End Date Parameter", | ||
"examples": [ | ||
"Wed, 1 May 2024 12:00:00 GMT", | ||
"Wed, 1 May 2024 20:00:00 +0800" | ||
] | ||
}, | ||
"NumberOfOccurrences": { | ||
"$id": "#/properties/parameters/properties/Recurrence/properties/Range/properties/NumberOfOccurrences", | ||
"type": "number", | ||
"title": "Time Window Filter Recurrence Number Of Occurrences Parameter" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"anyOf": [ | ||
{ | ||
"required": [ | ||
"Start" | ||
] | ||
}, | ||
{ | ||
"required": [ | ||
"End" | ||
] | ||
}, | ||
{ | ||
"required": [ | ||
"Start", | ||
"End", | ||
"Recurrence" | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
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.
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.
Should we name the file name Microsoft.Targeting.*?
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.
I am ok with naming the file with "Microsoft.xxx". We don't have Microsoft prefix for feature flag and feature management schema. Should we change them all?
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.
We don't have Microsoft prefixed to feature flag or feature management anywhere. It's just branding. For filters, Microsoft.Targeting is the actual complete name users put in their feature flags and we expect from the code.
If we do change the name, it will be unclear this is about filters, so we probably can put them in a subfolder, eg., FeatureManagement/FeatureFilters.