Skip to content
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

Issues #4: CADL Generated Code Issue in EventGrid SDK #1821

Closed
sarangan12 opened this issue Apr 20, 2023 · 2 comments · Fixed by #1846
Closed

Issues #4: CADL Generated Code Issue in EventGrid SDK #1821

sarangan12 opened this issue Apr 20, 2023 · 2 comments · Fixed by #1846
Assignees

Comments

@sarangan12
Copy link
Member

While working on the EventGrid SDK, generated from CADL files, I have noticed the following. The linter is reporting several errors for the following error: @typescript-eslint/naming-convention.

In addition to that, there is another linter issue also. The method documentation is in the following formar:

/**
 * Initialize a new instance of `AzureMessagingEventGridClient`
 * @param endpoint type: string, The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net
 * @param credentials type: TokenCredential|KeyCredential, uniquely identify client credential
 * @param options type: ClientOptions, the parameter for all optional parameters
 */

This format causes issue with the linter and reports error tsdoc-param-tag-missing-hyphen for the rule tsdoc/syntax. It should be in the following format:

/**
 * Initialize a new instance of `AzureMessagingEventGridClient`
 * @param endpoint - The host name of the namespace, e.g. namespaceName1.westus-1.eventgrid.azure.net
 * @param credentials - uniquely identify client credential
 * @param options - the parameter for all optional parameters
 */

Please fix the above issues.

@joheredi @xirzec FYI.....

@qiaozha qiaozha self-assigned this May 15, 2023
@qiaozha
Copy link
Member

qiaozha commented May 15, 2023

@joheredi @sarangan12 @xirzec do you think we should provide type hint in the description like this document mentioned https://jsdoc.app/tags-param.html

@xirzec
Copy link
Member

xirzec commented May 15, 2023

Personally, I'm not a huge fan of taking the time to duplicate our TS typings into JSDoc since I could see the two getting out of sync if we're not diligent.

@bterlson @witemple-msft thoughts?

sarangan12 added a commit to Azure/azure-sdk-for-js that referenced this issue May 22, 2023
)

### Packages impacted by this PR
@Azure/eventgrid 

### Issues associated with this PR
NA

### Describe the problem that is addressed by this PR
1. The EventGrid Service team has introduced a new Client called
`EventGridClient` with 4 apis - `publishCloudEvent`,
`publishCloudEvents`, `receiveCloudEvents`, `acknowledgeCloudEvents`,
`releaseCloudEvents` and `rejectCloudEvents`. Now, the service is
represented using the [new CADL
specification](https://github.com/Azure/azure-rest-api-specs/tree/feature/eventgrid/typespec/specification/eventgrid/Azure.Messaging.EventGrid).
This SDK, in this PR, has been generated using the new [JS SDK CADL
Generator](https://github.com/Azure/autorest.typescript/tree/main/packages/typespec-ts).

2. During the generation process, I had a few issues in the generation
process. Seperate issues have been filed for the same and many of them
have already been resolved. For the remaining issues, I have provided
manual patches in this PR, so the release schedule will not be impacted.
Jose is already working on fixing any remaining issues. A complete list
of issues can be found in the related PRs/Issues section below.

3. This is a **beta** release. So, this code is not merged to the main
branch. The code changes are merged to a private branch
**feature/eventgrid/4_13_beta_1**.

**APIView To Approve** 

https://apiview.dev/Assemblies/Review/de09872b51a24f489981db711a73c430/2e0e731c80a840faab6df4c51acb6e95?diffRevisionId=2a4fb5a9265847c09428acb9b0581b0e&doc=False&diffOnly=True

### What are the possible designs available to address the problem? If
there are more than one possible design, why was the one in this PR
chosen?
No special design considerations for the generation process.

### Are there test cases added in this PR? _(If not, why?)_
This version of the eventgrid service has not been released to public
and not available through azure portal. So, the test cases are not added
to this PR for now. Locally, I have tested the code changes with private
test resources and confirmed that the apis are working fine.

### Provide a list of related PRs/Issues _(if any)_
1. Azure/autorest.typescript#1818
2. Azure/autorest.typescript#1819
3. Azure/autorest.typescript#1820
4. Azure/autorest.typescript#1821
5. Azure/autorest.typescript#1851
6. Azure/autorest.typescript#1852
7. Azure/autorest.typescript#1853

### Command used to generate this PR:**_(Applicable only to SDK release
request PRs)_
npx tsp compile main.tsp

### Checklists
- [X] Added impacted package name to the issue description
- [ ] Does this PR needs any fixes in the SDK Generator?** _(If so,
create an Issue in the
[Autorest/typescript](https://github.com/Azure/autorest.typescript)
repository and link it here)_
- [X] Added a changelog (if necessary)

@joheredi @ellismg Please review and approve the PR. 

@xirzec FYI....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants