Skip to content

Commit fed0a29

Browse files
author
Sahil Arora
committed
Merge branch 'main' into update-azurefleet-useref-and-scvmm
2 parents 8066c15 + c02b366 commit fed0a29

File tree

1,299 files changed

+91520
-2941
lines changed

Some content is hidden

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

1,299 files changed

+91520
-2941
lines changed

.github/workflows/_reusable-eng-tools-test.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ on:
88
description: Name of package under eng/tools
99
required: true
1010
type: string
11+
sparse-checkout-paths:
12+
description: Paths for sparse checkout
13+
type: string
14+
lint:
15+
description: Run 'npm run lint' if true
16+
required: false
17+
type: boolean
18+
prettier:
19+
description: Run 'npm run prettier' if true
20+
required: false
21+
type: boolean
1122

1223
jobs:
1324
test:
@@ -24,9 +35,15 @@ jobs:
2435
runs-on: ${{ matrix.os }}
2536

2637
steps:
38+
- if: runner.os == 'Windows'
39+
run: git config --global core.longpaths true
40+
shell: pwsh
41+
2742
- uses: actions/checkout@v4
2843
with:
29-
sparse-checkout: eng
44+
sparse-checkout: |
45+
eng
46+
${{ inputs.sparse-checkout-paths }}
3047
3148
- name: Use Node ${{ matrix.node-version }}.x
3249
uses: actions/setup-node@v4
@@ -44,6 +61,16 @@ jobs:
4461
shell: pwsh
4562
working-directory: ./eng/tools/${{ inputs.package }}
4663

