Added the grace period to delay recommending the latest API version#19205
Conversation
| "default": 730, | ||
| "minimum": 0 | ||
| }, | ||
| "newVersionGracePeriodDays": { |
There was a problem hiding this comment.
Nit: newVersionGracePeriodInDays might be a clearer name than newVersionGracePeriodDays as it makes the unit explicit and aligns with common config/SDK naming conventions.
There was a problem hiding this comment.
Sure, I will update the name
|
|
||
| // Use filtered versions for the rest of the logic to avoid recommending versions within the grace period | ||
| var stableVersionsSorted = FilterStable(allVersionsExcludingGracePeriod).OrderBy(v => v.Date).ToArray(); | ||
| var previewVersionsSorted = FilterPreview(allVersionsExcludingGracePeriod).OrderBy(v => v.Date).ToArray(); |
There was a problem hiding this comment.
So this isn’t introduced by this PR...but I’m wondering if the OrderBy calls are unnecessary. Since the collections are always iterated over later, maintaining a sorted order doesn’t seem to provide any benefit.
There was a problem hiding this comment.
So this isn’t introduced by this PR...but I’m wondering if the OrderBy calls are unnecessary. Since the collections are always iterated over later, maintaining a sorted order doesn’t seem to provide any benefit.
Yeah, looks like the OrderBy is not necessary. I removed the OrderBy and run the whole test suite and nothing breaks. Let me remove the OrderBy
9239bf6 to
cfa8d65
Compare
- Rename newVersionGracePeriodInDays to gracePeriodInDays (18 chars) to meet 25-character config property name limit - Remove unnecessary OrderBy calls on intermediate collections (versions get sorted at the end anyway) - Rename variables to remove misleading 'Sorted' suffix (stableVersionsSorted -> stableVersions, etc.) - All 10,008 tests passing (6634 unit + 3374 integration)
cfa8d65 to
05e1abf
Compare
|
Test this change out locally with the following install scripts (Action run 23741472595) VSCode
Azure CLI
|
Description
This PR is to add a grace period of 90 days to delay recommending the latest API version to users from Swagger. This is added to give RP team to finish deploying the new API version to all ARM regions.
Previously customer took the recommended latest API version but faced deployment failure because RP's latest API version wasn't deployed to all ARM regions.
This only affects the recommended API version. It's still allowed if customer keeps using the API version in grace period.
Example Usage
Checklist
Microsoft Reviewers: Open in CodeFlow