Skip to content

[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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

iliu816
Copy link
Member

@iliu816 iliu816 commented May 27, 2025

SDK configuration pull request

Purpose of this PR

  • Make changes to the SDK configuration only when there are no modifications to the API specification, eliminating the need for an ARM or Stewardship Board API review.

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:

Getting help

  • First, carefully read through this PR description, from top to bottom. Fill out the Purpose of this PR and Due diligence checklist.
  • If you don't have permissions to remove or add labels to the PR, request write access per aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories
  • To understand what you must do next to merge this PR, see the Next 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.
  • For guidance on fixing this PR CI check failures, see the hyperlinks provided in given failure and https://aka.ms/ci-fix.
  • If the PR CI checks appear to be stuck in 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.
  • If the help provided by the previous points is not enough, post to https://aka.ms/azsdk/support/specreview-channel and link to this PR.

Copy link

openapi-pipeline-app bot commented May 27, 2025

Next Steps to Merge

Next steps that must be taken to merge this PR:
  • ❌ This PR is in purview of the ARM review (label: ARMReview). This PR must get ARMSignedOff label from an ARM reviewer.
    This PR has ARMChangesRequested label. Please address or respond to feedback from the ARM API reviewer.
    When you are ready to continue the ARM API review, please remove the ARMChangesRequested label.
    Automation should then add WaitForARMFeedback label.
    ❗If you don't have permissions to remove the label, request write access per aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories.
    For details of the ARM review, see aka.ms/azsdk/pr-arm-review
  • ❌ The required check named Automated merging requirements met has failed. This is the final check that must pass. Refer to the check in the PR's 'Checks' tab for details on how to fix it and consult the aka.ms/ci-fix guide. In addition, refer to step 4 in the PR workflow diagram

Copy link

openapi-pipeline-app bot commented May 27, 2025

PR validation pipeline restarted successfully. If there is ApiView generated, it will be updated in this comment.

Copy link

github-actions bot commented May 27, 2025

@AzureRestAPISpecReview AzureRestAPISpecReview added ARMReview NotReadyForARMReview resource-manager TypeSpec Authored with TypeSpec VersioningReviewRequired <valid label in PR review process>add this label when versioning review is required labels May 27, 2025
@iliu816 iliu816 added the BreakingChange-Approved-BugFix Changes are to correct the REST API definition to correctly describe service behavior label May 27, 2025
@AzureRestAPISpecReview AzureRestAPISpecReview added SuppressionReviewRequired and removed BreakingChange-Approved-BugFix Changes are to correct the REST API definition to correctly describe service behavior labels May 27, 2025
@iliu816 iliu816 added the Versioning-Approved-BugFix https://github.com/Azure/azure-sdk-tools/issues/6374 label May 27, 2025
@AzureRestAPISpecReview AzureRestAPISpecReview added WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required and removed NotReadyForARMReview labels May 27, 2025
@AzureRestAPISpecReview AzureRestAPISpecReview added the ReadyForApiTest <valid label in PR review process>add this label when swagger and service APIs are ready for test label May 27, 2025
@iliu816 iliu816 added the PublishToCustomers Acknowledgement the changes will be published to Azure customers. label May 27, 2025
@iliu816 iliu816 changed the title [servicefabricmanagedclusters] {} -> record<unknown> for js codegen [servicefabricmanagedclusters] {} -> record<unknown> for js codegen, remove two operations from dotnet codegen May 28, 2025
@iliu816 iliu816 changed the title [servicefabricmanagedclusters] {} -> record<unknown> for js codegen, remove two operations from dotnet codegen [servicefabricmanagedclusters] backcompat changes: {} -> record<unknown> for js codegen, remove two operations from dotnet codegen May 28, 2025
@iliu816 iliu816 changed the title [servicefabricmanagedclusters] backcompat changes: {} -> record<unknown> for js codegen, remove two operations from dotnet codegen [servicefabricmanagedclusters] sdk configuration changes for java and dotnet May 28, 2025
@@ -8152,11 +8152,13 @@
},
"settings": {
"type": "object",
"description": "Json formatted public settings for the extension."
"description": "Json formatted public settings for the extension.",
"additionalProperties": {}
},
Copy link
Member

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

Copy link
Member Author

@iliu816 iliu816 Jun 4, 2025

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

https://teams.microsoft.com/l/message/19:[email protected]/1747972523177?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=3e17dcb0-4257-4a30-b843-77f47f1d4121&parentMessageId=1747972523177&teamName=Azure%20SDK&channelName=SDK%20release%20support&createdTime=1747972523177

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

Copy link
Member

@weidongxu-microsoft weidongxu-microsoft Jun 5, 2025

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.

Copy link
Member

@MaryGao MaryGao Jun 5, 2025

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.

{3694F6C7-F406-4A23-A707-ED19AA2D200C}

Copy link
Member

@weidongxu-microsoft weidongxu-microsoft Jun 5, 2025

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

Copy link
Member Author

@iliu816 iliu816 Jun 9, 2025

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?

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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.

@rkmanda rkmanda added the ARMChangesRequested <valid label in PR review process>add this label when require changes after ARM review label Jun 4, 2025
@openapi-pipeline-app openapi-pipeline-app bot removed the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Jun 4, 2025
Comment on lines 907 to 914
#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>;
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft Jun 4, 2025

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

/**
* 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.

@iliu816 iliu816 added WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required and removed ARMChangesRequested <valid label in PR review process>add this label when require changes after ARM review labels Jun 5, 2025
@a-santamaria
Copy link
Member

/azp run

Copy link

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.

@mentat9 mentat9 added the ARMChangesRequested <valid label in PR review process>add this label when require changes after ARM review label Jun 11, 2025
@openapi-pipeline-app openapi-pipeline-app bot removed the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARMChangesRequested <valid label in PR review process>add this label when require changes after ARM review ARMReview PublishToCustomers Acknowledgement the changes will be published to Azure customers. ReadyForApiTest <valid label in PR review process>add this label when swagger and service APIs are ready for test resource-manager SuppressionReviewRequired TypeSpec Authored with TypeSpec Versioning-Approved-BugFix https://github.com/Azure/azure-sdk-tools/issues/6374 VersioningReviewRequired <valid label in PR review process>add this label when versioning review is required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants