Skip to content

Commit

Permalink
Merge branch 'master' into Network-September-Release
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
#	specification/authorization/resource-manager/readme.nodejs.md
#	specification/batch/data-plane/Microsoft.Batch/stable/2018-08-01.7.0/BatchService.json
#	specification/batch/data-plane/readme.md
#	specification/batch/data-plane/readme.nodejs.md
#	specification/batchai/resource-manager/readme.nodejs.md
#	specification/dns/resource-manager/readme.nodejs.md
#	specification/network/resource-manager/readme.md
#	specification/notificationhubs/resource-manager/readme.nodejs.md
#	specification/storage/resource-manager/readme.nodejs.md
#	specification/storagesync/resource-manager/readme.nodejs.md
  • Loading branch information
MikhailTryakhov committed Sep 11, 2018
2 parents e6195d0 + 65f8714 commit cae1d45
Show file tree
Hide file tree
Showing 824 changed files with 70,157 additions and 1,457 deletions.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
/specification/sql/ @dnayantara @jaredmoo @nathannfan
/specification/storage/ @jasonyang-msft @stankovski
/specification/storageimportexport/ @leoz-ms
/specification/storagesync/ @ankushbindlish2
/specification/storsimple8000series/ @manaas-microsoft
/specification/streamanalytics/ @atpham256
/specification/subscriptions/ @stankovski
Expand Down
2 changes: 1 addition & 1 deletion documentation/swagger-checklist.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Swagger Checklist for Microsoft Azure #
# Swagger Checklist for Microsoft Azure #

