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

Namespace refactoring Implementation #47670

Closed
Tracked by #4537
lmazuel opened this issue Oct 23, 2024 · 1 comment · Fixed by microsoft/typespec#5443
Closed
Tracked by #4537

Namespace refactoring Implementation #47670

lmazuel opened this issue Oct 23, 2024 · 1 comment · Fixed by microsoft/typespec#5443
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. CodeGen Issues that relate to code generation feature-request This issue requires a new behavior in the product in order be resolved.

Comments

@lmazuel
Copy link
Member

lmazuel commented Oct 23, 2024

No description provided.

@ArthurMa1978
Copy link
Member

@ArthurMa1978 ArthurMa1978 transferred this issue from Azure/autorest.csharp Dec 26, 2024
@github-actions github-actions bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Dec 26, 2024
@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. CodeGen Issues that relate to code generation needs-team-triage Workflow: This issue needs the team to triage. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Dec 26, 2024
@ArthurMa1978 ArthurMa1978 added feature-request This issue requires a new behavior in the product in order be resolved. and removed needs-team-triage Workflow: This issue needs the team to triage. labels Dec 26, 2024
github-merge-queue bot pushed a commit to microsoft/typespec that referenced this issue Feb 7, 2025
Fixes #5442
Fixes #5471
Fixes #5563
Fixes Azure/azure-sdk-for-net#47670

This PR contains the following:
1. now we honor the namespace defined in typespec for both model and
clients (short for "namespace is namespace" feature)
2. <del>removes the `namespace` configuration from the emitter because
we no longer need it. Azure generator still needs this, we will add it
back in azure emitter (temporary until azure generator decides how to
deal with it)</del>
3. removes the `use-model-namespace` configuration from the emitter
because we no longer need it. Azure generator still needs this, we will
add it back in azure emitter (temporary until azure generator decides
how to deal with it)
4. reports diagnostic when there are conflicts between namespace
segments and subclient names.

Because this change changes the namespace of literally everything, there
are quite a few file changed. Majority of them are the generated files
changed for the namespace.

We also have a piece of logic that automatically renames the client
`Models` to `ModelsOps` in our emitter. We should not have it in the
emitter any way. This part is removed. Azure part needs it, therefore we
will add the same logic back in azure generator.

Update:
I have to add the configuration `namespace` back because
`autorest.csharp` is still strongly coupled with this configuration,
removing it causes massive changes on that side. Therefore I decided
that we keep it here for now, we still write its value to
configuration.json for backward compatibility, but MGC will not read it
nor use it.
github-merge-queue bot pushed a commit to microsoft/typespec that referenced this issue Feb 7, 2025
Fixes #5442
Fixes #5471
Fixes #5563
Fixes Azure/azure-sdk-for-net#47670

This PR contains the following:
1. now we honor the namespace defined in typespec for both model and
clients (short for "namespace is namespace" feature)
2. <del>removes the `namespace` configuration from the emitter because
we no longer need it. Azure generator still needs this, we will add it
back in azure emitter (temporary until azure generator decides how to
deal with it)</del>
3. removes the `use-model-namespace` configuration from the emitter
because we no longer need it. Azure generator still needs this, we will
add it back in azure emitter (temporary until azure generator decides
how to deal with it)
4. reports diagnostic when there are conflicts between namespace
segments and subclient names.

Because this change changes the namespace of literally everything, there
are quite a few file changed. Majority of them are the generated files
changed for the namespace.

We also have a piece of logic that automatically renames the client
`Models` to `ModelsOps` in our emitter. We should not have it in the
emitter any way. This part is removed. Azure part needs it, therefore we
will add the same logic back in azure generator.

Update:
I have to add the configuration `namespace` back because
`autorest.csharp` is still strongly coupled with this configuration,
removing it causes massive changes on that side. Therefore I decided
that we keep it here for now, we still write its value to
configuration.json for backward compatibility, but MGC will not read it
nor use it.
github-merge-queue bot pushed a commit to microsoft/typespec that referenced this issue Feb 7, 2025
Fixes #5442
Fixes #5471
Fixes #5563
Fixes Azure/azure-sdk-for-net#47670

This PR contains the following:
1. now we honor the namespace defined in typespec for both model and
clients (short for "namespace is namespace" feature)
2. <del>removes the `namespace` configuration from the emitter because
we no longer need it. Azure generator still needs this, we will add it
back in azure emitter (temporary until azure generator decides how to
deal with it)</del>
3. removes the `use-model-namespace` configuration from the emitter
because we no longer need it. Azure generator still needs this, we will
add it back in azure emitter (temporary until azure generator decides
how to deal with it)
4. reports diagnostic when there are conflicts between namespace
segments and subclient names.

Because this change changes the namespace of literally everything, there
are quite a few file changed. Majority of them are the generated files
changed for the namespace.

We also have a piece of logic that automatically renames the client
`Models` to `ModelsOps` in our emitter. We should not have it in the
emitter any way. This part is removed. Azure part needs it, therefore we
will add the same logic back in azure generator.

Update:
I have to add the configuration `namespace` back because
`autorest.csharp` is still strongly coupled with this configuration,
removing it causes massive changes on that side. Therefore I decided
that we keep it here for now, we still write its value to
configuration.json for backward compatibility, but MGC will not read it
nor use it.
dmnorc pushed a commit to dmnorc/typespec that referenced this issue Feb 18, 2025
Fixes microsoft#5442
Fixes microsoft#5471
Fixes microsoft#5563
Fixes Azure/azure-sdk-for-net#47670

This PR contains the following:
1. now we honor the namespace defined in typespec for both model and
clients (short for "namespace is namespace" feature)
2. <del>removes the `namespace` configuration from the emitter because
we no longer need it. Azure generator still needs this, we will add it
back in azure emitter (temporary until azure generator decides how to
deal with it)</del>
3. removes the `use-model-namespace` configuration from the emitter
because we no longer need it. Azure generator still needs this, we will
add it back in azure emitter (temporary until azure generator decides
how to deal with it)
4. reports diagnostic when there are conflicts between namespace
segments and subclient names.

Because this change changes the namespace of literally everything, there
are quite a few file changed. Majority of them are the generated files
changed for the namespace.

We also have a piece of logic that automatically renames the client
`Models` to `ModelsOps` in our emitter. We should not have it in the
emitter any way. This part is removed. Azure part needs it, therefore we
will add the same logic back in azure generator.

Update:
I have to add the configuration `namespace` back because
`autorest.csharp` is still strongly coupled with this configuration,
removing it causes massive changes on that side. Therefore I decided
that we keep it here for now, we still write its value to
configuration.json for backward compatibility, but MGC will not read it
nor use it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. CodeGen Issues that relate to code generation feature-request This issue requires a new behavior in the product in order be resolved.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants