-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Convert Servicelinker Swagger to Tsp #34326
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
|
| * True if connect via Kubernetes CSI Driver. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-core/no-nullable" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| connectAsKubernetesCsiDriver?: boolean | null; |
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.
@MaryGao Do we accept the change here?

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.
issue track: Azure/autorest.typescript#3394
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.
After you have a clear discussion result, I hope you can reply under this comment to help me fix the issues in the tsp in a timely manner.
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.
@v-jiaodi I see in the discussion of another issue that this change seems to have already been accepted. Do you agree that we can close this comment now?
|
Connector's |
|
Another issue in this service: duplicate enum problem: Azure/typespec-azure#3050 |
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.
Some comments to improve the spec and tooling. cc @pshao25
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.
Nit: can we use the same casing for all .tsp file names in the project directory?
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 same casing you mean "DryRunResource"? We honored what service defined here.
| { | ||
| ...ApiVersionParameter, | ||
|
|
||
| #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" |
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.
Nit: since this looks pretty standard we should add docs for it
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.
There's an instance below where we did add docs for the same param, why didnt we do the same here?
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.
docs added and suppression has been removed
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.
@mcgallan These operations seem to be extension resource operations. Please check and do the corresponding fixes.
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.
As we discussed in the meeting, the current TypeSpec handling of resourceUri seems to be somewhat tricky and may require waiting for a new solution
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.
These operations have been updated to ExtensionResource.
| /** | ||
| * add a dryrun job to do necessary check before actual creation | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" |
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 this an lro? And if so, how does it perform polling?
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, LRO! I didn't get your question actually. How service perform polling? I feel like it's not a question to me.
| * Delete a Connector. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" |
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.
Why are we getting this linter warning with this template? I dont see it modifying the response code. If this is non-standard behavior that is purposefully added for legacy reasons, seems like the suppression should be on the template itself instead of making every user of this template add suppressions for it
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.
It does. The Response is already customzied.
| /** | ||
| * Delete a Connector. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" |
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.
Why is the location header missing? What is the polling method for this operation? Will downstream client libraries know how to perform polling with this spec?
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've no ideas what the polling operation is. I just honored what swagger defined. There is no place in swagger could identify a polling operation.
| */ | ||
| union TargetServiceType { | ||
| string, | ||
| #suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" |
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.
For enum values that dont have documentation, can our tooling just output the name of the value as docs?
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 small fix like that in our tooling would greatly improve this output and reduce the number of suppressions in the specs
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.
We can add ducoment for enum values by its enum value.
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 documentation suppressions add a lot of noise in this file
| /** | ||
| * List the dapr configuration supported by Service Connector. | ||
| */ | ||
| @route("/{+resourceUri}/providers/Microsoft.ServiceLinker/daprConfigurations") |
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.
What is the +resourceUri doing?
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 scope parameter for an extension operation should be allowReserved.
| * OData skipToken option for pagination. | ||
| */ | ||
| @query("$skipToken") | ||
| $skipToken?: string; |
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.
Nit: sinc eyou already have the proper name in the query decorator you can improve the tsp name
| $skipToken?: string; | |
| skipToken?: string; |
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.
If we have tooling doing this, it would be worth a look at improving this
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.
- This would introduce swagger diff, which is a cost for us to do the comparison.
- I need to evaluate the impact to SDK.
- I need to do some investigation why there is a
$.
Next Steps to MergeNext steps that must be taken to merge this PR:
Comment generated by summarize-checks workflow run. |
I see that in this PR you have already used clientLocation to fix this issue. Is this a widely accepted way to fix it? Because this kind of problem also occurs in other swagger projects, perhaps this approach can be used to solve these problems. |
This PR migrates your latest version (identified by the tag in your readme.md) of swagger to TypeSpec. We already tried our best to make sure the TypeSpec represents same as previous swagger. Since we lack the business knowledge, please validate this PR again to make sure it's functional equivalent as before. The local validation step is at Getting started | TypeSpec Azure
Besides, TypeSpec encourages to follow ARM guidelines. Therefore, some representations in your previous swagger will be fixed to follow these guidelines. When you see differences in your local validation, please keep this note in mind. Here is the list you need to pay attention to:
Please reach out to TypeSpec Discussions Channel if there is any help needed.