## Introduction ##

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"json-schema-ref-parser": "^3.1.2",
"mocha": "*",
"oad": "^0.1.11",
"oav": "^0.5.1",
"oav": "^0.5.2",
"request": "^2.61.0",
"request-promise-native": "^1.0.5",
"z-schema": "^3.16.1"
Expand Down
65 changes: 51 additions & 14 deletions scripts/momentOfTruthPostProcessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ function getLogDir() {

let githubTemplate = (title, contact_message, file_summaries) => `# AutoRest linter results for ${title}\n${contact_message}\n\n${file_summaries}`;

let tooManyResults = "# Result limit exceeded, check build output\n" +
"The linter diff produced too many results to display here. Please view the build output to see the results. " +
"For help with SDK-related validation Errors / Warnings, reach out to [ADX Swagger Reviewers](mailto:adxsr@microsoft.com). " +
"For help with ARM-related validation Errors / Warnings, reach out to [ARM RP API Review](mailto:armrpapireview@microsoft.com).\n\n" +
`### [View Build Output](https://travis-ci.org/${process.env.TRAVIS_REPO_SLUG}/jobs/${process.env.TRAVIS_JOB_ID})`;

let githubFooter = `[AutoRest Linter Guidelines](https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md) | ` +
`[AutoRest Linter Issues](https://github.com/Azure/azure-openapi-validator/issues) | ` +
`Send ${emailLink("feedback", "azure-swag-tooling@microsoft.com", "Feedback | AutoRest Linter Diff Tool")}` +
Expand All @@ -33,13 +39,18 @@ let potentialNewWarningErrorSummaryHeader = `
|-|------|----------|---------|
`;

let potentialNewWarningErrorSummary = (count, warning_error_id, warning_error_code, warning_error_file, warning_error_line, warning_error_message) =>
let potentialNewWarningErrorSummaryMarkdown = (count, warning_error_id, warning_error_code, warning_error_file, warning_error_line, warning_error_message) =>
`|${count}|[${warning_error_id} - ${warning_error_code}](https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md#${warning_error_id})|` +
`[${shortName(warning_error_file)}:${warning_error_line}](${blobHref(warning_error_file)}#L${warning_error_line} "${warning_error_file}")|` +
`${warning_error_message}|\n`;

let sdkContactMessage = "These errors are reported by the SDK team's validation tools, reachout to [ADX Swagger Reviewers](mailto:adxsr@microsoft.com) directly for any questions or concerns.";
let armContactMessage = "These errors are reported by the ARM team's validation tools, reachout to [ARM RP API Review](mailto:armrpapireview@microsoft.com) directly for any questions or concerns.";
let potentialNewWarningErrorSummaryPlain = (count, warning_error_id, warning_error_code, warning_error_file, warning_error_line, warning_error_message) =>
`${warning_error_id} - ${warning_error_code}\n` +
`${warning_error_message}\n` +
` at ${warning_error_file}:${warning_error_line}\n\n`;

let sdkContactMessage = "These errors are reported by the SDK team's validation tools, reach out to [ADX Swagger Reviewers](mailto:adxsr@microsoft.com) directly for any questions or concerns.";
let armContactMessage = "These errors are reported by the ARM team's validation tools, reach out to [ARM RP API Review](mailto:armrpapireview@microsoft.com) directly for any questions or concerns.";
let sdkFileSummaries = '', armFileSummaries = '';

let data = undefined;
Expand Down Expand Up @@ -161,8 +172,8 @@ function blobHref(file) {
return `https://github.com/${process.env.TRAVIS_PULL_REQUEST_SLUG}/blob/${process.env.TRAVIS_PULL_REQUEST_SHA}/${file}`;
}

function getFileSummaryTable(issues, prNumber) {
let potentialNewIssues = potentialNewWarningErrorSummaryHeader;
function getFileSummaryTable(issues, header, formatter) {
let potentialNewIssues = header;

issues.sort((a, b) => {
if (!a.filePath) {
Expand Down Expand Up @@ -191,7 +202,7 @@ function getFileSummaryTable(issues, prNumber) {
issue.lineNumber = getLine(issue.jsonref) || "1";
}

potentialNewIssues += potentialNewWarningErrorSummary(
potentialNewIssues += formatter(
count + 1,
issue.id,
issue.code,
Expand All @@ -204,27 +215,27 @@ function getFileSummaryTable(issues, prNumber) {
return potentialNewIssues;
}

function getFileSummary(issueType, fileName, existingWarnings, existingErrors, newWarnings, newErrors, prNumber) {
function getFileSummary(issueType, fileName, existingWarnings, existingErrors, newWarnings, newErrors) {
let fileSummary = "";

if (newErrors.length > 0) {
fileSummary += fileSummaryNewTemplate(`${issueType} Error`, newErrors.length, getFileSummaryTable(newErrors, prNumber));
fileSummary += fileSummaryNewTemplate(`${issueType} Error`, newErrors.length, getFileSummaryTable(newErrors, potentialNewWarningErrorSummaryHeader, potentialNewWarningErrorSummaryMarkdown));
}

if (existingErrors.length > 0) {
fileSummary += fileSummaryExistingTemplate(`${issueType} Error`, existingErrors.length, getFileSummaryTable(existingErrors, prNumber));
fileSummary += fileSummaryExistingTemplate(`${issueType} Error`, existingErrors.length, getFileSummaryTable(existingErrors, potentialNewWarningErrorSummaryHeader, potentialNewWarningErrorSummaryMarkdown));
}

if (fileSummary !== "") {
fileSummary += "<br>\n\n";
}

if (newWarnings.length > 0) {
fileSummary += fileSummaryNewTemplate(`${issueType} Warning`, newWarnings.length, getFileSummaryTable(newWarnings, prNumber));
fileSummary += fileSummaryNewTemplate(`${issueType} Warning`, newWarnings.length, getFileSummaryTable(newWarnings, potentialNewWarningErrorSummaryHeader, potentialNewWarningErrorSummaryMarkdown));
}

if (existingWarnings.length > 0) {
fileSummary += fileSummaryExistingTemplate(`${issueType} Warning`, existingWarnings.length, getFileSummaryTable(existingWarnings, prNumber));
fileSummary += fileSummaryExistingTemplate(`${issueType} Warning`, existingWarnings.length, getFileSummaryTable(existingWarnings, potentialNewWarningErrorSummaryHeader, potentialNewWarningErrorSummaryMarkdown));
}

if (fileSummary !== "") {
Expand Down Expand Up @@ -252,6 +263,8 @@ function emailLink(title, addr, subject = "", body = "") {
function postProcessing() {
let newSDKErrorsCount = 0, newARMErrorsCount = 0, newSDKWarningsCount = 0, newARMWarningsCount = 0;

console.log("\n---------- Linter Diff Results ----------\n")

if (!jsonData) {
const reportLink = emailLink(
"report this failure",
Expand Down Expand Up @@ -324,6 +337,7 @@ function postProcessing() {
compareBeforeAfterArrays(afterWarningsARMArray, beforeWarningsARMArray, existingARMWarnings, newARMWarnings);
compareBeforeAfterArrays(afterWarningsSDKArray, beforeWarningsSDKArray, existingSDKWarnings, newSDKWarnings);

console.log(`Config file: ${fileName}\n`)
console.log("SDK Errors/Warnings");
console.log("===================");
console.log("Errors: Before: ", beforeErrorsSDKArray.length, " - After: ", afterErrorsSDKArray.length);
Expand All @@ -342,24 +356,47 @@ function postProcessing() {
console.log("Existing ARM Errors: ", existingARMErrors.length);
console.log("Existing ARM Warnings: ", existingARMWarnings.length);
console.log();
if (newSDKErrors.length > 0) {
console.log(`Potential new SDK errors`)
console.log("========================");
console.log(getFileSummaryTable(newSDKErrors, "", potentialNewWarningErrorSummaryPlain));
}
if (newSDKWarnings.length > 0) {
console.log(`Potential new SDK warnings`)
console.log("==========================");
console.log(getFileSummaryTable(newSDKWarnings, "", potentialNewWarningErrorSummaryPlain));
}
if (newARMErrors.length > 0) {
console.log(`Potential new ARM errors`)
console.log("========================");
console.log(getFileSummaryTable(newARMErrors, "", potentialNewWarningErrorSummaryPlain));
}
if (newARMWarnings.length > 0) {
console.log(`Potential new ARM warnings`)
console.log("==========================");
console.log(getFileSummaryTable(newARMWarnings, "", potentialNewWarningErrorSummaryPlain));
}

console.log("-----------------------------------------\n")

newSDKErrorsCount += newSDKErrors.length;
newARMErrorsCount += newARMErrors.length;
newSDKWarningsCount += newSDKWarnings.length;
newARMWarningsCount += newARMWarnings.length;

sdkFileSummaries += getFileSummary("SDK", fileName, existingSDKWarnings, existingSDKErrors, newSDKWarnings, newSDKErrors, pullRequestNumber);
armFileSummaries += getFileSummary("ARM", fileName, existingARMWarnings, existingARMErrors, newARMWarnings, newARMErrors, pullRequestNumber);
sdkFileSummaries += getFileSummary("SDK", fileName, existingSDKWarnings, existingSDKErrors, newSDKWarnings, newSDKErrors);
armFileSummaries += getFileSummary("ARM", fileName, existingARMWarnings, existingARMErrors, newARMWarnings, newARMErrors);
}

const sdkSummary = getSummaryBlock("SDK-related validation Errors / Warnings", sdkFileSummaries, sdkContactMessage);
const armSummary = getSummaryBlock("ARM-related validation Errors / Warnings", armFileSummaries, armContactMessage);
const text = `${sdkSummary}<br><br>\n\n${armSummary}<br><br>\n\n${githubFooter}`;

const [title, summary] = getOutputMessages(newSDKErrorsCount, newARMErrorsCount, newSDKWarningsCount, newARMWarningsCount);
const output = {
title,
summary,
text: `${sdkSummary}<br><br>\n\n${armSummary}<br><br>\n\n${githubFooter}`
text: text.length <= 65535 ? text : `${tooManyResults}<br><br>\n\n${githubFooter}`
}

console.log("---output");
Expand Down
1 change: 0 additions & 1 deletion specification/advisor/resource-manager/readme.nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Please also specify `--node-sdks-folder=<path to root folder of your azure-sdk-f
nodejs:
azure-arm: true
package-name: azure-arm-advisor
package-version: 1.1.0
output-folder: $(node-sdks-folder)/lib/services/advisorManagement
generate-license-txt: true
generate-package-json: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Please also specify `--node-sdks-folder=<path to root folder of your azure-sdk-f
nodejs:
azure-arm: true
package-name: azure-arm-analysisservices
package-version: 2.2.0
output-folder: $(node-sdks-folder)/lib/services/analysisServices
generate-license-txt: true
generate-package-json: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Please also specify `--node-sdks-folder=<path to root folder of your azure-sdk-f
nodejs:
azure-arm: true
package-name: azure-arm-apimanagement
package-version: 3.0.0-preview
output-folder: $(node-sdks-folder)/lib/services/apimanagement
generate-license-txt: true
generate-package-json: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Please also specify `--node-sdks-folder=<path to the root directory of your azur
``` yaml $(nodejs)
nodejs:
package-name: azure-applicationinsights-query
package-version: 1.0.0-Preview-1
output-folder: $(node-sdks-folder)/lib/services/applicationinsights-query
generate-license-txt: true
generate-package-json: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Please also specify `--node-sdks-folder=<path to root folder of your azure-sdk-f
nodejs:
azure-arm: true
package-name: azure-arm-appinsights
package-version: 2.0.0
output-folder: $(node-sdks-folder)/lib/services/applicationinsights
generate-license-txt: true
generate-package-json: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,10 @@
"description": "The delgation flag used for creating a role assignment"
}
},
"required": [
"roleDefinitionId",
"principalId"
],
"description": "Role assignment properties."
},
"RoleAssignmentCreateParameters": {
Expand All @@ -1152,6 +1156,9 @@
"description": "Role assignment properties."
}
},
"required": [
"properties"
],
"description": "Role assignment create parameters."
},
"Permission": {
Expand Down
Loading

0 comments on commit cae1d45

Please sign in to comment.