Skip to content

Commit

Permalink
Updating namespace names as per the review (#31206)
Browse files Browse the repository at this point in the history
* Updating namespace names as per the review
Azure/azure-sdk-pr#1889

* Setting namespace for java sdk

* Fixing pipeline errors

* Adding emitter for python

* Fixing pipeline errors

* Adding service-dir to fix pipeline error

* Fixing pipeline errors

* Revert "Fixing pipeline errors"

This reverts commit f638130.

* Adding configs in typescript file

* update

* disable sample generation for csharp

* disable sample generation of csharp for sitemanager

* Removing emitter-output-dir based on review comments

---------

Co-authored-by: Yuchao Yan <[email protected]>
Co-authored-by: kazrael2119 <[email protected]>
Co-authored-by: Wei Hu <[email protected]>
Co-authored-by: Wei Hu <[email protected]>
  • Loading branch information
5 people authored Nov 4, 2024
1 parent 690a765 commit 03bc5a3
Show file tree
Hide file tree
Showing 16 changed files with 170 additions and 38 deletions.
49 changes: 49 additions & 0 deletions specification/edge/Microsoft.Edge.Management/tspconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
parameters:
"service-dir":
default: "sdk/commonedgesitemanageroperations"
"python-sdk-folder":
default: "{project-root}/azure-sdk-for-python/"
"java-sdk-folder":
default: "{project-root}/azure-sdk-for-java/"
"service-directory-name":
default: "commonedgesitemanageroperations"
emit:
- "@azure-tools/typespec-autorest"
options:
Expand All @@ -7,6 +16,46 @@ options:
azure-resource-provider-folder: "resource-manager"
output-file: "{azure-resource-provider-folder}/{service-name}/edge/{version-status}/{version}/operations.json"
arm-types-dir: "{project-root}/../../common-types/resource-management"
"@azure-tools/typespec-java":
package-dir: "azure-resourcemanager-commonedgesitemanageroperations"
namespace: "com.azure.resourcemanager.commonedgesitemanageroperations"
emitter-output-dir: "{java-sdk-folder}/sdk/{service-directory-name}/azure-resourcemanager-commonedgesitemanageroperations"
flavor: azure
"@azure-tools/typespec-python":
package-dir: "azure-mgmt-commonedgesitemanageroperations"
package-name: "{package-dir}"
emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}"
generate-test: true
generate-sample: true
flavor: azure
"@azure-tools/typespec-ts":
azureSdkForJs: true
isModularLibrary: true
generateMetadata: true
hierarchyClient: false
experimentalExtensibleEnums: true
enableOperationGroup: true
flavor: azure
package-dir: "arm-commonedgesitemanageroperations"
packageDetails:
name: "@azure/arm-commonedgesitemanageroperations"
"@azure-tools/typespec-csharp":
package-dir: "Azure.ResourceManager.CommonEdgeSiteManagerOperations"
namespace: "{package-dir}"
clear-output-folder: true
model-namespace: false
flavor: azure
"@azure-tools/typespec-go":
service-dir: "sdk/resourcemanager/commonedgesitemanageroperations"
package-dir: "armcommonedgesitemanageroperations"
module: "github.com/Azure/azure-sdk-for-go/{service-dir}/{package-dir}"
fix-const-stuttering: true
flavor: "azure"
generate-examples: true
generate-fakes: true
head-as-boolean: true
inject-spans: true
remove-unreferenced-types: true
linter:
extends:
- "@azure-tools/typespec-azure-rulesets/resource-manager"
50 changes: 50 additions & 0 deletions specification/edge/Microsoft.Edge.Sites.Management/tspconfig.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
parameters:
"service-dir":
default: "sdk/sitemanager"
"python-sdk-folder":
default: "{project-root}/azure-sdk-for-python/"
"java-sdk-folder":
default: "{project-root}/azure-sdk-for-java/"
"service-directory-name":
default: "sitemanager"
emit:
- "@azure-tools/typespec-autorest"
options:
Expand All @@ -7,6 +16,47 @@ options:
azure-resource-provider-folder: "resource-manager"
output-file: "{azure-resource-provider-folder}/{service-name}/sites/{version-status}/{version}/sites.json"
arm-types-dir: "{project-root}/../../common-types/resource-management"
"@azure-tools/typespec-java":
package-dir: "azure-resourcemanager-sitemanager"
namespace: "com.azure.resourcemanager.sitemanager"
emitter-output-dir: "{java-sdk-folder}/sdk/{service-directory-name}/azure-resourcemanager-sitemanager"
flavor: azure
"@azure-tools/typespec-python":
package-dir: "azure-mgmt-sitemanager"
package-name: "{package-dir}"
emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}"
generate-test: true
generate-sample: true
flavor: azure
"@azure-tools/typespec-ts":
azureSdkForJs: true
isModularLibrary: true
generateMetadata: true
hierarchyClient: false
experimentalExtensibleEnums: true
enableOperationGroup: true
flavor: azure
package-dir: "arm-sitemanager"
packageDetails:
name: "@azure/arm-sitemanager"
"@azure-tools/typespec-csharp":
package-dir: "Azure.ResourceManager.SiteManager"
namespace: "{package-dir}"
clear-output-folder: true
model-namespace: false
flavor: azure
generate-sample-project: false
"@azure-tools/typespec-go":
service-dir: "sdk/resourcemanager/sitemanager"
package-dir: "armsitemanager"
module: "github.com/Azure/azure-sdk-for-go/{service-dir}/{package-dir}"
fix-const-stuttering: true
flavor: "azure"
generate-examples: true
generate-fakes: true
head-as-boolean: true
inject-spans: true
remove-unreferenced-types: true
linter:
extends:
- "@azure-tools/typespec-azure-rulesets/resource-manager"
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ For new Resource Provider. It is highly recommended to onboard Azure CLI extensi

