Skip to content

Commit

Permalink
Merge branch 'Azure:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
bowgong authored Jul 31, 2024
2 parents 73ffaaf + c1a4465 commit c0734f0
Show file tree
Hide file tree
Showing 2,966 changed files with 328,386 additions and 14,464 deletions.
24 changes: 12 additions & 12 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
/specification/applicationinsights/data-plane/Monitor.Exporters/ @ramthi @trask @hectorhdzg @lzchen @Azure/api-stewardship-board

# PRLabel: %Container Apps
/specification/app/ @jijohn14 @Juliehzl
/specification/app/ @Juliehzl

# PRLabel: %Code Signing
/specification/codesigning/data-plane @Azure/api-stewardship-board
Expand All @@ -62,7 +62,7 @@
/specification/billing/ @wilcobmsft @asarkar84

# PRLabel: %Network - CDN
/specification/cdn/ @jorinmejia @yunhemsft @jessicl-ms @rrahulms @t-bzhan @ChenglongLiu
/specification/cdn/ @jorinmejia @yunhemsft @jessicl-ms @rrahulms @ChenglongLiu @Ptnan7

# PRLabel: %Cognitive Services
/specification/cognitiveservices/ @felixwa @yangyuan
Expand Down Expand Up @@ -275,13 +275,13 @@
###########
# Eng Sys
###########
/.gitattributes @weshaggard @mikeharder @konrad-jamrozik
/.gitignore @weshaggard @mikeharder @konrad-jamrozik
/.prettierrc.json @weshaggard @mikeharder @konrad-jamrozik
/package-lock.json @weshaggard @mikeharder @konrad-jamrozik
/package.json @weshaggard @mikeharder @konrad-jamrozik
/tsconfig.json @weshaggard @mikeharder @konrad-jamrozik
/.azure-pipelines/ @weshaggard @mikeharder @konrad-jamrozik @benbp
/.github/ @weshaggard @mikeharder @konrad-jamrozik @benbp
/eng/ @weshaggard @mikeharder @konrad-jamrozik @benbp
/scripts/ @weshaggard @mikeharder @konrad-jamrozik
/.gitattributes @weshaggard @mikeharder
/.gitignore @weshaggard @mikeharder
/.prettierrc.json @weshaggard @mikeharder
/package-lock.json @weshaggard @mikeharder
/package.json @weshaggard @mikeharder
/tsconfig.json @weshaggard @mikeharder
/.azure-pipelines/ @weshaggard @mikeharder @benbp
/.github/ @weshaggard @mikeharder @benbp
/eng/ @weshaggard @mikeharder @benbp
/scripts/ @weshaggard @mikeharder
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/control_plane_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If one or multiple validation error/warning suppression(s) is detected in your P
## Getting help

