Skip to content

Commit 220a98e

Browse files
Merge remote-tracking branch 'origin/main' into dependabot/npm_and_yarn/tools/vscode-json-languageservice-5.3.5
2 parents 4e35782 + d5391e2 commit 220a98e

File tree

517 files changed

+950368
-24691
lines changed

Some content is hidden

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

517 files changed

+950368
-24691
lines changed

.github/fabricbot.json

Lines changed: 0 additions & 1041 deletions
This file was deleted.

.github/policies/resourceManagement.yml

Lines changed: 649 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/generate-schemas-batch.yml

Lines changed: 0 additions & 225 deletions
This file was deleted.
Lines changed: 79 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,109 @@
11
name: Generate Schemas
22

33
on:
4+
schedule:
5+
- cron: '45 5 * * TUE,THU'
46
workflow_dispatch:
57
inputs:
68
api_specs_ref:
79
description: 'Git ref or full SHA for https://github.com/Azure/azure-rest-api-specs.'
810
required: true
911
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
12+
13+
env:
14+
# This must be kept in sync with the arguments passed to the "batch" matrix
15+
BATCH_COUNT: 20
1316

1417
jobs:
15-
update-schemas:
16-
name: Update Schemas
18+
generate:
19+
name: Update Schemas Batch ${{ matrix.batch }}
1720
runs-on: ubuntu-latest
18-
21+
strategy:
22+
matrix:
23+
batch: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
1924
steps:
20-
- uses: actions/[email protected]
25+
- name: Checkout repo
26+
uses: actions/checkout@v3
2127

2228
- name: Clone azure-rest-api-specs
23-
uses: actions/checkout@v2.3.5
29+
uses: actions/checkout@v3
2430
with:
2531
repository: Azure/azure-rest-api-specs
2632
path: workflow-temp/azure-rest-api-specs
2733
ref: ${{ github.event.inputs.api_specs_ref }}
34+
35+
- name: Setup Node.js
36+
uses: actions/setup-node@v4
37+
with:
38+
node-version: 16.x
2839

2940
- name: Install generator npm packages
3041
run: npm ci
3142
working-directory: generator
32-
33-
- id: generate
34-
name: Run generator
43+
44+
- name: Run generator
3545
run: |
36-
if [ -z "${{ github.event.inputs.single_path }}" ]
37-
then
38-
npm run generate-all -- --local-path "$GITHUB_WORKSPACE/workflow-temp/azure-rest-api-specs"
39-
else
40-
npm run generate-single -- --base-path '${{ github.event.inputs.single_path }}/resource-manager' --local-path "$GITHUB_WORKSPACE/workflow-temp/azure-rest-api-specs"
41-
fi
46+
rm -Rf "$GITHUB_WORKSPACE/schemas"
47+
rm -Rf "$GITHUB_WORKSPACE/summary.log"
48+
mkdir -p "$GITHUB_WORKSPACE/schemas"
49+
50+
npm run generate-all -- \
51+
--specs-dir "$GITHUB_WORKSPACE/workflow-temp/azure-rest-api-specs" \
52+
--batch-count ${{ env.BATCH_COUNT }} \
53+
--batch-index ${{ matrix.batch }} \
54+
--summary-log-path "$GITHUB_WORKSPACE/summary.log" \
55+
--combine-batch-mode true
4256
working-directory: generator
4357

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
58+
- name: Upload Schemas
59+
uses: actions/upload-artifact@v3
60+
with:
61+
name: batch-${{ matrix.batch }}-schemas
62+
path: schemas
63+
if-no-files-found: error
5064

51-
- name: Create Pull Request
52-
uses: peter-evans/[email protected]
65+
- name: Upload summary log
66+
uses: actions/upload-artifact@v3
5367
with:
54-
committer: GitHub <[email protected]>
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) || '' }}
68+
name: batch-${{ matrix.batch }}-summary
69+
path: summary.log
70+
if-no-files-found: error
6471

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) || '' }}
72+
combine:
73+
needs: generate
74+
name: Combine Schema Batches
75+
permissions:
76+
contents: write
77+
runs-on: ubuntu-latest
78+
steps:
79+
- name: Checkout repo
80+
uses: actions/checkout@v3
6881

69-
Generate types for ${{ steps.get_swagger_gh_uri.outputs.gh_uri }}
70-
labels: autogenerate
71-
draft: false
82+
- name: Download batch results
83+
uses: actions/download-artifact@v3
84+
with:
85+
path: workflow-temp
86+
87+
- name: Setup Node.js
88+
uses: actions/setup-node@v4
89+
with:
90+
node-version: 16.x
91+
92+
- name: Install generator npm packages
93+
run: npm ci
94+
working-directory: generator
95+
96+
- name: Combine batches
97+
run: |
98+
npm run combine-batches -- \
99+
--input-path "$GITHUB_WORKSPACE/workflow-temp" \
100+
--batch-count ${{ env.BATCH_COUNT }}
101+
working-directory: generator
102+
103+
- name: Push to autogenerate-batch branch
104+
uses: stefanzweifel/git-auto-commit-action@v5
105+
with:
106+
commit_message: Update Generated Schemas
107+
branch: autogenerate-batch
108+
push_options: '--force'
109+
create_branch: true

0 commit comments

Comments
 (0)