Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
a6ecff5
Merge remote-tracking branch 'origin/master' into autogenerate
Jul 27, 2021
c69ffee
Autogenerate schemas
Jul 27, 2021
57aa1db
Update resource list
Jul 27, 2021
ab13cb6
Autogenerate schemas
Jul 27, 2021
1c73f99
Update resource list
Jul 27, 2021
7f10558
Autogenerate schemas
Jul 28, 2021
9d64650
Autogenerate schemas
Jul 28, 2021
26ced22
Update resource list
Jul 28, 2021
d2d0f8f
Autogenerate schemas
Jul 28, 2021
d60b3f6
Autogenerate schemas
Jul 28, 2021
d3911f1
Merge remote-tracking branch 'origin/master' into autogenerate
Jul 29, 2021
150f6c2
Autogenerate schemas
Jul 29, 2021
1b3a4b4
Autogenerate schemas
Jul 29, 2021
e5acba0
Autogenerate schemas
Jul 29, 2021
6f45f02
Autogenerate schemas
Jul 30, 2021
dd9be1b
Merge remote-tracking branch 'origin/master' into autogenerate
Jul 30, 2021
5c3f55b
Autogenerate schemas
Jul 30, 2021
33abda1
Autogenerate schemas
Jul 30, 2021
d20b36f
Autogenerate schemas
Jul 30, 2021
576f704
Autogenerate schemas
Jul 31, 2021
d78caca
Autogenerate schemas
Jul 31, 2021
88dc4a9
Autogenerate schemas
Jul 31, 2021
c84ec7c
Autogenerate schemas
Aug 1, 2021
8649ea2
Autogenerate schemas
Aug 1, 2021
e7f2c7c
Merge remote-tracking branch 'origin/master' into autogenerate
Aug 2, 2021
3d86d6e
Autogenerate schemas
Aug 2, 2021
68a3c9e
Autogenerate schemas
Aug 2, 2021
26822dd
Autogenerate schemas
Aug 3, 2021
2794309
Autogenerate schemas
Aug 3, 2021
4fa739f
Autogenerate schemas
Aug 3, 2021
9faa05f
Autogenerate schemas
Aug 3, 2021
1897f88
Merge remote-tracking branch 'origin/master' into autogenerate
Aug 4, 2021
ebfca2d
Autogenerate schemas
Aug 4, 2021
d1e8666
Autogenerate schemas
Aug 4, 2021
b649c66
Update resource list
Aug 4, 2021
2d17063
Autogenerate schemas
Aug 4, 2021
a5a4f7f
Rename master -> main
anthony-c-martin Aug 4, 2021
ffca211
Onboard RPs for autogen by default
anthony-c-martin Aug 4, 2021
88d3c9f
Bump dependencies
anthony-c-martin Aug 4, 2021
bf7ba1e
Remove unused file
anthony-c-martin Aug 4, 2021
d1f8696
Update generator readme
anthony-c-martin Aug 4, 2021
bd3d765
Merge pull request #1821 from Azure/main
anthony-c-martin Aug 5, 2021
adb409c
Autogenerate schemas
Aug 6, 2021
04fecc6
Update resource list
Aug 6, 2021
c1760e7
Remove cloudServices/updateDomains resource from ARM Schema
Aug 6, 2021
d12aaec
Autogenerate schemas
Aug 6, 2021
2b9b09f
Update resource list
Aug 6, 2021
87fa4d8
Generated report
Aug 6, 2021
7962866
removed deprecated api-version
jorgecotillo Aug 6, 2021
bb7ddea
Merge pull request #1825 from sanchitkum/compute/cs-no-ud
anthony-c-martin Aug 6, 2021
b7ef9f6
Merge pull request #1826 from Azure/autogenerate
anthony-c-martin Aug 6, 2021
a360679
CodeGen from PR 14589 in Azure/azure-rest-api-specs
Aug 9, 2021
4f8649c
[ReleasePR datafactory] Support UAMI in ADF IR/LS/Activity (#1827)
Aug 9, 2021
b26e0a4
CodeGen from PR 15499 in Azure/azure-rest-api-specs
Aug 9, 2021
f9ced97
[ReleasePR sql] add_support_for_action_groups (#1828)
Aug 9, 2021
f38e772
Comments & rename to clarify blocklist behavior
anthony-c-martin Aug 9, 2021
169539a
Merge pull request #1820 from Azure/antmarti/onboard_by_default
anthony-c-martin Aug 9, 2021
893a1d0
Update generateall.ts
anthony-c-martin Aug 11, 2021
fd45b5c
Merge pull request #1830 from Azure/fix_autogen_pipeline
anthony-c-martin Aug 11, 2021
0143ae3
Fix generator pipeline
anthony-c-martin Aug 11, 2021
94c6d5e
Merge pull request #1831 from Azure/antmarti/fix_generator_pipeline
anthony-c-martin Aug 11, 2021
ddee083
CodeGen from PR 15181 in Azure/azure-rest-api-specs
Aug 11, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 0 additions & 68 deletions .github/workflows/autogenerateBatch0.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI

on:
pull_request:
branches: [ master ]
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions azure-pipelines-autogen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ jobs:
set -Eeuxo pipefail
git checkout $(Build.SourceBranchName)
git pull
git merge --no-commit --no-ff --strategy-option=theirs origin/master
git merge --no-commit --no-ff --strategy-option=theirs origin/main
if ! git diff-index --quiet HEAD --; then
git commit -m "Merge remote-tracking branch 'origin/master' into $(Build.SourceBranchName)"
git commit -m "Merge remote-tracking branch 'origin/main' into $(Build.SourceBranchName)"
git push origin $(Build.SourceBranchName)
fi
displayName: Integrate master branch
displayName: Integrate main branch

- script: |
set -Eeuxo pipefail
Expand Down
22 changes: 13 additions & 9 deletions generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ View the Pipeline Configuration [here](/azure-pipelines-autogen.yml).
#### Merging Pipeline-generated schemas

1. Review the status badge on this page to ensure the latest run was successful.
2. Create a Pull Request from [`autogenerate`](https://github.com/Azure/azure-resource-manager-schemas/tree/autogenerate) to [`master`](https://github.com/Azure/azure-resource-manager-schemas/tree/master).
2. Create a Pull Request from [`autogenerate`](https://github.com/Azure/azure-resource-manager-schemas/tree/autogenerate) to [`main`](https://github.com/Azure/azure-resource-manager-schemas/tree/main).
3. If there are any modifications to [schemas/common/autogeneratedResources.json](/schemas/common/autogeneratedResources.json), push a commit to the autogenerate branch to make any corresponding changes to [schemas/2014-04-01-preview/deploymentTemplate.json](/schemas/2014-04-01-preview/deploymentTemplate.json) and [schemas/2015-01-01/deploymentTemplate.json](/schemas/2015-01-01/deploymentTemplate.json).

#### Onboarding to the autogeneration pipeline

1. Follow the steps listed under [Getting Started](#getting-started). The following commands assume you are running in the `generator` directory.
3. Run `npm run list-basepaths` to discover the specs repo path containing the swagger definitions.
4. Run `npm run generate-single {basePath}` to generate schemas for them. Save the console output to file.
5. Manually remove any existing references to your provider namespace (if any) from [schemas/2019-04-01/deploymentTemplate.json](/schemas/2019-04-01/deploymentTemplate.json).
6. Add the {basePath} to the autogenlist array in [autogenlist.ts](./autogenlist.ts).
7. Commit all the changed files, and submit a PR to this repo with title "Onboarding {provider} for autogeneration". Include the full output saved in step 2 as a comment.
8. Ensure all CI tests pass, and ask the team to review the PR (including tool output) to ensure that all expected resources have been detected and generated as expected.
New resource providers are onboarded for autogeneration by default, so the only providers which have been opted out are listed in [autogenlist.ts](./autogenlist.ts) with `disabledForAutogen` set.

If your team has been opted out, and you would like to opt in, please raise an issue in this repo, and we will assist.

> The following steps are no longer necessary for onboarding, but listed here for reference:
> 1. Follow the steps listed under [Getting Started](#getting-started). The following commands assume you are running in the > `generator` directory.
> 3. Run `npm run list-basepaths` to discover the specs repo path containing the swagger definitions.
> 4. Run `npm run generate-single {basePath}` to generate schemas for them. Save the console output to file.
> 5. Manually remove any existing references to your provider namespace (if any) from [schemas/2019-04-01/deploymentTemplate.> json](/schemas/2019-04-01/deploymentTemplate.json).
> 6. Add the {basePath} to the autogenlist array in [autogenlist.ts](./autogenlist.ts).
> 7. Commit all the changed files, and submit a PR to this repo with title "Onboarding {provider} for autogeneration". Include > the full output saved in step 2 as a comment.
> 8. Ensure all CI tests pass, and ask the team to review the PR (including tool output) to ensure that all expected resources > have been detected and generated as expected.
247 changes: 238 additions & 9 deletions generator/autogenlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,229 @@ import { postProcessor as policyProcessor } from './processors/Microsoft.Authori
import { postProcessor as securityInsightsPostProcessor } from './processors/Microsoft.SecurityInsights';
import { lowerCaseEquals } from './utils';

// New providers are onboarded by default. The providers listed here are the only ones **not** onboarded.
const disabledProviders: AutoGenConfig[] = [
{
basePath: 'advisor/resource-manager',
namespace: 'Microsoft.Advisor',
disabledForAutogen: true,
},
{
basePath: 'agrifood/resource-manager',
namespace: 'Microsoft.AgFoodPlatform',
disabledForAutogen: true,
},
{
basePath: 'azure-kusto/resource-manager',
namespace: 'Microsoft.Kusto',
disabledForAutogen: true,
},
{
basePath: 'azurestackhci/resource-manager',
namespace: 'Microsoft.AzureStackHCI',
disabledForAutogen: true,
},
{
basePath: 'baremetalinfrastructure/resource-manager',
namespace: 'Microsoft.BareMetalInfrastructure',
disabledForAutogen: true,
},
{
basePath: 'cloudshell/resource-manager',
namespace: 'Microsoft.Portal',
disabledForAutogen: true,
},
{
basePath: 'compute/resource-manager',
namespace: 'Microsoft.Compute',
disabledForAutogen: true,
},
{
basePath: 'compute/resource-manager',
namespace: 'Microsoft.ContainerService',
disabledForAutogen: true,
},
{
basePath: 'confidentialledger/resource-manager',
namespace: 'Microsoft.ConfidentialLedger',
disabledForAutogen: true,
},
{
basePath: 'cost-management/resource-manager',
namespace: 'Microsoft.CostManagement',
disabledForAutogen: true,
},
{
basePath: 'cpim/resource-manager',
namespace: 'Microsoft.AzureActiveDirectory',
disabledForAutogen: true,
},
{
basePath: 'dataprotection/resource-manager',
namespace: 'Microsoft.DataProtection',
disabledForAutogen: true,
},
{
// Disabled as the swagger spec contains a type ("DateTimeRfc1123") which autorest is unable to parse: https://github.com/Azure/autorest.azureresourceschema/issues/71
basePath: 'domainservices/resource-manager',
namespace: 'Microsoft.AAD',
disabledForAutogen: true,
},
{
basePath: 'dfp/resource-manager',
namespace: 'Microsoft.Dynamics365Fraudprotection',
disabledForAutogen: true,
},
{
basePath: 'dnc/resource-manager',
namespace: 'Microsoft.DelegatedNetwork',
disabledForAutogen: true,
},
{
basePath: 'dns/resource-manager',
namespace: 'Microsoft.Network',
disabledForAutogen: true,
},
{
basePath: 'edgeorder/resource-manager',
namespace: 'Microsoft.EdgeOrder',
disabledForAutogen: true,
},
{
basePath: 'edgeorderpartner/resource-manager',
namespace: 'Microsoft.EdgeOrderPartner',
disabledForAutogen: true,
},
{
basePath: 'extendedlocation/resource-manager',
namespace: 'Microsoft.ExtendedLocation',
disabledForAutogen: true,
},
{
basePath: 'fluidrelay/resource-manager',
namespace: 'Microsoft.FluidRelay',
disabledForAutogen: true,
},
{
basePath: 'iotsecurity/resource-manager',
namespace: 'Microsoft.IoTSecurity',
disabledForAutogen: true,
},
{
basePath: 'logic/resource-manager',
namespace: 'Microsoft.Logic',
disabledForAutogen: true,
},
{
basePath: 'm365securityandcompliance/resource-manager',
namespace: 'Microsoft.M365SecurityAndCompliance',
disabledForAutogen: true,
},
{
basePath: 'managedservices/resource-manager',
namespace: 'Microsoft.ManagedServices',
disabledForAutogen: true,
},
{
basePath: 'marketplacenotifications/resource-manager',
namespace: 'Microsoft.MarketplaceNotifications',
disabledForAutogen: true,
},
{
basePath: 'marketplaceordering/resource-manager',
namespace: 'Microsoft.MarketplaceOrdering',
disabledForAutogen: true,
},
{
basePath: 'mediaservices/resource-manager',
namespace: 'Microsoft.Media',
disabledForAutogen: true,
},
{
basePath: 'msi/resource-manager',
namespace: 'Microsoft.ManagedIdentity',
disabledForAutogen: true,
},
{
basePath: 'network/resource-manager',
namespace: 'Microsoft.Network',
disabledForAutogen: true,
},
{
basePath: 'operationsmanagement/resource-manager',
namespace: 'Microsoft.OperationsManagement',
disabledForAutogen: true,
},
{
basePath: 'privatedns/resource-manager',
namespace: 'Microsoft.Network',
disabledForAutogen: true,
},
{
basePath: 'providerhub/resource-manager',
namespace: 'Microsoft.ProviderHub',
disabledForAutogen: true,
},
{
basePath: 'purview/resource-manager',
namespace: 'Microsoft.Purview',
disabledForAutogen: true,
},
{
basePath: 'quota/resource-manager',
namespace: 'Microsoft.Quota',
disabledForAutogen: true,
},
{
basePath: 'resources/resource-manager',
namespace: 'Microsoft.Features',
disabledForAutogen: true,
},
{
basePath: 'resources/resource-manager',
namespace: 'Microsoft.Solutions',
disabledForAutogen: true,
},
{
basePath: 'securityandcompliance/resource-manager',
namespace: 'Microsoft.SecurityAndCompliance',
disabledForAutogen: true,
},
{
basePath: 'service-map/resource-manager',
namespace: 'Microsoft.OperationalInsights',
disabledForAutogen: true,
},
{
basePath: 'servicefabricmanagedclusters/resource-manager',
namespace: 'Microsoft.ServiceFabricManagedClusters',
disabledForAutogen: true,
},
{
basePath: 'testbase/resource-manager',
namespace: 'Microsoft.TestBase',
disabledForAutogen: true,
},
{
basePath: 'trafficmanager/resource-manager',
namespace: 'Microsoft.Network',
disabledForAutogen: true,
},
{
basePath: 'videoanalyzer/resource-manager',
namespace: 'Microsoft.Media',
disabledForAutogen: true,
},
{
basePath: 'webpubsub/resource-manager',
namespace: 'Microsoft.SignalRService',
disabledForAutogen: true,
},
];

// Run "npm run list-basepaths" to discover all the valid readme files to add to this list
const autoGenList: AutoGenConfig[] = [
...disabledProviders,
{
basePath: 'addons/resource-manager',
namespace: 'Microsoft.Addons',
Expand Down Expand Up @@ -268,10 +489,6 @@ const autoGenList: AutoGenConfig[] = [
basePath: 'EnterpriseKnowledgeGraph/resource-manager',
namespace: 'Microsoft.EnterpriseKnowledgeGraph',
},
/*{ NOTE(jcotillo): Temporally removing this RP - latest swagger contains an unsupported type by the schema generator tool
basePath: 'domainservices/resource-manager',
namespace: 'Microsoft.AAD',
},*/
{
basePath: 'eventhub/resource-manager',
namespace: 'Microsoft.EventHub',
Expand Down Expand Up @@ -827,13 +1044,25 @@ const autoGenList: AutoGenConfig[] = [
{
basePath: 'deviceupdate/resource-manager',
namespace: 'Microsoft.DeviceUpdate',
}
},
];

export function getAutoGenList(): AutoGenConfig[] {
return autoGenList;
}

export function findAutogenEntries(basePath: string): AutoGenConfig[] {
return autoGenList.filter(w => lowerCaseEquals(w.basePath, basePath));
}

export function findOrGenerateAutogenEntries(basePath: string, namespaces: string[]): AutoGenConfig[] {
const entries = findAutogenEntries(basePath).filter(e => namespaces.some(ns => lowerCaseEquals(e.namespace, ns)));

for (const namespace of namespaces) {
if (!entries.some(e => lowerCaseEquals(e.namespace, namespace))) {
// Generate configuration for any RPs not explicitly declared in the autogen list
entries.push({
basePath,
namespace,
});
}
}

return entries;
}
Loading