-
Notifications
You must be signed in to change notification settings - Fork 65
[tcgc] one client multiple services #3460
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
|
All changed packages have been documented.
Show changes
|
|
You can try these changes here
|
commit: |
…cgc/multiServiceOneClient
| this.apiVersion !== undefined && | ||
| this.apiVersion !== "latest" && | ||
| this.apiVersion !== "all" && | ||
| !this.__packageVersions.includes(this.apiVersion) | ||
| !serviceVersions.includes(this.apiVersion) |
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 config could only be used for one service. How could this work for multiple service's version?
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 may need to think about how to specific multiple service's api version in the config.
| export function handleVersioningMutationForGlobalNamespace(context: TCGCContext): Namespace { | ||
| const globalNamespace = context.program.getGlobalNamespaceType(); | ||
| const allApiVersions = context.getPackageVersions(); | ||
| const allApiVersions = context.getApiVersions(); |
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 logic is wrong. For different service's namespace, we should use different versioning mutator with service's specific version enum. Current logic uses the first service's versioning mutator to mutate the global namespace does not cover the other service's type graph.
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.
yeah this is my thinking for also not allowing versioning mutation for multiple services. I think this code would be super complicated and prone to breaking. What are your thoughts? Maybe I could just throw a warning where we don't allow you to mutate to a specific version
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 prefer either we mutate different namespaces with different versioning (support on TCGC layer) or let top level namespace client define a separated versioning with versioning dependency of child's namespace (support on TypeSpec level).
No description provided.