Short link: aka.ms/ci-fix
This guide provides detailed troubleshooting instructions for the automated validation tooling checks running on Azure REST API specs PRs submitted to this repo.
If you need help with your specs PR, please first thoroughly read the aka.ms/azsdk/pr-getting-help document.
- CI Fix Guide
- Table of Contents
- Prerequisites
- Checks troubleshooting guides
CredScanPoliCheckSDK Validation *checks, likeSDK Validation - GoSDK Breaking Change ReviewSwagger APIViewSwagger ApiDocPreviewSwagger AvocadoSwagger BreakingChangeandBreakingChange(Cross-Version)Swagger LintDiffandSwagger Lint(RPaaS)Swagger LintDifffor TypeSpec: troubleshooting guidesSwagger ModelValidationSwagger PrettierCheckSwagger SemanticValidation- Spell Check
TypeSpec Validationlicense/cla
- Suppression Process
- Checks not covered by this guide
- Obsolete checks
Most guides here require for you to have npm installed, which you can get by installing Node.js.
This check is owned by One Engineering System. See 1ES CredScan for help.
This check is owned by One Engineering System. See 1ES PoliCheck for help.
Important
- The
SDK Validation Statuscheck is a meta check that aggregates the results of allSDK Validation - {Language}checks and reports a unified status. Re-run any individualSDK Validation - {Language}checks will automatically trigger a re-run of this meta check. - The
SDK Validation *checks are owned by the Shanghai division of the Azure SDK team, not the core Redmond Azure SDK team. - For more information, refer to SDK Validation FAQ.
If you have an issue or with any of checks listed in the first column of the table below:
| Check name | Owner | GitHub login |
|---|---|---|
SDK Validation - Go |
Chenjie Shi | tadelesh |
SDK Validation - Java |
Weidong Xu | weidongxu-microsoft |
SDK Validation - JS |
Qiaoqiao Zhang | qiaozha |
SDK Validation - .NET |
Wei Hu | live1206 |
SDK Validation - Python |
Yuchao Yan | msyyc |
Do the following:
- Attempt to diagnose the issue yourself:
- Look at the affected PR's
checkstab for the failing check. - Click on the
View more details on Azure Pipelines.link from that tab and inspect the devOps logs. For example, forSDK Validation - Gocheck look into theAzure Pipelines/SDK Validation - Gopipeline run logs.
- Look at the affected PR's
- If your investigation denotes this is likely a bug in the check itself and not your PR, reach out to the owner of the check per the aforementioned table.
Important
- If your PR is flagged with any label that matches the pattern
BreakingChange-{Language}-Sdk, the SDK breaking changes will be reviewed by SDK reviewers around two business days after the completion of the first two review steps in PR review workflow, i.e. REST API breaking change review and ARM review. - If you need to suppress the SDK breaking changes, refer to SDK Suppressions.
If the SDK breaking changes haven't been reviewed after two additional business days, you may reach out to the reviewers:
| Language | Reviewer | GitHub login |
|---|---|---|
Go |
Chenjie Shi | tadelesh |
JS |
Qiaoqiao Zhang | qiaozha |
Python |
Yuchao Yan | msyyc |
Various APIViews are generated as part of the Azure REST API specs PR build. Among these are TypeSpec and Swagger as well as any other language that is being generated in the run. When everything is successful you should see a comment box similar to the picture below showing the APIViews generated for TypeSpec or Swagger, plus all other languages being generated.
- On the CI check click on
details>View Azure DevOps build log for more detailsto view the devOps logs. - Investigate the CI job for the language with error. TypeSpec and Swagger APIViews are generated as part of the
AzureRestApiSpecsPipelinestage in theTypeSpecAPIViewandSwaggerAPIViewjobs respectively, while APIViews for other SDK languages are generated in their respective language jobs in theSDK Automationstage. - Ensure that all previous checks in the job are green before proceeding.
- Check for an unexpected skip of the
Publish SDK APIView Artifact to Pipeline ArtifactsandGenerate SDK APIViewstep. - Look in
SDK Automationstep to verify that the API token generation completed successfully. - Search logs for
Read Temp File - Below
Read Temp Filefind the .json object and search within to locate theapiViewArtifactproperty. - If not present, the APIView parser for the language failed to generate the
APIView Token Artifacts. - Please contact APIView Support Teams Channel for assistance.
If you see Swagger ApiDocPreview check fail with a failure like this one:
| Rule | Message |
|---|---|
| ❌ RestBuild error | "logUrl":"https://apidrop.visualstudio.com/Content%20CI/_build/results?buildId=373646&view=logs&j=fd490c07-0b22-5182-fac9-6d67fe1e939b", "detail":"Run.ps1 failed with exit code 1 " |
Refer to troubleshooting REST API documentation.
Moved to https://github.com/Azure/azure-rest-api-specs/wiki/Swagger-Avocado
See aka.ms/azsdk/pr-brch-deep. If you want a quick read, see only the summary section.
To repro issues with "breaking changes" checks, you can locally run the tool that powers them: Azure/openapi-diff, aka oad:
npm install -g @azure/oad
oad compare <old-spec-path> <new-spec-path>Please see readme for how to install or run tool in details. Refer to Oad Docs for detailed description of all oad rules.
The LintDiff validation tool runs linting rules against specification difference. Two specifications are compared: the specification as it would be when proposed PR is merged, vs the specification as seen before the PR is merged.
Refer to openapi-authoring-automated-guidelines for detailed description of all lint rules and how-to-fix guidance.
If that guidance is not enough, please also refer to the LintDiff rules.md doc. It links to .md files related to given error, containing instructions how to fix them.
To reproduce LintDiff failures locally, see CONTRIBUTING.md / How to locally reproduce a LintDiff failure occurring on a PR.
https://github.com/Azure/azure-rest-api-specs/wiki/Swagger-LintDiff-for-TypeSpec
To repro issues with Swagger ModelValidation locally:
npm install -g oav
oav validate-example <openapi-spec-path>Please see readme for how to install or run tool in details. Refer to Semantic and Model Violations Reference for detailed description of validations and how-to-fix guidance. Refer to Swagger-Example-Generation for example automatic generation.
First, ensure you have fulfilled Prerequisites as explained above.
To update all the spec files for a given service run the following:
# To fix all the files in the repo run from the root of the repo
cd <local_repo_clone_root>
# OPTIONAL STEP: To fix a particular service OpenAPI spec cd to that directory like
cd specification/contosowidgetmanager
# Install the dependencies to the local 'node_modules' folder.
npm install
# Run 'prettier --check' to verify the problems can be reproduced locally
npx prettier --check **/*.json
# Run 'prettier --write' to fix the problems.
npx prettier --write **/*.jsonThen please commit and push changes made by prettier.
To repro issues with Swagger SemanticValidation locally:
npm install -g oav
oav validate-spec <openapi-spec-path>Please see readme for how to install or run tool in details. Refer to Semantic and Model Violations Reference for detailed description of validations and how-to-fix guidance.
If you receive a spelling failure, first try to fix the spelling in source.
If there are new words that need to be supported for your service, add the word to the override list in the words list in
the specification/<service>/cspell.yaml file for your service. Specific files can also be overridden using the
override field in your service's cspell.yaml file (see example below).
If the specification/<service>/cspell.yaml file does not exist, create it using the example below and set the words
and overrides fields to the words that need to be suppressed. The import field is required.
For example (note the words list is sorted alphabetically):
import:
- ../../cspell.yaml
words:
- aardvark
- zoology
# Optional overrides example for words in a specific file
overrides:
- filename: '**/specification/contosowidgetmanager/somefile.yaml'
words:
- aardwolf
- zooSpell checking is case-insensitive so you only need to add a word once in lower-case. Try to kept the word list sorted for easier discovery.
For more information see cspell configuration.
https://github.com/Azure/azure-rest-api-specs/wiki/TypeSpec-Validation
This check is owned by One Engineering System. See 1ES GitHub inside Microsoft for help.
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 the suppression guide for detailed guidance.
If you have an issue with a check that is not covered by this guide and the help at aka.ms/azsdk/pr-getting-help, see aka.ms/azsdk/support.
Following checks have been removed from the validation toolchain as of August 2023.
- API Readiness Check
- Service API Readiness Test
- Traffic validation
