Skip to content

Commit fba339f

Browse files
Merge remote-tracking branch 'origin/main' into Kusto/auto-generate
2 parents e18f2ba + 49dd421 commit fba339f

File tree

368 files changed

+365409
-52424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

368 files changed

+365409
-52424
lines changed

.github/workflows/autogenerateBatch0.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Generate Types
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
api_specs_ref:
7+
description: 'Git ref or full SHA for https://github.com/Azure/azure-rest-api-specs.'
8+
required: true
9+
default: 'main'
10+
single_path:
11+
description: 'The path to generate types for (e.g. "compute", or "keyvault"). Leave blank to generate all types.'
12+
required: false
13+
14+
jobs:
15+
update-types:
16+
name: Update Types
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v2.3.4
21+
22+
- name: Clone azure-rest-api-specs
23+
uses: actions/checkout@v2.3.4
24+
with:
25+
repository: Azure/azure-rest-api-specs
26+
path: workflow-temp/azure-rest-api-specs
27+
ref: ${{ github.event.inputs.api_specs_ref }}
28+
29+
- name: Install generator npm packages
30+
run: npm ci
31+
working-directory: generator
32+
33+
- id: generate
34+
name: Run generator
35+
run: |
36+
if [ -z "${{ github.event.inputs.single_path }}" ]
37+
then
38+
npm run generate-all -- '{"localPath": "$GITHUB_WORKSPACE/workflow-temp/azure-rest-api-specs"}'
39+
else
40+
npm run generate-single -- '${{ github.event.inputs.single_path }}/resource-manager' '$GITHUB_WORKSPACE/workflow-temp/azure-rest-api-specs'
41+
fi
42+
working-directory: generator
43+
44+
- id: get_swagger_gh_uri
45+
name: Get GitHub URI for azure-rest-api-specs
46+
run: |
47+
git_sha=`git rev-parse HEAD`
48+
echo "::set-output name=gh_uri::https://github.com/Azure/azure-rest-api-specs/tree/$git_sha"
49+
working-directory: workflow-temp/azure-rest-api-specs
50+
51+
- name: Create Pull Request
52+
uses: peter-evans/create-pull-request@v3.10.1
53+
with:
54+
committer: GitHub <noreply@github.com>
55+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
56+
signoff: false
57+
branch: autogenerate
58+
branch-suffix: short-commit-hash
59+
delete-branch: true
60+
title: |
61+
Update Generated Types ${{ github.event.inputs.single_path && format('(single path: {0})', github.event.inputs.single_path) || '' }}
62+
body: |
63+
Update Generated Types ${{ github.event.inputs.single_path && format('(single path: {0})', github.event.inputs.single_path) || '' }}
64+
65+
Generate types for ${{ steps.get_swagger_gh_uri.outputs.gh_uri }}
66+
commit-message: |
67+
Update Generated Types ${{ github.event.inputs.single_path && format('(single path: {0})', github.event.inputs.single_path) || '' }}
68+
69+
Generate types for ${{ steps.get_swagger_gh_uri.outputs.gh_uri }}
70+
labels: autogenerate
71+
draft: false

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CI
22

33
on:
44
pull_request:
5-
branches: [ master ]
5+
branches: [ main ]
66
jobs:
77
build:
88
runs-on: ubuntu-latest

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ schemas/code-model-v1
88
Debug
99
Release
1010
obj
11-
bin
11+
bin
12+
13+
# Temporary directory for GitHub workflows to use
14+
/workflow-temp

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ Once this is running, you can create a basic template with the following structu
7878
To get quickly notified on GitHub issues for your RP's schema, please update the [rp-label-to-contact.md](/rp-label-to-contact.md) by submitting a PR with the desired GitHub handle(s) and label for your RP.
7979

8080
---
81-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
81+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.

azure-pipelines-autogen.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ jobs:
4646
set -Eeuxo pipefail
4747
git checkout $(Build.SourceBranchName)
4848
git pull
49-
git merge --no-commit --no-ff --strategy-option=theirs origin/master
49+
git merge --no-commit --no-ff --strategy-option=theirs origin/main
5050
if ! git diff-index --quiet HEAD --; then
51-
git commit -m "Merge remote-tracking branch 'origin/master' into $(Build.SourceBranchName)"
51+
git commit -m "Merge remote-tracking branch 'origin/main' into $(Build.SourceBranchName)"
5252
git push origin $(Build.SourceBranchName)
5353
fi
54-
displayName: Integrate master branch
54+
displayName: Integrate main branch
5555
5656
- script: |
5757
set -Eeuxo pipefail

generator/README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,19 @@ View the Pipeline Configuration [here](/azure-pipelines-autogen.yml).
2828
#### Merging Pipeline-generated schemas
2929

3030
1. Review the status badge on this page to ensure the latest run was successful.
31-
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).
31+
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).
3232
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).
3333

3434
#### Onboarding to the autogeneration pipeline
35-
36-
1. Follow the steps listed under [Getting Started](#getting-started). The following commands assume you are running in the `generator` directory.
37-
3. Run `npm run list-basepaths` to discover the specs repo path containing the swagger definitions.
38-
4. Run `npm run generate-single {basePath}` to generate schemas for them. Save the console output to file.
39-
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).
40-
6. Add the {basePath} to the autogenlist array in [autogenlist.ts](./autogenlist.ts).
41-
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.
42-
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.
35+
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.
36+
37+
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.
38+
39+
> The following steps are no longer necessary for onboarding, but listed here for reference:
40+
> 1. Follow the steps listed under [Getting Started](#getting-started). The following commands assume you are running in the > `generator` directory.
41+
> 3. Run `npm run list-basepaths` to discover the specs repo path containing the swagger definitions.
42+
> 4. Run `npm run generate-single {basePath}` to generate schemas for them. Save the console output to file.
43+
> 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).
44+
> 6. Add the {basePath} to the autogenlist array in [autogenlist.ts](./autogenlist.ts).
45+
> 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.
46+
> 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.

0 commit comments

Comments
 (0)