Skip to content

Commit

Permalink
Merge pull request #3063 from Azure/ant/auto
Browse files Browse the repository at this point in the history
Onboard more RPs to autogeneration
  • Loading branch information
anthony-c-martin authored Apr 26, 2024
2 parents d5adb33 + c87342f commit c9d954d
Show file tree
Hide file tree
Showing 20 changed files with 5,211 additions and 298 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ If you want to preview or troubleshoot generation locally, you can use the gener
npm --prefix bicep-types-az/bicep-types/src/bicep-types run build
npm --prefix bicep-types-az/src/autorest.bicep ci
npm --prefix bicep-types-az/src/autorest.bicep run build
1. Run the following commands (replace the base path accordingly - valid paths can be disovered with `npm run list-basepaths -- --specs-dir path/to/azure-rest-api-specs`):
1. Run the following commands, replacing `../azure-rest-api-specs` with your relative path to the swagger repo, and `myprovider/resource-manager` with the base path (discovered with `npm --prefix generator run list-basepaths`)
```bash
cd generator
npm --prefix generator ci
npm --prefix generator run generate-single -- --specs-dir path/to/azure-rest-api-specs --base-path myprovider/resource-manager
npm --prefix generator run generate-single -- --specs-dir ../azure-rest-api-specs --base-path myprovider/resource-manager
```

### Runing Unit Tests
Expand Down
49 changes: 15 additions & 34 deletions generator/autogenlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,44 +22,11 @@ import { detectProviderNamespaces } from './generate';
// New providers are onboarded by default. The providers listed here are the only ones **not** onboarded.
const disabledProviders: AutoGenConfig[] = [
{
basePath: 'cloudshell/resource-manager',
namespace: 'Microsoft.Portal',
disabledForAutogen: true,
},
{
basePath: 'compute/resource-manager',
namespace: 'Microsoft.ContainerService',
disabledForAutogen: true,
},
{
basePath: 'cdn/resource-manager',
namespace: 'Microsoft.Cdn',
},
{
// Need to be very careful - Microsoft.Logic are heavily dependent on Export Template, and are sensitive to properties being removed unintentionally
basePath: 'logic/resource-manager',
namespace: 'Microsoft.Logic',
disabledForAutogen: true,
},
{
basePath: 'managedservices/resource-manager',
namespace: 'Microsoft.ManagedServices',
disabledForAutogen: true,
},
{
basePath: 'operationsmanagement/resource-manager',
namespace: 'Microsoft.OperationsManagement',
disabledForAutogen: true,
},
{
basePath: 'service-map/resource-manager',
namespace: 'Microsoft.OperationalInsights',
disabledForAutogen: true,
},
{
basePath: 'videoanalyzer/resource-manager',
namespace: 'Microsoft.Media',
disabledForAutogen: true,
},
];

// Run "npm run list-basepaths" to discover all the valid readme files to add to this list
Expand Down Expand Up @@ -1150,6 +1117,20 @@ const autoGenList: AutoGenConfig[] = [
basePath: 'confidentialLedger/resource-manager',
namespace: 'Microsoft.ConfidentialLedger',
},
{
basePath: 'managedservices/resource-manager',
namespace: 'Microsoft.ManagedServices',
resourceConfig: [
{
type: 'registrationDefinitions',
scopes: ScopeType.Subscription,
},
{
type: 'registrationAssignments',
scopes: ScopeType.Subscription | ScopeType.ResourceGroup,
},
]
},
];

export function findAutogenEntries(basePath: string): AutoGenConfig[] {
Expand Down
8 changes: 4 additions & 4 deletions schemas/2014-04-01-preview/deploymentTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5580,16 +5580,16 @@
"$ref": "https://schema.management.azure.com/schemas/2019-10-01-preview/Microsoft.Migrate.ResourceMover.json#/resourceDefinitions/moveCollections_moveResources"
},
{
"$ref": "https://schema.management.azure.com/schemas/2018-06-01-preview/Microsoft.ManagedServices.json#/resourceDefinitions/registrationAssignments"
"$ref": "https://schema.management.azure.com/schemas/2018-06-01-preview/Microsoft.ManagedServices.json#/unknown_resourceDefinitions/registrationAssignments"
},
{
"$ref": "https://schema.management.azure.com/schemas/2018-06-01-preview/Microsoft.ManagedServices.json#/resourceDefinitions/registrationDefinitions"
"$ref": "https://schema.management.azure.com/schemas/2018-06-01-preview/Microsoft.ManagedServices.json#/unknown_resourceDefinitions/registrationDefinitions"
},
{
"$ref": "https://schema.management.azure.com/schemas/2019-06-01/Microsoft.ManagedServices.json#/resourceDefinitions/registrationAssignments"
"$ref": "https://schema.management.azure.com/schemas/2019-06-01/Microsoft.ManagedServices.json#/unknown_resourceDefinitions/registrationAssignments"
},
{
"$ref": "https://schema.management.azure.com/schemas/2019-06-01/Microsoft.ManagedServices.json#/resourceDefinitions/registrationDefinitions"
"$ref": "https://schema.management.azure.com/schemas/2019-06-01/Microsoft.ManagedServices.json#/unknown_resourceDefinitions/registrationDefinitions"
},
{
"$ref": "https://schema.management.azure.com/schemas/2019-06-01/Microsoft.ContainerService.Aks.json#/resourceDefinitions/managedClusters"
Expand Down
8 changes: 4 additions & 4 deletions schemas/2015-01-01/deploymentTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3031,16 +3031,16 @@
"$ref": "https://schema.management.azure.com/schemas/2019-10-01/Microsoft.Migrate.Migrate.json#/resourceDefinitions/assessmentProjects_vmwarecollectors"
},
{
"$ref": "https://schema.management.azure.com/schemas/2018-06-01-preview/Microsoft.ManagedServices.json#/resourceDefinitions/registrationAssignments"
"$ref": "https://schema.management.azure.com/schemas/2018-06-01-preview/Microsoft.ManagedServices.json#/unknown_resourceDefinitions/registrationAssignments"
},
{
"$ref": "https://schema.management.azure.com/schemas/2018-06-01-preview/Microsoft.ManagedServices.json#/resourceDefinitions/registrationDefinitions"
"$ref": "https://schema.management.azure.com/schemas/2018-06-01-preview/Microsoft.ManagedServices.json#/unknown_resourceDefinitions/registrationDefinitions"
},
{
"$ref": "https://schema.management.azure.com/schemas/2019-06-01/Microsoft.ManagedServices.json#/resourceDefinitions/registrationAssignments"
"$ref": "https://schema.management.azure.com/schemas/2019-06-01/Microsoft.ManagedServices.json#/unknown_resourceDefinitions/registrationAssignments"
},
{
"$ref": "https://schema.management.azure.com/schemas/2019-06-01/Microsoft.ManagedServices.json#/resourceDefinitions/registrationDefinitions"
"$ref": "https://schema.management.azure.com/schemas/2019-06-01/Microsoft.ManagedServices.json#/unknown_resourceDefinitions/registrationDefinitions"
},
{
"$ref": "https://schema.management.azure.com/schemas/2019-06-01/Microsoft.ContainerService.Aks.json#/resourceDefinitions/managedClusters"
Expand Down
Loading

0 comments on commit c9d954d

Please sign in to comment.