Skip to content

Commit

Permalink
Merge pull request #3 from Azure/master
Browse files Browse the repository at this point in the history
merge master
  • Loading branch information
mudit794 authored Oct 15, 2019
2 parents 7ffcb4e + 7ae89e7 commit c94083f
Show file tree
Hide file tree
Showing 16,732 changed files with 1,234,701 additions and 386,703 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5,760 changes: 5,760 additions & 0 deletions .azure-pipelines-preproduction/package-lock.json

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions .azure-pipelines-preproduction/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "azure-rest-api-specs-tests",
"private": true,
"author": {
"name": "Microsoft Corporation",
"email": "[email protected]",
"url": "https://github.com/azure/azure-rest-api-specs"
},
"version": "0.1.0",
"description": "Tests for Azure REST API Specifications",
"license": "MIT",
"devDependencies": {
"@azure/avocado": "^0.6.0",
"@azure/rest-api-specs-scripts": "^0.5.1",
"@ts-common/commonmark-to-markdown": "^1.2.0",
"@ts-common/fs": "0.2.0",
"@ts-common/iterator": "^0.3.6",
"@types/js-yaml": "^3.12.1",
"@types/mocha": "^5.2.6",
"cspell": "^4.0.12",
"js-yaml": "^3.13.1",
"json-schema-ref-parser": "^6.1.0",
"mocha": "*",
"ts-node": "^8.1.0",
"tslib": "^1.10.0",
"typescript": "3.5.3"
},
"homepage": "https://github.com/azure/azure-rest-api-specs",
"repository": {
"type": "git",
"url": "[email protected]:azure/azure-rest-api-specs.git"
},
"bugs": {
"url": "http://github.com/azure/azure-rest-api-specs/issues"
},
"scripts": {
"test": "tsc && mocha -t 500000 --reporter min",
"spellcheck": "ts-node ./scripts/spellcheck.ts",
"tsc": "tsc",
"multiapi": "ts-node ./scripts/multiapi.ts"
}
}
11 changes: 11 additions & 0 deletions .azure-pipelines/Avocado.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
jobs:
- job: "Avocado"
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: './node_modules/.bin/avocado'
displayName: 'Avocado'
8 changes: 8 additions & 0 deletions .azure-pipelines/BranchProtectionForPrivateRepo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
jobs:
- job: "BranchProtectionForPrivateRepo"
pool:
vmImage: 'Ubuntu 16.04'
condition: and(variables['PRIVATE'], eq(variables['System.PullRequest.TargetBranch'], 'master'))
steps:
- script: '>&2 echo "the branch is protected"'
failOnStderr: true
13 changes: 13 additions & 0 deletions .azure-pipelines/BreakingChange.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
jobs:
- job: "BreakingChange"
pool:
vmImage: 'Ubuntu 16.04'
steps:
- script: 'scripts/install-dotnet.sh'
displayName: 'Install .Net'
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: 'npm run tsc && node scripts/breaking-change.js'
displayName: 'Breaking Changes'
15 changes: 15 additions & 0 deletions .azure-pipelines/LintDiff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
jobs:
- job: "LintDiff"
variables:
NODE_OPTIONS: '--max-old-space-size=8192'
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: 'scripts/install-dotnet.sh'
displayName: 'install .Net'
- script: 'npm run tsc && node scripts/momentOfTruth.js && node scripts/momentOfTruthPostProcessing.js'
displayName: 'LintDiff'
11 changes: 11 additions & 0 deletions .azure-pipelines/ModelValidation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
jobs:
- job: "ModelValidation"
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: 'npm run tsc && node scripts/modelValidation.js'
displayName: 'Model Validation'
39 changes: 39 additions & 0 deletions .azure-pipelines/NetworkValidation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
jobs:
- job: "NetworkValidation"
condition: and(startsWith(variables['System.PullRequest.TargetBranch'], 'network-'), endsWith(variables['System.PullRequest.TargetBranch'], '-release'))
continueOnError: true
pool:
vmImage: vs2017-win2016
variables:
NRP_SWAGGER_VALIDATION_OVERRIDE_PS_BRANCH: 'true'
NRP_BUILD_TOOLS_SKIP_GENERATE_PS1: 'true'
NRP_BUILD_TOOLS_OUTPUT_PATH: '$(System.DefaultWorkingDirectory)\Out'
steps:
- powershell: |
& "C:/Program Files (x86)/Microsoft SDKs/Windows/v10.0A/bin/NETFX 4.6.1 Tools/sn.exe" -Vr *,31bf3856ad364e35
displayName: Bypass Strong Name validation
- task: NodeTool@0
inputs:
versionSpec: 10.x
displayName: Install Node.js
- script: npm install autorest -g
displayName: Install autorest
- script: git clone --depth 1 -- https://dev.azure.com/v-anevse/BuildScripts/_git/BuildScripts ..\BuildScripts
displayName: Clone build tools
- powershell: |
$swgrPath = (Get-Item ".\").FullName
$outputPath = $env:NRP_BUILD_TOOLS_OUTPUT_PATH
New-Item -Path $outputPath -ItemType "Directory" -Force | Out-Null
..\BuildScripts\Test-SwaggerRelease.ps1 -Component Network -SwaggerRepoPath $swgrPath -OutputFolder $outputPath
failOnStderr: false
displayName: Test Swagger updates
- powershell: |
Copy-Item "..\BuildScripts\.azure-pipelines\.artifactignore" -Destination "$($env:NRP_BUILD_TOOLS_OUTPUT_PATH)\.artifactignore" -Force -ErrorAction "SilentlyContinue"
failOnStderr: false
condition: always()
displayName: Copy .artifactignore
- task: PublishPipelineArtifact@0
condition: always()
inputs:
artifactName: SwaggerTestOutput
targetPath: $(NRP_BUILD_TOOLS_OUTPUT_PATH)
11 changes: 11 additions & 0 deletions .azure-pipelines/Semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
jobs:
- job: "Semantic"
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: 'npm run tsc && node scripts/semanticValidation.js'
displayName: 'Semantic Validation'
15 changes: 15 additions & 0 deletions .azure-pipelines/Spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
jobs:
- job: "Spellcheck"
condition: "not(variables['PRIVATE'])"
variables:
NODE_OPTIONS: '--max-old-space-size=8192'
pool:
vmImage: 'Ubuntu 16.04'
continueOnError: true
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: 'npm run spellcheck'
displayName: 'Run cSpell'
25 changes: 25 additions & 0 deletions .azure-pipelines/SwaggerToSDK.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
jobs:
- job: "SDK"
timeoutInMinutes: 180
strategy:
matrix:
java:
AZURE_SDK_REPO: azure-sdk-for-java
AZURE_SDK_PARAMS: ''
javascript:
AZURE_SDK_REPO: azure-sdk-for-js
AZURE_SDK_PARAMS: ''
python:
AZURE_SDK_REPO: azure-sdk-for-python
AZURE_SDK_PARAMS: ''
go:
AZURE_SDK_REPO: azure-sdk-for-go
AZURE_SDK_PARAMS: '-o latest'
pool:
vmImage: 'Ubuntu 16.04'
variables:
NODE_OPTIONS: '--max-old-space-size=8192'
steps:
- script: echo $(NODE_OPTIONS)
- script: "scripts/swagger-to-sdk.sh Azure/$(AZURE_SDK_REPO) -v $(AZURE_SDK_PARAMS)"
displayName: "Swagger to SDK script"
20 changes: 20 additions & 0 deletions .azure-pipelines/Syntax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
jobs:
- job: "Syntax"
pool:
vmImage: 'Ubuntu 16.04'
steps:
- script: |
echo TRAVIS: $(TRAVIS)
echo TRAVIS_BRANCH: $(TRAVIS_BRANCH)
echo TRAVIS_REPO_SLUG: $(TRAVIS_REPO_SLUG)
echo TRAVIS_PULL_REQUEST: $(TRAVIS_PULL_REQUEST)
echo TRAVIS_PULL_REQUEST_SLUG: $(TRAVIS_PULL_REQUEST_SLUG)
echo TRAVIS_PULL_REQUEST_SHA: $(TRAVIS_PULL_REQUEST_SHA)
echo PR_ONLY: $(PR_ONLY)
displayName: "Info"
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- script: 'npm test -- test/syntax.js'
displayName: 'Syntax validation'
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ root = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true

[cSpell.json]
indent_size = 4
Expand Down
107 changes: 2 additions & 105 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,106 +1,3 @@
# Contributing to azure-rest-api-specs
First, thank you for contributing to Azure specs repository! Swagger specs are the basis for generating Azure SDKs in multiple different languages, Azure CLIs for interacting with the services, and can provide documentation for these services.

## Basics
If you're a spec author looking for information about all of the repositories and steps in the pipeline, go to the [adx-documentation-pr](https://github.com/Azure/adx-documentation-pr) repository. Make sure to [join the Github Azure organization](http://aka.ms/azuregithub) to get access to that repo.

## Table of Contents
[Before starting](#before-starting)
- [Onboarding](#onboarding)
- [Github basics](#github-basics)
- [Code of Conduct](#code-of-conduct)

[Making changes](#making-changes)
- [Documentation](#documentation)
- [Filenames and folder structure](#filenames-and-folder-structure)
- [Tools for writing Swagger](#tools-for-writing-swagger)
- [Tools for validating Swagger](#tools-for-validating-swagger)

[Submitting a PR](#submitting-a-pr)

[Review process](#review-process)
- [SLA](#sla)
- [Review Criteria](#review-criteria)

## Before starting

### Onboarding
Make sure that your Github account is part of the Azure organization. [Use this page](http://aka.ms/azuregithub) to link your account.

Before cloning this repository, please make sure you have started in our [documentation repository adx-documentation-pr](https://github.com/Azure/adx-documentation-pr) (you will only have access to that page if you are part of the Azure organization).

### Github basics

#### GitHub workflow
If you don't have experience with Git and Github, some of the terminology and process can be confusing. [Here's a guide to understanding Github](https://guides.github.com/introduction/flow/).

#### Forking the Azure/azure-rest-api-specs repository
Unless you are working with multiple contributors on the same file, we ask that you fork the repository and submit your Pull Request from there. [Here's a guide to forks in Github](https://guides.github.com/activities/forking/).

### Code of Conduct
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 [[email protected]](mailto:[email protected]) with any additional questions or comments.

## Making changes
Swagger files are simply JSON files that follow the [OpenAPI Specification](http://swagger.io/specification/). This specification is extensible, and there are extensions that are used by AutoRest when your SDK is generated. Additionally, there are patterns and standards that are necessary for generating quality SDKs and CLIs.

### Documentation
The [/documentation](../documentation/) folder contains many resources for writing Swagger files.

The [Swagger Checklist](../documentation/swagger-checklist.md) page is intended as a guide for different scenarios. If you know the service behavior that you're trying to model (e.g. PUT/PATCH/GET responses and request schemas, or modeling long running operations), that document is structured to make it easy to find our recommendations.

The [Reference Documentation](../documentation/creating-swagger.md) page contains lots of information about each part of a Swagger file and how to structure it correctly for code generation. If you're looking for an explanation on what a part of Swagger relates to your service or how it's used to generate code, that document is the right place to go.

### Filenames and folder structure
- Swagger spec for every api-version should be in a separate folder named with the api-version.
- It is time consuming to review the file line by line for every api-version. When you are creating the swagger spec for the new api-version, please copy the swagger spec from the previous version in to the new api-versioned folder and commit it. After that overwrite it with the changes for the new api-version. This makes it easy for us to review the changes.

### Tools for writing Swagger
As JSON files, specs can be modified in any text editor that you choose. We have some recommendations that can make editing these files easier.

- _**Recommended**_ Visual Studio Code.
- Visual Studio Code can provide a nice experience for editing JSON, though it takes extra work to use the JSON schema that defines Swagger files.

### Tools for validating Swagger
There are some tools that can help you make sure your spec conforms to guidelines. The more of these issues that are caught before the PR is sent, the quicker the turnaround to merging the PR will be.

- _**Recommended**_ Please take a look at the [validation tools for swagger checklist](https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/swagger-checklist.md#validation-tools-for-swagger-checklist) section.
- The [OpenAPI Initiative Swagger editor](http://editor.swagger.io/#/) will help find basic issues in a Swagger file. However, we apply a higher bar than this validator - just because this site doesn't show errors doesn't mean the spec is ready to merge.
- Similarly, this online [schema validator](https://json-schema-validator.herokuapp.com/) can help find basic errors. Again, we apply a higher bar than this validator - just because this site doesn't show errors doesn't mean the spec is ready to merge.
* In the upper left box, paste the [swagger schema from here](https://github.com/swagger-api/swagger-spec/blob/master/schemas/v2.0/schema.json)
* In the lower left box, paste your swagger json
* Upon clicking the validate button, you should either see errors or success.

## Submitting a PR

Please send a [GitHub Pull Request to Azure REST API Specs](https://github.com/azure/azure-rest-api-specs/pull/new/master) with a clear list of what you've done (read more about [pull requests](http://help.github.com/pull-requests/)). When you send a pull request, we will love you forever if you include additions to the documentation for your given service. We can always use more documentation and beautiful markdown. Please follow make sure all of your commits are atomic (one feature per commit).

Always write a clear log message for your commits. One-line messages are fine for small changes, but bigger changes should look like this:

$ git commit -m "A brief summary of the commit
>
> A paragraph describing what changed and its impact."

Please be kind with your pull requests and ensure you keeping them as focused and cohesive as possible. Keep your pull
request free of merge commits, code review fixes and anything that may take away from the essence of your contribution.
Use the git tools you have available to you, such as amend, rebase, etc.


## Review process
We review spec PRs to maintain a high bar of quality for all products that will be generated from these specs (including SDKs in all languages, CLIs and documentation). It's critical that spec files are both syntactically and semantically correct, as well as conform to common patterns that make it possible to generate SDKs and CLIs that are usable for customers. Since specs are the base input for all of these products, the review process starts with PRs to this repository. Please refer to [Swagger Review Process](https://github.com/Azure/adx-documentation-pr/wiki/Swagger-Review-Process) for more details.

The expectation is that every spec in a PR will be correct JSON, syntactically correct, will semantically agree with the service it applies to, and will follow the recommended patterns.

#### Basic JSON correctness
A spec file must be valid JSON, according to the [JSON specification](https://tools.ietf.org/html/rfc7159). It must also be a valid Swagger file, according to the [OpenAPI Specification](http://swagger.io/specification/). Finally, it must also conform to the [schema that AutoRest applies](https://raw.githubusercontent.com/Azure/autorest/master/schema/swagger-extensions.json).

#### Semantic correctness
Your spec file must correctly represent your service. Even if a spec passes all of the rules listed above, it might not accurately describe the service that it is intended to describe. This could include
- Incorrect schemas for responses or requests (both missing and superfluous properties)
- Missing operations
- Missing parameters (especially required ones)
- etc (this list is not comprehensive)

Making sure that the spec is correct from a semantic point of view requires domain knowledge and careful comparison of your spec file with your actual service. We will do our best to point out inconsistencies between spec and service if we can infer them, but you are responsible for making sure your spec and service agree.

**Recommendation**: Check each operation, parameter, schema, property to make sure it accurately models the service API. Refer back to the [Reference documentation](../documentation/creating-swagger.md) for more details on every part of Swagger.
### *This is an outdated document. Please refer the new [wiki](https://github.com/Azure/adx-documentation-pr/wiki) for up to date details.*
([`Link your GitHub account`](https://repos.opensource.microsoft.com/) to the 'Azure' organization for access.)

15 changes: 15 additions & 0 deletions .github/reviewer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file is openapi-email-bot to store reviewer email address.
---
- group:
name: default
users:
- githubID: ruowan
email: [email protected]
- githubID: raych1
email: [email protected]
- githubID: MyronFanQiu
email: [email protected]
- githubID: yungezz
email: [email protected]
- githubID: lirenhe
email: [email protected]
25 changes: 25 additions & 0 deletions .github/sla.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
- scheduleTask:
action: sendEmailToAssignee
args:
ignoredLabels:
- WaitForARMFeedback
- DoNotMerge
- WaitingForAzureAPIBoard
limit: 48h
message: '<p> Dear Swagger reviewer, <br> <br> Please response to the PR ${PR_URL}. The PR isn''t updated in 48 hours. <br> <hr /> <br> Quick info. <ul> <li>If no response from ARM review board, please send email to [email protected].</li> <li>If need immediate ARM review, please get ARM review oncall contact point from ICM https://icm.ad.msft.net/imp/v3/oncall/current under Service "Azure Resource Manager" and Team "RP Manifest Approvers"</li> <li>If no response from Azure API review board, please send email to [email protected].</li> <li>If you have problem to fix CI task errors, please send email to Visual Studio China Swagger and Tool team [email protected].</li> <li>If you want to opt out from Swagger reviewing for out of office period, please set vacation date at https://inframonitorweb1.azurewebsites.net/Home/MyView.</li> <li>Pls refer to <a href="onenote:https://microsoft.sharepoint.com/teams/IoTToolingTeam/SiteAssets/IoT Tooling Team Notebook/Azure Management Experience - transition.one#Swagger%20reviewing%20process§ion-id={ECE847C4-519B-4448-A1A0-8E84A7EFE8AB}&page-id={F6E345FE-46E1-420F-B837-6BF76167DE05}&end">Swagger review process (onenote)</a> for more about Swagger review process.</li> </ul> Best regards, <br> Azure Management Experience </p>'
subject: "Action Required: Please respond to PR ${PR_URL}"
description: "None initial response in 48 hours"
name: no-initial-response
- scheduleTask:
action: sendEmailToAssignee
args:
ignoredLabels:
- WaitForARMFeedback
- DoNotMerge
- WaitingForAzureAPIBoard
limit: 5d
message: '<p> Dear Swagger reviewer, <br> <br> Please response to the PR ${PR_URL}. The PR isn''t updated in 5 days. <br> <hr /> <br> Quick info. <ul> <li>If no response from ARM review board, please send email to [email protected].</li> <li>If need immediate ARM review, please get ARM review oncall contact point from ICM https://icm.ad.msft.net/imp/v3/oncall/current under Service "Azure Resource Manager" and Team "RP Manifest Approvers"</li> <li>If no response from Azure API review board, please send email to [email protected].</li> <li>If you have problem to fix CI task errors, please send email to Visual Studio China Swagger and Tool team [email protected].</li> <li>If you want to opt out from Swagger reviewing for out of office period, please set vacation date at https://inframonitorweb1.azurewebsites.net/Home/MyView.</li> <li>Pls refer to <a href="onenote:https://microsoft.sharepoint.com/teams/IoTToolingTeam/SiteAssets/IoT Tooling Team Notebook/Azure Management Experience - transition.one#Swagger%20reviewing%20process§ion-id={ECE847C4-519B-4448-A1A0-8E84A7EFE8AB}&page-id={F6E345FE-46E1-420F-B837-6BF76167DE05}&end">Swagger review process (onenote)</a> for more about Swagger review process.</li> </ul> Best regards, <br> Azure Management Experience </p>'
subject: "Action Required: Please respond to PR ${PR_URL}"
description: "None update in PR in 5 days"
name: no-update-in-5d
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Temporary Items

# npm
node_modules
package-lock.json

#### JetBrains
.idea
Expand Down
Loading

0 comments on commit c94083f

Please sign in to comment.