- First, please carefully read through this PR description, from top to bottom. Please fill out the `Purpose of this PR` and `Due diligence checklist`.
- If you don't have permissions to remove or add labels to the PR, request `write access` per [aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories](https://aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories")
- If you don't have permissions to remove or add labels to the PR, request `write access` per [aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories](https://aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories)
- To understand what you must do next to merge this PR, see the `Next Steps to Merge` comment. It will appear within few minutes of submitting this PR and will continue to be up-to-date with current PR state.
- For guidance on fixing this PR CI check failures, see the hyperlinks provided in given failure
and https://aka.ms/ci-fix.
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/data_plane_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The [Azure API Review Board](https://aka.ms/azsdk/onboarding/restapischedule) is
## Getting help

- First, please carefully read through this PR description, from top to bottom.
- If you don't have permissions to remove or add labels to the PR, request `write access` per [aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories](https://aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories")
- If you don't have permissions to remove or add labels to the PR, request `write access` per [aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories](https://aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories)
- To understand what you must do next to merge this PR, see the `Next Steps to Merge` comment. It will appear within few minutes of submitting this PR and will continue to be up-to-date with current PR state.
- For guidance on fixing this PR CI check failures, see the hyperlinks provided in given failure
and https://aka.ms/ci-fix.
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/typespec-requirement.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ jobs:
with:
node-version: 20.0

- run: npm --version --loglevel info

- run: npm ci

- run: npm ls -a
Expand Down
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,15 @@ eng/tools/**/dist
# No package-lock.json files should be commited except the top-level.
**/package-lock.json
!/package-lock.json

# No Armstrong outputs should be commited except the tf files.
**/terraform/**/*.json
**/terraform/**/*.md
**/terraform/**/*.html
**/terraform/**/*.txt
**/terraform/**/*.hcl
**/terraform/**/*.tfstate
**/terraform/**/*.backup
**/terraform/**/tfplan
**/terraform/**/.terraform
!**/terraform/**/*.tf
7 changes: 0 additions & 7 deletions arm-compute/quickstart-templates/aliases.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,6 @@
"sku": "2012-Datacenter",
"version": "latest",
"architecture": "x64"
},
"Win2008R2SP1": {
"publisher": "MicrosoftWindowsServer",
"offer": "WindowsServer",
"sku": "2008-R2-SP1",
"version": "latest",
"architecture": "x64"
}
}
}
Expand Down
34 changes: 32 additions & 2 deletions cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,8 @@
{
"filename": "**/specification/netapp/**/*.json",
"words": [
"SVMs"
"SVMs",
"kibibytes"
]
},
{
Expand Down Expand Up @@ -1022,6 +1023,12 @@
"Messsage"
]
},
{
"filename": "**/specification/postgresql/resource-manager/Microsoft.DBforPostgreSQL/preview/**/*json",
"words": [
"automigration"
]
},
{
"filename": "**/specification/cognitiveservices/data-plane/FormRecognizer/**/FormRecognizer.json",
"words": [
Expand Down Expand Up @@ -1113,7 +1120,12 @@
"Groundedness",
"AOAI",
"testconnection",
"aoai"
"aoai",
"SecretExpiry",
"expirableSecret",
"expireAfterHours",
"expire",
"expirable"
]
},
{
Expand Down Expand Up @@ -1157,6 +1169,15 @@
"mpga"
]
},
{
"filename": "**/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/**/*.json",
"words": [
"flac",
"FLAC",
"mpga",
"rerank"
]
},
{
"filename": "**/specification/appplatform/resource-manager/Microsoft.AppPlatform/preview/2024-01-01-preview/appplatform.json",
"words": [
Expand All @@ -1166,6 +1187,7 @@
{
"filename": "**/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/**/*.json",
"words": [
"keyvaultkeyuri",
"throughputpool"
]
},
Expand All @@ -1175,6 +1197,14 @@
"timerange"
]
},
{
"filename": "**/specification/healthdataaiservices/**/*.json",
"words": [
"deidentification",
"deidentify",
"surrogation"
]
},
{
"filename": "**/specification/search/data-plane/Azure.Search/**/*.json",
"words": [
Expand Down
7 changes: 6 additions & 1 deletion custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,8 @@ corda
coreml
corent
cortana
Correlationid
correlationid
cosell
cosmosdb
costcenter
Expand Down Expand Up @@ -721,6 +723,7 @@ ddos
ddthh
deadletter
deadlettered
deadlinetype
deallocate
deallocated
deallocates
Expand Down Expand Up @@ -1613,6 +1616,7 @@ localmachine
localmapview
localrun
localsearch
locationparameter
lockdown
logalert
logalertv1metricmeasurement
Expand Down Expand Up @@ -2061,6 +2065,7 @@ openstack
openxmlformats
operationalinsights
operationalization
operationids
operationresults
operationsmanagement
operationstatus
Expand Down Expand Up @@ -4059,4 +4064,4 @@ tpurgent
virtualnetworkaddressname
VMBM
Vmdb
VNIC
VNIC
1 change: 0 additions & 1 deletion documentation/ci-fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ If you have an issue or with any of checks listed in the first column of the tab
| `SDK azure-sdk-for-net` | Wei Hu |
| `SDK azure-sdk-for-net-track2` | Wei Hu |
| `SDK azure-sdk-for-python` | Yuchao Yan |
| `SDK azure-sdk-for-python-track2` | Yuchao Yan |

Do the following:

Expand Down
4 changes: 2 additions & 2 deletions documentation/onboard-dpg-in-sdkautomation/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ See [Use SDK Automation from REST API specifications](https://github.com/Azure/a
package-dir: "azure-ai-openai"
flavor: azure
namespace: "com.azure.ai.openai"
examples-directory: "examples"
examples-directory: "{project-root}/examples"
```
## Example for Java management-plane SDK
Expand All @@ -33,7 +33,7 @@ See [Use SDK Automation from REST API specifications](https://github.com/Azure/a
flavor: "azure"
namespace: "com.azure.resourcemanager.standbypool"
service-name: "Standby Pool"
examples-directory: "examples"
examples-directory: "{project-root}/examples"
```

# Add AutoRest Configuration for Java SDK
Expand Down
20 changes: 20 additions & 0 deletions documentation/sdkautomation/GenerateOutputSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@
"type": "string"
}
},
"typespecProject": {
// List of related typespec project of this package.
"type": "array",
"items": {
"type": "string"
}
},
"language": {
"type": "string"
},
"apiViewArtifact": {
"type": "string"
},
"changelog": {
"type": "object",
"properties": {
Expand All @@ -56,6 +69,13 @@
"hasBreakingChange": {
// Does the new package has breaking change
"type": "boolean"
},
"breakingChangeItems": {
// The breaking change details quote from the changelog
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
Expand Down
64 changes: 39 additions & 25 deletions eng/tools/suppressions/src/suppressions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Stats } from "fs";
import { access, constants, lstat, readFile } from "fs/promises";
import { minimatch } from "minimatch";
import { dirname, join, resolve, sep } from "path";
Expand Down Expand Up @@ -37,12 +38,13 @@ const suppressionSchema = z.array(
paths: paths,
reason: s.reason,
} as Suppression;
})
}),
);

