Skip to content

Commit

Permalink
Update ci-fix (Azure#13050)
Browse files Browse the repository at this point in the history
* add sdk track2 validation

* update

Co-authored-by: jianye xi <jianyxi@microsoft.com>
  • Loading branch information
jianyexi and jianye xi authored Feb 20, 2021
1 parent e0f7aaf commit bfbbca4
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions documentation/ci-fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,21 @@ Refer to [Oad Docs](https://github.com/Azure/openapi-diff/tree/master/docs) for

## Linter Validation

Run linter locally:
```
### Run linter locally:

#### Prerequisites:
npm install -g autorest

#### Given a swagger spec, run linter:
```
autorest --validation --azure-validator --use=@microsoft.azure/classic-openapi-validator@latest --use=@microsoft.azure/openapi-validator@latest --input-file=<path-to-spec>
or
```
#### Given a readme file, run linter:
```
autorest --validation --azure-validator --use=@microsoft.azure/classic-openapi-validator@latest --use=@microsoft.azure/openapi-validator@latest [--tag=<readme tag>] <path-to-readme>
```

### Document
Please see [readme](https://github.com/Azure/azure-openapi-validator/blob/master/README.md) for how to install or run tool in details.
Or you can run it in [OpenAPI Hub](https://portal.azure-devex-tools.com/tools/linter).
Refer to [openapi-authoring-automated-guidelines](https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/openapi-authoring-automated-guidelines.md) for detailed description of all lint rules and how-to-fix guidance.
Expand All @@ -91,6 +98,30 @@ Note: When running in Swagger PR pipeline, Avocado only report errors with file

Refer to [Avocado Readme](https://github.com/Azure/avocado/blob/master/README.md) for detailed description of validations and how-to-fix guidance.


## SDK Track2 Validation

This CI check is to run [autorest.modelerfour](https://github.com/Azure/autorest.modelerfour) for each changing tag in a PR.
Since the code generators of track2 SDK are based on the autorest.modelerfour, it's recommended ensure this validation is passed without any error and warning.
The `modelerfour` has several plugins. If a plugin report an error, you can refer to the following plugin documentations:
- [PreChecker](https://github.com/Azure/autorest/blob/master/docs/openapi/prechecker.md)

### Run locally:

#### Prerequisites:

```
npm install -g autorest
```
#### Given a swagger spec, run the validator:
```
autorest --v3 --azure-validator --use=@microsoft.azure/openapi-validator@latest --input-file=<path-to-spec>
```
#### Given a readme file, run the validator:
```
autorest --v3 --azure-validator --semantic-validator=false --model-validator=false --use=@microsoft.azure/openapi-validator@latest [--tag=<readme tag>] <path-to-readme>
```

## Suppression Process

In case there are validation errors reported against your service that you believe do not apply, we have a suppression process you can follow to permanently remove these reported errors for your specs. Refer to [Swagger Suppression Process](https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/85/Swagger-Suppression-Process) for detailed guidance.

0 comments on commit bfbbca4

Please sign in to comment.