-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[servicefabricmanagedclusters] sdk configuration changes for java and dotnet #34953
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
base: main
Are you sure you want to change the base?
Conversation
Next Steps to MergeNext steps that must be taken to merge this PR:
|
PR validation pipeline restarted successfully. If there is ApiView generated, it will be updated in this comment. |
API Change CheckAPIView identified API level changes in this PR and created the following API reviews
|
...manager/Microsoft.ServiceFabric/preview/2024-11-01-preview/servicefabricmanagedclusters.json
Outdated
Show resolved
Hide resolved
...ication/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/back-compat.tsp
Outdated
Show resolved
Hide resolved
@@ -8152,11 +8152,13 @@ | |||
}, | |||
"settings": { | |||
"type": "object", | |||
"description": "Json formatted public settings for the extension." | |||
"description": "Json formatted public settings for the extension.", | |||
"additionalProperties": {} | |||
}, |
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.
please book a slot in the ARM API review office hours to explain why your scenario needs additionalProperties
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 had used record based on advice from
Would appreciate insight from @weidongxu-microsoft on whether it should be changed from record to unknown, which would remove the additionalProperties. Awaiting further discussion below about Compute team's use of unknown and whether that is the correct approach.
Further discussion about unknown vs record that makes me believe we should be using unknown:
Azure/typespec-azure#1725 (comment)
settings and protectedSettings are represented as JObjects in our code:
https://msazure.visualstudio.com/One/_git/winfab-RP?path=/src/CSMTemplate/Model/VMExtensionResourcePropertites.cs&version=GBdevelop&_a=contents&line=14&lineStyle=plain&lineEnd=15&lineStartColumn=1&lineEndColumn=1
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.
Yes, AFAIK, Azure/typespec-azure#1725 (comment) is the recommended migrate solution given by TypeSpec dev.
Strictly speaking, unknown
means any JSON type, include JSON object, but could also be JSON string or numeric or boolean or array.
Record<unknown>
means JSON object.
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.
Is the translation from TypeSpec unknown
to swagger {}
correct?
From table, it seems it could be {}
or {"type": "object"}
in swagger side? I can understand that Autorest has never made a clear difference between {} and {type: object} but it doesn't mean the openapi has no difference for them.
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 assume the dev on typespec-autorest already figured that out.
Not expert but here is one stackoverflow
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.
Hi @rkmanda, we are no longer adding "additionalproperties" to the model. Were there any other points of concern about this PR blocking approval?
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.
The ARM concern here isn't specifically about "additionalProperties": {}, rather it is the fact that the API uses an unschematized object. This is a major ARM anti-pattern. The suggestion of booking office hours was to discuss better, more ARM and client-friendly options for modeling this API object. So the more general question of "why does this API require a property that has no schema?" remains.
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.
From my understanding, this is an existing model in our spec that is also present in previous versions. It is a pass through for Microsoft.Compute. The change introduced in this PR is to align with how Java SDK client generation handles the Typespec. The api surface on the service side hasn't changed, and it would be a breaking change to change the behavior.
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.
@mentat9 we can go to ARM office hours to discuss further. But this shouldn't block this pr because that property has been there since it was introduced and we are following the same pattern as VMSS https://learn.microsoft.com/en-us/azure/templates/microsoft.compute/virtualmachinescalesets?tabs=bicep&pivots=deployment-language-arm-template#virtualmachinescalesetextensionproperties-1. Each extension owner can define their own model for this property.
...fication/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management/Operations.tsp
Outdated
Show resolved
Hide resolved
#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "Day 0 property" | ||
settings?: Record<unknown>; | ||
|
||
/** | ||
* The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. | ||
*/ | ||
#suppress "@azure-tools/typespec-azure-resource-manager/no-empty-model" "Day 0 property" | ||
protectedSettings?: {}; | ||
#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "Day 0 property" | ||
protectedSettings?: Record<unknown>; |
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.
A notice that I found the unmerged migration of compute (which contains VMSS) uses unknown
.
PR #32748
tsp
azure-rest-api-specs/specification/compute/Compute.Management/models.tsp
Lines 2989 to 2999 in 710a6e4
/** | |
* Json formatted public settings for the extension. | |
*/ | |
#suppress "@azure-tools/typespec-azure-core/no-unknown" | |
settings?: unknown; | |
/** | |
* The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. | |
*/ | |
#suppress "@azure-tools/typespec-azure-core/no-unknown" | |
protectedSettings?: unknown; |
unknown
would affect Swagger too, make them
"settings": {
}
without type: object
-- basically it means any
Loop @pshao25 for advise too.
/azp run |
You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list. |
SDK configuration pull request
Purpose of this PR
Due diligence checklist
To merge this PR, you must go through the following checklist and confirm you understood
and followed the instructions by checking all the boxes:
tspconfig.yaml
templates:Getting help
Purpose of this PR
andDue diligence checklist
.write access
per aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositoriesNext Steps to Merge
comment. It will appear within few minutes of submitting this PR and will continue to be up-to-date with current PR state.queued
state, please add a comment with contents/azp run
.This should result in a new comment denoting a
PR validation pipeline
has started and the checks should be updated after few minutes.