Skip to content

Added the grace period to delay recommending the latest API version#19205

Merged
jiangmingzhe merged 4 commits intoAzure:mainfrom
jiangmingzhe:mingzhejiang/api-version-grace-period
Mar 30, 2026
Merged

Added the grace period to delay recommending the latest API version#19205
jiangmingzhe merged 4 commits intoAzure:mainfrom
jiangmingzhe:mingzhejiang/api-version-grace-period

Conversation

@jiangmingzhe
Copy link
Copy Markdown
Member

@jiangmingzhe jiangmingzhe commented Mar 16, 2026

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

"default": 730,
"minimum": 0
},
"newVersionGracePeriodDays": {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: newVersionGracePeriodInDays might be a clearer name than newVersionGracePeriodDays as it makes the unit explicit and aligns with common config/SDK naming conventions.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

@shenglol shenglol left a comment

Choose a reason for hiding this comment

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

:shipit:

@jiangmingzhe jiangmingzhe force-pushed the mingzhejiang/api-version-grace-period branch from 9239bf6 to cfa8d65 Compare March 24, 2026 05:04
- 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)
@jiangmingzhe jiangmingzhe force-pushed the mingzhejiang/api-version-grace-period branch from cfa8d65 to 05e1abf Compare March 30, 2026 10:37
@jiangmingzhe jiangmingzhe merged commit 44dcaa6 into Azure:main Mar 30, 2026
41 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Test this change out locally with the following install scripts (Action run 23741472595)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 23741472595
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 23741472595"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 23741472595
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 23741472595"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants