Skip to content

Commit

Permalink
Revert "Merge branch 'main' of https://github.com/Azure/azure-rest-ap…
Browse files Browse the repository at this point in the history
…i-specs into teom-hobovm08-01-preview"

This reverts commit 47adff6, reversing
changes made to 4b9165d.
  • Loading branch information
Teo Magnino Chaban committed Jul 17, 2023
1 parent 230f57e commit 66cd7d6
Show file tree
Hide file tree
Showing 592 changed files with 5,138 additions and 23,213 deletions.
6 changes: 0 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE/control_plane_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# ARM (Control Plane) API Specification Update Pull Request

## PR review workflow diagram

Please understand this diagram before proceeding. It explains how to get your PR approved & merged.

![diagram](https://github.com/Azure/azure-rest-api-specs/assets/4429827/5e91ff2d-1f5c-4e96-87c2-390e7451da37)

## Purpose of this PR

What's the purpose of this PR? Check all that apply. This is **mandatory**!
Expand Down
Binary file not shown.
8 changes: 2 additions & 6 deletions .github/comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
**ACTION ITEM ALTERNATIVE C**: Report false positive. <br/>
If you think there are no breaking changes,
i.e. the validation should pass yet it fails,
then proceed as explained in **ACTION ITEM ALTERNATIVE B**.<br/>
This applies even if the breaking change tool fails with internal runtime error.
In such case a manual breaking change review is necessary.
then please explain why in a PR comment and @ the PR assignee.
- rule:
type: label
Expand All @@ -49,9 +47,7 @@
**ACTION ITEM ALTERNATIVE C**: Report false positive. <br/>
If you think there are no changes in existing API version,
i.e. there should be no `NewApiVersionRequired` label,
then proceed as explained in **ACTION ITEM ALTERNATIVE B**.<br/>
This applies even if the breaking change tool fails with internal runtime error.
In such case a manual breaking change review is necessary.
then please explain why in a PR comment and @ the PR assignee.
<br/><br/>
For additional guidance, please see https://aka.ms/NewApiVersionRequired
Expand Down
1 change: 0 additions & 1 deletion .github/pull_request_assignment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# OpenAI data-plane PR
paths:
- "specification/cognitiveservices/data-plane/AzureOpenAI/**"
- "specification/cognitiveservices/OpenAI.Inference/**"
reviewers:
- lmazuel

Expand Down
12 changes: 2 additions & 10 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,5 @@
/specification/**/resource-manager/**/readme.typescript.md @qiaozha
/specification/**/resource-manager/**/readme.az.md @jsntcy @qiaozha
/specification/**/resource-manager/**/readme.cli.md @jsntcy @qiaozha
/specification/**/resource-manager/**/readme.go.md @tadelesh
/specification/**/resource-manager/**/readme.python.md @msyyc

###########
# Eng Sys
###########
/.azure-pipelines/ @weshaggard @mikeharder @konrad-jamrozik
/.github/ @weshaggard @mikeharder @konrad-jamrozik
/eng/ @weshaggard @mikeharder @konrad-jamrozik
/scripts/ @weshaggard @mikeharder @konrad-jamrozik
/specification/**/resource-manager/**/readme.go.md @ArcturusZhang
/specification/**/resource-manager/**/readme.python.md @msyyc @Wzb123456789
3 changes: 0 additions & 3 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,6 @@ continuationtoken
continuousdataexports
continuouswebjobs
contoso
Contoso's
contosodataset
contosomedia
contributer
Expand Down Expand Up @@ -2176,7 +2175,6 @@ removeaclentries
removedefaultacl
removenodes
removex
reoffer
reparent
replicationdetails
replicationstatus
Expand Down Expand Up @@ -2777,7 +2775,6 @@ unarchive
unassign
unassignment
unassigns
unassigning
unattend
unbilled
unclaim
Expand Down
26 changes: 6 additions & 20 deletions documentation/ci-fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,17 @@ Or you can run it in [OpenAPI Hub](https://portal.azure-devex-tools.com/tools/st
Refer to [Semantic and Model Violations Reference](https://github.com/Azure/azure-rest-api-specs/blob/main/documentation/Semantic-and-Model-Violations-Reference.md) for detailed description of validations and how-to-fix guidance.

## Breaking Change Check

- An API contract is identified by its api-version value. Once published, no changes to this API contract are allowed. This applies regardless of whether the API contract is for private preview, public preview, or GA (stable).
- The same-version breaking change linter rules check for changes to an existing api-version swagger.
- When introducing a new API contract (preview or not), the new API contract must be backwards compatible with the previous GA’s API contract.
- However, during a (private or public) preview cycle, a new preview API contract does not have to be backwards compatible with the previous preview API contract although it must still be backwards compatible with the latest GA API contract.
- The cross version breaking change linter rules checks for this by comparing the new swagger with the latest GA swagger. If there is no latest GA swagger, then the latest preview if it > 1 year old. If nether a GA or preview > 1 year old exists, then the swagger is considered good.

### Adding label on PR automatically
- When introducing a new API contract (preview or not), the new API contract must be backwards compatible with the previous GA’s API contract.
- However, during a (private or public) preview cycle, a new preview API contract does not have to be backwards compatible with the previous preview API contract although it must still be backwards compatible with the latest GA API contract.
- The cross version breaking change linter rules checks for this by comparing the new swagger with the latest GA swagger. If there is no latest GA swagger, then the latest preview if it > 1 year old. If nether a GA or preview > 1 year old exists, then the swagger is considered good.

### adding label on PR automatically
The breaking change check has two types of violations: one is breaking change in the same version but not breaking change in a new version, the other is breaking change even in a new version.
For the former, a label 'NewApiVersionRequired' will be added automatically; For the latter, a label 'BreakingChangeReviewRequired' will be added automatically. Adding each label will trigger a github comment with guildance on how to fix.

### Run locally
For the former, a label 'NewApiVersionRequired' will be added automatically; For the latter , a label 'BreakingChangeReviewRequired' will be added automatically. Adding each label will trigger a github comment with guildance on how to fix.

### run locally
run oad locally (the breaking change is reported by oad tool):
```
npm install -g @azure/oad
Expand Down Expand Up @@ -132,15 +129,6 @@ To fix this CI check failure, if you haven't got ARM signed off, pls get ARM sig

NOTE: If your RP is RPaaS RP, since RPaaS requires swagger merge first. In this case, you could ignore this CI check.

## API Doc Preview

If you see `Swagger ApiDocPreview ` check fail with a failure [like this one](https://github.com/Azure/azure-rest-api-specs/pull/24841/checks?check_run_id=15056283615):

| Rule | Message |
|-|-|
| ❌ RestBuild error | "logUrl":"https://apidrop.visualstudio.com/Content%20CI/_build/results?buildId=373646&view=logs&j=fd490c07-0b22-5182-fac9-6d67fe1e939b",<br/>"detail":"Run.ps1 failed with exit code 1 " |

Then refer to [this TSG](https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/79/Generation-of-docs-on-learn.microsoft.com?anchor=%22swagger-apidocpreview%22-build-is-failing).

## Service API Readiness Test

Expand All @@ -159,7 +147,6 @@ To fix the check, download the artifact `api_scenario_test_output` from Azure pi
This validator is to ensure the TypeSpec & swagger files in PR are consistent and passing validation.

### How to fix

| Error Code |Severity |Solution |
|---|---|---|
|MissingTypeSpecFile| Error |Adding the related TypeSpec project into {RP-Name} folder, like [Qumulo.Manaement](https://github.com/Azure/azure-rest-api-specs/tree/main/specification/liftrqumulo/Qumulo.Management)|
Expand All @@ -176,7 +163,6 @@ See [typespec-autorest](https://azure.github.io/typespec-azure/docs/emitters/typ
This validator generates traffic for all operations defined in Swagger files under default tag of readme.md by using [RESTler](https://github.com/microsoft/restler-fuzzer). Then, it validates the request and response pairs from the traffic against the corresponding Swagger definitions. Finally, it provides an html report that reports the Swagger accuracy.

### How to understand and improve the report

Please refer to [swagger-accuracy-report](./swagger-accuracy-report.md).

## Suppression Process
Expand Down
22 changes: 22 additions & 0 deletions eng/pipelines/templates/steps/typespec-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
parameters:
- name: Folder
type: string
- name: DisplayName
type: string

steps:
- bash: |
exit_code=0
# Log commands before running
set -x
npx --no tsv ${{parameters.Folder}} || exit_code=1
# Discard any changes
git restore .
git clean -df
exit $exit_code
displayName: ${{parameters.DisplayName}}
condition: succeededOrFailed()
95 changes: 86 additions & 9 deletions eng/pipelines/typespec-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,23 @@ pr:
- typespec-next
paths:
include:
- .gitattributes
- .prettierrc.json
- package-lock.json
- package.json
- tsconfig.json
- eng
- package-lock.json
- eng/pipelines/typespec-ci.yml
- eng/pipelines/templates/steps/typespec-ci.yml
- eng/tools/TypeSpecValidation
- specification/contosowidgetmanager
- specification/cognitiveservices
- specification/confidentialledger
- specification/containerservice
- specification/containerstorage
- specification/eventgrid
- specification/servicenetworking
- specification/sphere
- specification/translation

jobs:
- job: Validate_All_Specs
- job: TypeSpecCI
pool:
name: azsdk-pool-mms-ubuntu-2204-general
vmImage: ubuntu-22.04
Expand All @@ -32,7 +40,76 @@ jobs:
displayName: npm ls -a
condition: succeededOrFailed()

- pwsh: |
$(Build.SourcesDirectory)/eng/scripts/Validate-TypeSpec.ps1 $(Build.SourcesDirectory)
displayName: Validate All Specs
- script: npm run build
displayName: npm run build
condition: succeededOrFailed()

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/contosowidgetmanager/Contoso.WidgetManager
DisplayName: Contoso.WidgetManager

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/cognitiveservices/AnomalyDetector
DisplayName: AnomalyDetector

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/cognitiveservices/ContentSafety
DisplayName: ContentSafety

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/cognitiveservices/HealthInsights/healthinsights.openapi
DisplayName: healthinsights.openapi

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/cognitiveservices/HealthInsights/healthinsights.oncophenotype
DisplayName: healthinsights.oncophenotype

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/cognitiveservices/HealthInsights/healthinsights.trialmatcher
DisplayName: healthinsights.trialmatcher

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/cognitiveservices/OpenAI.Inference
DisplayName: OpenAI.Inference

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/confidentialledger/Microsoft.ManagedCcf
DisplayName: ManagedCcf

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/containerservice/Fleet.Management
DisplayName: Fleet.Management

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/containerstorage/ContainerStorage.Management
DisplayName: ContainerStorage.Management

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/eventgrid/Azure.Messaging.EventGrid
DisplayName: Messaging.EventGrid

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/servicenetworking/ServiceNetworking.Management
DisplayName: Microsoft.ServiceNetworking

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/sphere/Sphere.Management
DisplayName: Sphere.Management

- template: templates/steps/typespec-ci.yml
parameters:
Folder: specification/translation/Azure.AI.TextTranslation
DisplayName: AI.TextTranslation
32 changes: 0 additions & 32 deletions eng/pipelines/typespec-pr.yml

This file was deleted.

27 changes: 0 additions & 27 deletions eng/scripts/Get-TypeSpec-Folders.ps1

This file was deleted.

25 changes: 0 additions & 25 deletions eng/scripts/Validate-TypeSpec.ps1

This file was deleted.

6 changes: 1 addition & 5 deletions eng/tools/TypeSpecValidation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
},
"devDependencies": {
"@types/debug": "^4.1.8",
"@types/node": "^18.16.18",
"typescript": "~5.0.4"
},
"scripts": {
"postinstall": "tsc"
"@types/node": "^18.16.18"
}
}
5 changes: 1 addition & 4 deletions eng/tools/TypeSpecValidation/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"compilerOptions": {
"target": "ES6",
"module": "Node16",
"outDir": "./dist",

// override "importHelpers:true" in root tsconfig.json
"importHelpers": false
"outDir": "./dist"
}
}
7 changes: 0 additions & 7 deletions eng/tools/package.json

This file was deleted.

Loading

0 comments on commit 66cd7d6

Please sign in to comment.