``` yaml $(az) && $(target-mode) != 'core'
az:
extensions: edgeupdates
namespace: azure.mgmt.edgeupdates
package-name: azure-mgmt-edgeupdates
az-output-folder: $(azure-cli-extension-folder)/src/edgeupdates
python-sdk-output-folder: "$(az-output-folder)/azext_edgeupdates/vendored_sdks/edgeupdates"
extensions: commonedgesitemanageroperations
namespace: azure.mgmt.commonedgesitemanageroperations
package-name: azure-mgmt-commonedgesitemanageroperations
az-output-folder: $(azure-cli-extension-folder)/src/commonedgesitemanageroperations
python-sdk-output-folder: "$(az-output-folder)/azext_commonedgesitemanageroperations/vendored_sdks/commonedgesitemanageroperations"
# add additional configuration here specific for Azure CLI
# refer to the faq.md for more details
```
Expand All @@ -20,9 +20,9 @@ python-sdk-output-folder: "$(az-output-folder)/azext_edgeupdates/vendored_sdks/e
This is for command modules that already in azure cli main repo.
``` yaml $(az) && $(target-mode) == 'core'
az:
extensions: edgeupdates
namespace: azure.mgmt.edgeupdates
package-name: azure-mgmt-edgeupdates
az-output-folder: $(azure-cli-folder)/src/azure-cli/azure/cli/command_modules/edgeupdates
python-sdk-output-folder: "$(az-output-folder)/vendored_sdks/edgeupdates"
extensions: commonedgesitemanageroperations
namespace: azure.mgmt.commonedgesitemanageroperations
package-name: azure-mgmt-commonedgesitemanageroperations
az-output-folder: $(azure-cli-folder)/src/azure-cli/azure/cli/command_modules/commonedgesitemanageroperations
python-sdk-output-folder: "$(az-output-folder)/vendored_sdks/commonedgesitemanageroperations"
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ csharp:
clear-output-folder: true
client-side-validation: false
namespace: Microsoft.Edge
output-folder: $(csharp-sdks-folder)/edgeupdates/management/Microsoft.Edge/GeneratedProtocol
output-folder: $(csharp-sdks-folder)/commonedgesitemanageroperations/management/Microsoft.Edge/GeneratedProtocol
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ These settings apply only when `--go` is specified on the command line.
```yaml $(go) && $(track2)
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
module-name: sdk/resourcemanager/edgeupdates/armedgeupdates
module-name: sdk/resourcemanager/commonedgesitemanageroperations/armcommonedgesitemanageroperations
module: github.com/Azure/azure-sdk-for-go/$(module-name)
output-folder: $(go-sdk-folder)/$(module-name)
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Java

