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

Fix track2 ga naming and client merge issues #1250

Closed

Conversation

qiaozha
Copy link
Member

@qiaozha qiaozha commented Nov 18, 2021

No description provided.

@@ -180,7 +180,7 @@ export interface PathUpdateHeaders {
/** User-defined properties associated with the file or directory, in the format of a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is a base64 encoded string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set. */
properties?: string;
/** When performing setAccessControlRecursive on a directory, the number of paths that are processed with each invocation is limited. If the number of paths to be processed exceeds this limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the setAccessControlRecursive operation to continue the setAccessControlRecursive operation on the directory. */
xMsContinuation?: string;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because Style.camel("XMsContinuation", true, {}, 5} gives us XMsContinuation

@@ -82,7 +82,7 @@ export interface BlobItemInternal {
deleted: boolean;
snapshot: string;
versionId?: string;
isCurrentVersion?: boolean;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we have this change

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look like this is also because Style.camel("IsCurrentVersion", true, {}, 3) gives us IsCurrentVersion. Really weird

@@ -301,7 +301,7 @@ export interface PathGetPropertiesHeaders {
/** The POSIX access permissions for the file owner, the file owning group, and others. Included in the response if Hierarchical Namespace is enabled for the account. */
permissions?: string;
/** The POSIX access control list for the file or directory. Included in the response only if the action is "getAccessControl" and Hierarchical Namespace is enabled for the account. */
acl?: string;
ACL?: string;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should use override for this case?

@@ -7,6 +7,5 @@
*/

export * from "./models";
export { LROClient } from "./lROClient";
export { LROClientContext } from "./lROClientContext";
export { LROClient } from "./LROClient";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the file name change look ok ? This should also because of Style.camel("LRO") = "LRO"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new name feels better!

@@ -198,10 +198,10 @@ export const SubProduct: coreClient.CompositeMapper = {
}
};

export const LROsPatch200SucceededIgnoreHeadersHeaders: coreClient.CompositeMapper = {
export const LROsPatch200SucceededIgnoreHeaders: coreClient.CompositeMapper = {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we change it from HeadersHeaders to Headers ?

export * from "./lrosaDs";
export * from "./lROsCustomHeader";
export * from "./LROsCustomHeader";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as the previous one.

export const search$DONotNormalize$Text: OperationQueryParameter = {
parameterPath: "search$DONotNormalize$Text",
export const searchDONOTNormalizeText: OperationQueryParameter = {
parameterPath: "searchDONOTNormalizeText",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is because I set the Style.camel(str, true, {}, 5) but if I don't set it as 5, I get a mismatch in bodyComplex of CMYKColor in models/index.ts.

@@ -775,7 +775,7 @@ export interface BastionShareableLinkListRequest {
/** Bastion Shareable Link. */
export interface BastionShareableLink {
/** Reference of the virtual machine resource. */
vm: Vm;
vm: VM;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess this is looking correct?

@ramya-rao-a
Copy link
Contributor

@qiaozha The PR description is empty. Can you please update it with details of

  • links to issues you are resolving with this PR
  • your approach to resolving those issues
  • anything that the PR reviewer needs to know upfront before reviewing the PR

Both @sarangan12 and @joheredi are out this week. So, @deyaaeldeen will be reviewing this PR. Therefore, any context you can provide will be appreciated

@ramya-rao-a
Copy link
Contributor

@deyaaeldeen I believe the issues related to this PR are #1131 and #1134

@qiaozha
Copy link
Member Author

qiaozha commented Nov 23, 2021

@deyaaeldeen This PR is trying to resolve issue #1131 #430 and #1134.
For issue #1131 and issue #430 @joheredi and I are trying to use Style.camel and Style.pascal from @azure-tools/codegen library to fix issue like method name JWTLogin will be convert to jWTLogin, but as I commentted above there's some weird behaviour and unexpected result of Style.camel. I am still trying to find out a solution, Could you provide any suggestions?
For issue #1134, we are trying to merge the Client and ClientContext into one file.

@ramya-rao-a @deyaaeldeen I will split them into two PRs seperately, as the fix for issue #1134 are pretty straight forward. But the naming issue fix probably going to take some time. I think that fix can be done after the GA, because it only impact some corner cases and we don't want this impact the GA date. let me know if that works for you ?

@ramya-rao-a
Copy link
Contributor

Splitting the PR sounds like a good idea

@@ -143,16 +143,16 @@ export class DocumentsImpl implements Documents {
* Autocompletes incomplete query terms based on input text and matching terms in the index.
* @param suggesterName The name of the suggester as specified in the suggesters collection that's part
* of the index definition.
* @param search$DONotNormalize$Text The incomplete term which should be auto-completed.
* @param searchDONOTNormalizeText The incomplete term which should be auto-completed.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why there's a $ sign here before?

@@ -6,18 +6,18 @@
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this file name look okay ?

@@ -19,7 +19,7 @@ export interface RootWithRefAndNoMeta {
/** I am a complex type with no XML node */
export interface ComplexTypeNoMeta {
/** The id of the res */
id?: string;
ID?: string;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this one.

@@ -119,7 +119,7 @@ export interface BlobPropertiesInternal {
accessTierChangeTime?: Date;
tagCount?: number;
expiresOn?: Date;
isSealed?: boolean;
IsSealed?: boolean;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this 'Is' the problem ?

@@ -163,13 +163,13 @@ export class VirtualWansImpl implements VirtualWans {
* Creates a VirtualWAN resource if it doesn't exist else updates the existing VirtualWAN.
* @param resourceGroupName The resource group name of the VirtualWan.
* @param virtualWANName The name of the VirtualWAN being created or updated.
* @param wANParameters Parameters supplied to create or update VirtualWAN.
* @param WANParameters Parameters supplied to create or update VirtualWAN.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also a good candidate

src/utils/nameUtils.ts Outdated Show resolved Hide resolved
@sarangan12
Copy link
Member

@qiaozha I have discussed with Jose about this PR and here is the summary:

  1. Currently, the naming changes are done by 2 systems - M4 & SDK Generator.
  2. Similarly, We could override the names using 2 methods - Swagger Overrides & M4 Overrides
  3. After the discussion, we have come to the agreement that there can always be cases which might not be handled only by the M4 Logic and M4 Overrides. So, it is not safe or in our advantage to remove the naming logic we have in our SDK Generator.
  4. The edge cases where the name is different now (from what we want) are rare and could be easily handled with a combination of Swagger Overrides & M4 Overrides.
  5. So, I would recommend not to proceed with this PR and close it. The only recommended change would be to remove $DO_NOT_NORMALIZE$ and instead could use the modeler four overrides directly (as they could be read from the host). But, again it is not a mandatory or urgent change or a change that will produce any change in the generated code.

@qiaozha
Copy link
Member Author

qiaozha commented Jan 12, 2022

close this PR based on @sarangan12 's comment. Thanks

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 this pull request may close these issues.

5 participants