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

[TCGC] Fix logic to filter models of Azure.Core #1440

Merged
merged 7 commits into from
Aug 30, 2024
Merged

Conversation

msyyc
Copy link
Member

@msyyc msyyc commented Aug 28, 2024

fix #1408

If there is need to filter models, we shall filter directly instead of clear their usage since:

  1. changing usage violate the meaning of usage.
  2. language emitter (e.g. Python) may need the real usage of these filtered models

@azure-sdk
Copy link
Collaborator

azure-sdk commented Aug 28, 2024

All changed packages have been documented.

  • @azure-tools/typespec-client-generator-core
Show changes

@azure-tools/typespec-client-generator-core - breaking ✏️

Filter Core models directly instead of clear their usage

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 📚 Next docs

@iscai-msft
Copy link
Contributor

We are only changing the value for azure core models, we're basically saying "since everyone has their own models, the usage of these models is technically none". Where does the python sdk fail for azure core models? I believe the issue we were having with usage was needing to know more about models that were used for multipart models

@msyyc
Copy link
Member Author

msyyc commented Aug 29, 2024

We are only changing the value for azure core models, we're basically saying "since everyone has their own models, the usage of these models is technically none". Where does the python sdk fail for azure core models? I believe the issue we were having with usage was needing to know more about models that were used for multipart models

For https://github.com/Azure/azure-rest-api-specs/blob/5f24fa2aa4966a7d11892e22c0114f63ee617945/specification/appconfiguration/AppConfiguration/models.tsp#L329, python has to generate this core model since it is referred and azure.core doesn't have similar model to import. If tcgc set the usage with 0, python emitter will filter the core model which is necessary. And as declared in description of this PR, I think clear their usage is not good solution to filter models. If needed, tcgc shall filter it directly.

.chronus/changes/HEAD-2024-7-28-11-19-57.md Outdated Show resolved Hide resolved
@msyyc msyyc enabled auto-merge August 30, 2024 07:19
@msyyc msyyc added this pull request to the merge queue Aug 30, 2024
Merged via the queue into main with commit 55ef91e Aug 30, 2024
22 checks passed
@msyyc msyyc deleted the fix-filter-models branch August 30, 2024 08:12
iscai-msft pushed a commit that referenced this pull request Sep 6, 2024
fix #1408

If there is need to filter models, we shall filter directly instead of
clear their usage since:
1. changing usage violate the meaning of usage.
2. language emitter (e.g. Python) may need the real usage of these
filtered models
markcowl pushed a commit to markcowl/typespec-azure that referenced this pull request Sep 7, 2024
fix Azure#1408

If there is need to filter models, we shall filter directly instead of
clear their usage since:
1. changing usage violate the meaning of usage.
2. language emitter (e.g. Python) may need the real usage of these
filtered models
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.

[TCGC] tcgc shall not clear usage for models under namespace Azure.Core
4 participants