/**
* Returns the suppressions for a tool applicable to a path. Walks up the directory tree to the first file named
* Returns the suppressions for a tool applicable to a path. Walks up the directory tree to find all files named
* "suppressions.yaml", parses and validates the contents, and returns the suppressions matching the tool and path.
* Suppressions are ordered by file (closest to path is first), then within the file (closest to top is first).
*
* @param tool Name of tool. Matched against property "tool" in suppressions.yaml.
* @param path Path to file or directory under analysis.
Expand All @@ -68,17 +70,21 @@ export async function getSuppressions(tool: string, path: string): Promise<Suppr
// If path doesn't exist, throw instead of returning "[]" to prevent confusion
await access(path, constants.R_OK);

let suppressionsFile: string | undefined = await findSuppressionsYaml(path);
if (suppressionsFile) {
return getSuppressionsFromYaml(
tool,
path,
suppressionsFile,
await readFile(suppressionsFile, { encoding: "utf8" })
let suppressionsFiles: string[] = await findSuppressionsFiles(path);
let suppressions: Suppression[] = [];

for (let suppressionsFile of suppressionsFiles) {
suppressions = suppressions.concat(
getSuppressionsFromYaml(
tool,
path,
suppressionsFile,
await readFile(suppressionsFile, { encoding: "utf8" }),
),
);
} else {
return [];
}

return suppressions;
}

/**
Expand Down Expand Up @@ -112,7 +118,7 @@ export function getSuppressionsFromYaml(
tool: string,
path: string,
suppressionsFile: string,
suppressionsYaml: string
suppressionsYaml: string,
): Suppression[] {
path = resolve(path);
suppressionsFile = resolve(suppressionsFile);
Expand Down Expand Up @@ -144,39 +150,47 @@ export function getSuppressionsFromYaml(
}

/**
* Returns absolute path to suppressions.yaml applying to input (or "undefined" if none found).
* Walks up directory tree until first file matching "suppressions.yaml".
* Returns absolute paths to all suppressions.yaml files applying to input (or "undefined" if none found).
* Walks up directory tree, returning all files matching "suppressions.yaml", in order (may be empty);
*
* @param path Path to file under analysis.
*
* @example
* ```
* // Prints '/home/user/specs/specification/foo/suppressions.yaml':
* // Prints
* // '/home/user/specs/specification/foo/suppressions.yaml'
* // '/home/user/specs/specification/suppressions.yaml
* console.log(findSuppressionsYaml(
* "specification/foo/data-plane/Foo/stable/2024-01-01/foo.json"
* ));
* ```
*/
async function findSuppressionsYaml(path: string): Promise<string | undefined> {
async function findSuppressionsFiles(path: string): Promise<string[]> {
const suppressionsFiles: string[] = [];

path = resolve(path);

const stats = await lstat(path);
const stats: Stats = await lstat(path);
let currentDirectory: string = stats.isDirectory() ? path : dirname(path);

while (true) {
const suppressionsFile: string = join(currentDirectory, "suppressions.yaml");
try {
// Throws if file cannot be read
await access(suppressionsFile, constants.R_OK);
return suppressionsFile;
suppressionsFiles.push(suppressionsFile);
} catch {
const parentDirectory: string = dirname(currentDirectory);
if (parentDirectory !== currentDirectory) {
currentDirectory = parentDirectory;
} else {
// Reached fs root but no "suppressions.yaml" found
return;
}
// File does not exist (or cannot be read), so skip this directory and check the parent
}

const parentDirectory: string = dirname(currentDirectory);
if (parentDirectory !== currentDirectory) {
currentDirectory = parentDirectory;
} else {
// Reached fs root
break;
}
}

return suppressionsFiles;
}
Empty file.
Empty file.
Loading

0 comments on commit c0734f0

Please sign in to comment.