These settings apply only when `--java` is specified on the command line.
Please also specify `--azure-libraries-for-java-folder=<path to the root directory of your azure-libraries-for-java clone>`.

``` yaml $(java)
azure-arm: true
namespace: com.azure.resourcemanager.commonedgesitemanageroperations
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 1
output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-commonedgesitemanageroperations
```
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ These are the global settings for the edge.
```yaml
openapi-type: arm
openapi-subtype: providerHub
tag: updates-package-2024-02-01-preview
tag: package-2024-02-01-preview
```
### Tag: updates-package-2024-02-01-preview
### Tag: package-2024-02-01-preview
These settings apply only when `--tag=updates-package-2024-02-01-preview` is specified on the command line.
These settings apply only when `--tag=package-2024-02-01-preview` is specified on the command line.

```yaml $(tag) == 'updates-package-2024-02-01-preview'
```yaml $(tag) == 'package-2024-02-01-preview'
input-file:
- preview/2024-02-01-preview/operations.json
```
Expand All @@ -51,6 +51,7 @@ This is not used by Autorest itself.
swagger-to-sdk:
- repo: azure-sdk-for-python
- repo: azure-sdk-for-java
- repo: azure-sdk-for-go
- repo: azure-sdk-for-js
- repo: azure-resource-manager-schemas
- repo: azure-cli-extensions
Expand All @@ -77,3 +78,7 @@ See configuration in [readme.typescript.md](./readme.typescript.md)

See configuration in [readme.csharp.md](./readme.csharp.md)

## Java

See configuration in [readme.java.md](./readme.java.md)

Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Please also specify `--python-sdks-folder=<path to the root directory of your az
``` yaml $(python)
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
package-name: azure-mgmt-edgeupdates
namespace: azure.mgmt.edgeupdates
package-name: azure-mgmt-commonedgesitemanageroperations
namespace: azure.mgmt.commonedgesitemanageroperations
package-version: 1.0.0b1
clear-output-folder: true
```
``` yaml $(python)
no-namespace-folders: true
output-folder: $(python-sdks-folder)/edgeupdates/azure-mgmt-edgeupdates/azure/mgmt/edgeupdates
output-folder: $(python-sdks-folder)/commonedgesitemanageroperations/azure-mgmt-commonedgesitemanageroperations/azure/mgmt/commonedgesitemanageroperations
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Please also specify `--typescript-sdks-folder=<path to root folder of your azure
``` yaml $(typescript)
typescript:
azure-arm: true
package-name: "@azure/arm-edgeupdates"
output-folder: "$(typescript-sdks-folder)/sdk/edgeupdates/arm-edgeupdates"
package-name: "@azure/arm-commonedgesitemanageroperations"
output-folder: "$(typescript-sdks-folder)/sdk/commonedgesitemanageroperations/arm-commonedgesitemanageroperations"
payload-flattening-threshold: 1
clear-output-folder: true
generate-metadata: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ For new Resource Provider. It is highly recommended to onboard Azure CLI extensi

``` yaml $(az) && $(target-mode) != 'core'
az:
extensions: edgesites
namespace: azure.mgmt.edgesites
package-name: azure-mgmt-edgesites
az-output-folder: $(azure-cli-extension-folder)/src/edgesites
python-sdk-output-folder: "$(az-output-folder)/azext_edgesites/vendored_sdks/edgesites"
extensions: sitemanager
namespace: azure.mgmt.sitemanager
package-name: azure-mgmt-sitemanager
az-output-folder: $(azure-cli-extension-folder)/src/sitemanager
python-sdk-output-folder: "$(az-output-folder)/azext_sitemanager/vendored_sdks/sitemanager"
# add additional configuration here specific for Azure CLI
# refer to the faq.md for more details
```
Expand All @@ -20,9 +20,9 @@ python-sdk-output-folder: "$(az-output-folder)/azext_edgesites/vendored_sdks/edg
This is for command modules that already in azure cli main repo.
``` yaml $(az) && $(target-mode) == 'core'
az:
extensions: edgesites
namespace: azure.mgmt.edgesites
package-name: azure-mgmt-edgesites
az-output-folder: $(azure-cli-folder)/src/azure-cli/azure/cli/command_modules/edgesites
python-sdk-output-folder: "$(az-output-folder)/vendored_sdks/edgesites"
extensions: sitemanager
namespace: azure.mgmt.sitemanager
package-name: azure-mgmt-sitemanager
az-output-folder: $(azure-cli-folder)/src/azure-cli/azure/cli/command_modules/sitemanager
python-sdk-output-folder: "$(az-output-folder)/vendored_sdks/sitemanager"
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ csharp:
clear-output-folder: true
client-side-validation: false
namespace: Microsoft.Edge
output-folder: $(csharp-sdks-folder)/edgesites/management/Microsoft.Edge/GeneratedProtocol
output-folder: $(csharp-sdks-folder)/sitemanager/management/Microsoft.Edge/GeneratedProtocol
```
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ These settings apply only when `--go` is specified on the command line.
```yaml $(go) && $(track2)
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
module-name: sdk/resourcemanager/edgesites/armedgesites
module-name: sdk/resourcemanager/sitemanager/armsitemanager
module: github.com/Azure/azure-sdk-for-go/$(module-name)
output-folder: $(go-sdk-folder)/$(module-name)
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Java