64+
- run: npm run lint
65+
if: inputs.lint == true
66+
shell: pwsh
67+
working-directory: ./eng/tools/${{ inputs.package }}
68+
69+
- run: npm run prettier
70+
if: inputs.prettier == true
71+
shell: pwsh
72+
working-directory: ./eng/tools/${{ inputs.package }}
73+
4774
- run: npm run test:ci
4875
shell: pwsh
4976
working-directory: ./eng/tools/${{ inputs.package }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Specs Model - Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- typespec-next
8+
pull_request:
9+
paths:
10+
- package-lock.json
11+
- package.json
12+
- tsconfig.json
13+
- .github/workflows/_reusable-eng-tools-test.yaml
14+
- .github/workflows/specs-model-test.yaml
15+
- eng/tools/package.json
16+
- eng/tools/tsconfig.json
17+
- eng/tools/specs-model/**
18+
workflow_dispatch:
19+
20+
jobs:
21+
specsModel:
22+
name: Specs Model
23+
uses: ./.github/workflows/_reusable-eng-tools-test.yaml
24+
with:
25+
package: specs-model
26+
lint: true
27+
prettier: true
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: tsp-client - Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
paths:
11+
- package-lock.json
12+
- package.json
13+
- tsconfig.json
14+
- .github/workflows/_reusable-eng-tools-test.yaml
15+
- .github/workflows/tsp-client-test.yaml
16+
- eng/tools/package.json
17+
- eng/tools/tsconfig.json
18+
- eng/tools/tsp-client/**
19+
- specification/keyvault
20+
- specification/sphere
21+
22+
jobs:
23+
tsp-client:
24+
uses: ./.github/workflows/_reusable-eng-tools-test.yaml
25+
with:
26+
package: tsp-client-tests
27+
sparse-checkout-paths: |
28+
specification/common-types
29+
specification/keyvault
30+
specification/sphere

.gitignore

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,18 @@ warnings.txt
116116
.apitest
117117
.assets
118118

119+
# Blanket ignores
119120
*.js
120121
*.d.ts
121122
*.js.map
122123
*.d.ts.map
123124
*.bak
124125

125126
# Eng Tools
126-
eng/tools/typespec-validation/dist
127-
!eng/tools/typespec-validation/cmd/*.js
127+
eng/tools/**/dist
128+
!eng/tools/**/cmd/*.js
129+
!eng/tools/**/eslint.config.js
130+
131+
# No package-lock.json files should be commited except the top-level.
132+
**/package-lock.json
133+
!/package-lock.json

cSpell.json

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,13 @@
398398
]
399399
},
400400
{
401-
"filename": "**/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2024-01-01/SystemEvents.json",
401+
"filename": "**/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2024-01-01/GeneratedSystemEvents.json",
402+
"words": [
403+
"whatsapp"
404+
]
405+
},
406+
{
407+
"filename": "**/specification/eventgrid/data-plane/Microsoft.EventGrid/stable/2018-01-01/GeneratedSystemEvents.json",
402408
"words": [
403409
"whatsapp"
404410
]
@@ -442,7 +448,8 @@
442448
{
443449
"filename": "**/specification/netapp/**/*.json",
444450
"words": [
445-
"SVMs"
451+
"SVMs",
452+
"kibibytes"
446453
]
447454
},
448455
{
@@ -1151,6 +1158,15 @@
11511158
"mpga"
11521159
]
11531160
},
1161+
{
1162+
"filename": "**/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/**/*.json",
1163+
"words": [
1164+
"flac",
1165+
"FLAC",
1166+
"mpga",
1167+
"rerank"
1168+
]
1169+
},
11541170
{
11551171
"filename": "**/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-01-01-preview/appplatform.json",
11561172
"words": [
@@ -1169,6 +1185,14 @@
11691185
"timerange"
11701186
]
11711187
},
1188+
{
1189+
"filename": "**/specification/healthdataaiservices/**/*.json",
1190+
"words": [
1191+
"deidentification",
1192+
"deidentify",
1193+
"surrogation"
1194+
]
1195+
},
11721196
{
11731197
"filename": "**/specification/search/data-plane/Azure.Search/**/*.json",
11741198
"words": [

eng/.vscode/settings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"[javascript]": {
4+
"editor.defaultFormatter": "esbenp.prettier-vscode"
5+
},
6+
"editor.formatOnPaste": false,
7+
"editor.formatOnType": false,
8+
"editor.formatOnSave": true,
9+
"editor.formatOnSaveMode": "file", // required to format on save
10+
"prettier.requireConfig": true,
11+
"cSpell.words": [
12+
"tseslint"
13+
]
14+
}

eng/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# `eng` directory
2+
3+
The `eng` directory contains source code for automated tooling running on this repository pull requests.
4+
5+
For context on this directory, see [Design guidelines for spec repos validation tooling] (Microsoft-internal).
6+
7+
## Code conventions
8+
9+
Below are code convention we strive to follow in `eng` directory:
10+
11+
### package.json
12+
13+
- We align `package.json` dependencies versions across all `package.json` files.
14+
- We align `package.json` dependencies numbers with [microsoft/typespec package.json].
15+
In few cases we allow more frequent update cadence.
16+
- We avoid doing package overrides. For example, we use `v8` of `eslint` instead of `v9` to avoid an override.
17+
[See this comment for details][eslint override].
18+
- We order `package.json` keys as follows: `name private type main bin scripts engines dependencies devDependencies`.
19+
20+
### package-lock.json
21+
22+
- We maintain only top-level `package-lock.json` file. Running `npm install` from top-level dir removes the need
23+
to ever have other files.
24+
- We ensure the lock file remains clean by ensuring that a PR that adds or modifies any `package.json` dependencies,
25+
makes changes equivalent to following protocol:
26+
- `cd <local-specs-clone-root>`
27+
- `git clean -xdf` to remove all untracked files.
28+
- Copy-over [`package-lock.json` from `main`] to local clone.
29+
- `npm install` to reflect the added or modified dependencies.
30+
- In case any dependencies have been removed from any `package.json`, we do `rm package-lock.json` and `npm install`.
31+
This way we ensure the lock file remains free of unused dependencies.
32+
- We do `npm update` only in stand-alone PRs.
33+
- To avoid conflicting changes when updating `package-lock.json`, only use the latest LTS version of Node, and the bundled version of npm (but no newer). You can use `nvm install --lts` (Linux) or `nvm install lts` (Windows).
34+
35+
## Linting and prettier
36+
37+
- We make eslint-based linting rules and prettier mandatory in CI for all projects.
38+
- We use strict rulesets as baseline.
39+
- We discuss any desired rule divergences from the strict ruleset
40+
and apply rule modifications to the configs with explanation for our decision.
41+
- We align `prettier` rules with [microsoft/typespec .prettierrc.json].
42+
43+
[`package-lock.json` from `main`]: https://github.com/Azure/azure-rest-api-specs/blob/main/package-lock.json
44+
[Design guidelines for spec repos validation tooling]: https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/1153/Design-guidelines-for-spec-repos-validation-tooling
45+
[eslint override]: https://github.com/Azure/azure-rest-api-specs/pull/29820#pullrequestreview-2177045580
46+
[microsoft/typespec .prettierrc.json]: https://github.com/microsoft/typespec/blob/main/.prettierrc.json
47+
[microsoft/typespec package.json]: https://github.com/microsoft/typespec/blob/main/package.json
48+
[npm/cli #7384]: https://github.com/npm/cli/issues/7384

eng/tools/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"name": "azure-rest-api-specs-eng-tools",
33
"devDependencies": {
4+
"@azure-tools/specs-model": "file:specs-model",
45
"@azure-tools/suppressions": "file:suppressions",
6+
"@azure-tools/tsp-client-tests": "file:tsp-client-tests",
57
"@azure-tools/typespec-requirement": "file:typespec-requirement",
68
"@azure-tools/typespec-validation": "file:typespec-validation"
79
},
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.json
2+
*.md
3+
*.jsonc
4+
dist
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// This config is adapted from https://github.com/microsoft/typespec/blob/main/.prettierrc.json
2+
// See eng/README.md for context.
3+
/**
4+
* @see https://prettier.io/docs/en/configuration.html
5+
* @type {import("prettier").Config}
6+
*/
7+
const config = {
8+
arrowParens: "always",
9+
trailingComma: "es5",
10+
bracketSpacing: true,
11+
endOfLine: "lf",
12+
printWidth: 100,
13+
semi: true,
14+
singleQuote: false,
15+
tabWidth: 2,
16+
};
17+
18+
export default config;

0 commit comments

Comments
 (0)