Add arm-version-progression linter rule (Rule 7)#4347
Conversation
Agent-Logs-Url: https://github.com/Azure/typespec-azure/sessions/6cf84665-2e09-424f-a485-588f1e3d5ffe Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
|
@copilot There is one fundamental change here. No api-version is allowed to use the same date as any other api-version. That is, there can be no preview version and stable version that have the same date (i.e. 2026-04-28 and 2026-04-28-preview are *not allowed) The dates in api-versions must all be different, and they must be monotonically increasing from the top to the bottom of the Versions enum for a namespace. Please add tests that ensure a violation in this case, please look over tests to see if they need to be updated, please make sure all tests pass, and that you are up to date with the main branch |
Agent-Logs-Url: https://github.com/Azure/typespec-azure/sessions/56954222-0cc6-4475-b605-d35506b0f10f Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Updated in 89d52fe. The rule now enforces that every api-version uses a unique Test updates:
Branch is up to date with |
commit: |
|
@copilot It looks like there are changes to website docs in the ci build. Please ensure you have rebuilt docs from the typespec-azure-resource-manager directory, and ensure that all files are formatted correctly. Also, please pull the latest from main and ensure that only changes associated with this PR are in the PR diff |
Agent-Logs-Url: https://github.com/Azure/typespec-azure/sessions/b5c70eba-383a-475a-bbd3-2df0c45d7126 Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Addressed in fe563a0. Ran |
markcowl
left a comment
There was a problem hiding this comment.
As always, make sure to pull the latest from main, make the suggested changes, alter tests to match, ensure that all tests pass, that all files are formatted correctly and that only the changes that are part of this PR are in the PR diff
Agent-Logs-Url: https://github.com/Azure/typespec-azure/sessions/86f51146-dd4b-46e7-b99c-4f7088c9c1f9 Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
⚡ Benchmark ResultsComparing [
|
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
markcowl
left a comment
There was a problem hiding this comment.
Need to suppress the issues it found in existing specs
|
/azp run typespec-azure - PR Tools |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
PR for suppressions: Azure/azure-rest-api-specs#42900 |
| @@ -0,0 +1,70 @@ | |||
| --- | |||
| title: arm-version-progression | |||
There was a problem hiding this comment.
do we want to keep the arm- prefix when we already have the package on the left?
| create(context) { | ||
| return { | ||
| namespace: (namespace: Namespace) => { | ||
| if (isInternalTypeSpec(context.program, namespace)) { |
There was a problem hiding this comment.
I don't think we need this check for new rules
| @versioned(Versions) | ||
| @armProviderNamespace | ||
| namespace Microsoft.Contoso; | ||
|
|
There was a problem hiding this comment.
Thanks Mark for adding the versioning linters. May I know is it better to add this document in versioning section? https://azure.github.io/typespec-azure/docs/howtos/versioning/01-about-versioning/ so that it increase the chance of agent picking it up in versioning scenario.
Or could we at least refer this document in versioning section?
Implementing Rule 7 from the plan:
arm-version-progressionlinter rule for the@azure-tools/typespec-azure-resource-managerpackage.arm-version-progression.tsrulelinter.tsand theazure-rulesetsresource-manager rulesetarm-version-progression.test.tsarm-version-progression.mdregen-docsto update generated linter rule listingsVersions; correct example uses a single preview as the last entry; added an edge-case valid example with stable second-to-last and preview one day later)pnpm format