These settings apply only when `--java` is specified on the command line.
Please also specify `--azure-libraries-for-java-folder=<path to the root directory of your azure-libraries-for-java clone>`.

``` yaml $(java)
azure-arm: true
namespace: com.azure.resourcemanager.sitemanager
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 1
output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-sitemanager
```
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,7 @@ See configuration in [readme.typescript.md](./readme.typescript.md)
## CSharp

See configuration in [readme.csharp.md](./readme.csharp.md)

## Java

See configuration in [readme.java.md](./readme.java.md)
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Please also specify `--python-sdks-folder=<path to the root directory of your az
``` yaml $(python)
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
package-name: azure-mgmt-edgesites
namespace: azure.mgmt.edgesites
package-name: azure-mgmt-sitemanager
namespace: azure.mgmt.sitemanager
package-version: 1.0.0b1
clear-output-folder: true
```
``` yaml $(python)
no-namespace-folders: true
output-folder: $(python-sdks-folder)/edgesites/azure-mgmt-edgesites/azure/mgmt/edgesites
output-folder: $(python-sdks-folder)/sitemanager/azure-mgmt-sitemanager/azure/mgmt/sitemanager
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Please also specify `--typescript-sdks-folder=<path to root folder of your azure
``` yaml $(typescript)
typescript:
azure-arm: true
package-name: "@azure/arm-edgesites"
output-folder: "$(typescript-sdks-folder)/sdk/edgesites/arm-edgesites"
package-name: "@azure/arm-sitemanager"
output-folder: "$(typescript-sdks-folder)/sdk/sitemanager/arm-sitemanager"
payload-flattening-threshold: 1
clear-output-folder: true
generate-metadata: true
Expand Down

0 comments on commit 03bc5a3

Please sign in to comment.