Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5f9a909
Breaking Change2
sergey-shandar Apr 16, 2019
5700f08
Experimental lintdiff
sergey-shandar Apr 16, 2019
cb5caa5
No more model/semantic/syntax validations in travis-CI.
sergey-shandar Apr 16, 2019
3e2a0c6
Scripts 0.1.8
sergey-shandar Apr 16, 2019
39cad03
Use scripts from @azure/rest-api-specs-scripts
sergey-shandar Apr 16, 2019
5151be7
ts-utils
sergey-shandar Apr 16, 2019
4d24cf6
fix breaking changes
sergey-shandar Apr 17, 2019
f597442
momentOfTruthPostProcessing
sergey-shandar Apr 17, 2019
794b245
momentOfTruthPostProcessing.ts
sergey-shandar Apr 17, 2019
151ed28
remove 'ts-utils.ts'
sergey-shandar Apr 17, 2019
acfad34
Remove `utils`
sergey-shandar Apr 17, 2019
ae39843
postToGitHub.ts
sergey-shandar Apr 17, 2019
30285c0
switch to momentOfTruthUtils
sergey-shandar Apr 17, 2019
36eff22
minor
sergey-shandar Apr 17, 2019
c30473c
Syntax.ts
sergey-shandar Apr 17, 2019
9f0ac27
semanticValidation.ts
sergey-shandar Apr 17, 2019
466b17f
Merge from master
sergey-shandar Apr 17, 2019
3e694ea
another try
sergey-shandar Apr 18, 2019
67ced89
minor update
sergey-shandar Apr 19, 2019
95cbfde
URL/fix
sergey-shandar Apr 19, 2019
c0cac7a
OAD ^0.2.13
sergey-shandar Apr 19, 2019
2cec6cc
Merge rom master
sergey-shandar Apr 19, 2019
a7a4f79
update to new scripts.
sergey-shandar Apr 19, 2019
39961d8
Use scripts from `sergey/move-from-specs-repo`.
sergey-shandar Apr 20, 2019
39e435f
simplified model validation.
sergey-shandar Apr 20, 2019
1b1962c
preprod
sergey-shandar Apr 22, 2019
4ca14f4
postToGitHub
sergey-shandar Apr 22, 2019
a73a3ac
momentOfTruthPostProcessing
sergey-shandar Apr 22, 2019
274eb1d
Semantic Validation
sergey-shandar Apr 22, 2019
7dca6bb
Merge rom master
sergey-shandar Apr 23, 2019
c86deb2
getSwaggers()
sergey-shandar Apr 23, 2019
89fe9c3
Use `getExamples()` and `getSwaggers()`.
sergey-shandar Apr 23, 2019
698428c
Update package.json
sergey-shandar Apr 25, 2019
3a5d5d3
Remove travis-CI jobs except branch strategy.
sergey-shandar Apr 25, 2019
41c7b0a
Merge branch 'master' into sergey/move-scripts-stage2
sergey-shandar Apr 25, 2019
19170cf
Merge from master.
sergey-shandar Apr 25, 2019
2cb580f
Merge branch 'sergey/move-scripts-stage2' of https://github.com/Azure…
sergey-shandar Apr 25, 2019
bfec1f7
remove model and semantic validations version 2.
sergey-shandar Apr 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,12 @@ services:
env:
matrix:
- MODE=branchStrategy
- MODE=semantic PR_ONLY=true CHECK_NAME="Semantic Validator"
- MODE=model PR_ONLY=true CHECK_NAME="Model Validator"
- MODE=BreakingChange PR_ONLY=true CHECK_NAME="Breaking Changes"
- MODE=lintdiff PR_ONLY=true CHECK_NAME="Linter Diff" NODE_OPTIONS=--max-old-space-size=8192
matrix:
fast_finish: true
allow_failures:
- env: MODE=model PR_ONLY=true CHECK_NAME="Model Validator"
- env: MODE=BreakingChange PR_ONLY=true CHECK_NAME="Breaking Changes"
install: true
script:
- >-
if [[ $MODE == 'branchStrategy' ]]; then
# Check to ensure CI is not executing for a PR against the master branch in the private repository
! [[ $TRAVIS_PULL_REQUEST != 'false' && $TRAVIS_REPO_SLUG == 'Azure/azure-rest-api-specs-pr' && $TRAVIS_BRANCH == 'master' ]]
fi
- >-
if [[ $MODE == 'semantic' ]]; then
npm install
npm run tsc
node scripts/semanticValidation.js
fi
- >-
if [[ $MODE == 'model' ]]; then
npm install
npm run tsc
node scripts/modelValidation.js
fi
- >-
if [[ $MODE == 'BreakingChange' ]]; then
scripts/install-dotnet.sh
npm install
npm run tsc
node scripts/breaking-change.js
fi
- >-
if [[ $MODE == 'lintdiff' ]]; then
scripts/install-dotnet.sh
npm install
npm run tsc
node scripts/momentOfTruth.js && node scripts/momentOfTruthPostProcessing.js
fi
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
],
"url":"https://raw.githubusercontent.com/Azure/autorest/master/schema/composite-swagger.json"
}
]
],
"typescript.tsdk": "node_modules\\typescript\\lib"
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"devDependencies": {
"@azure/avocado": "^0.4.1",
"@azure/oad": "^0.6.3",
"@azure/rest-api-specs-scripts": "^0.2.21",
"@azure/rest-api-specs-scripts": "^0.3.9",
"@microsoft.azure/async-io": "^2.0.21",
"@microsoft.azure/literate": "^1.0.25",
"@microsoft.azure/polyfill": "^1.0.19",
Expand All @@ -21,6 +21,7 @@
"@ts-common/fs": "0.2.0",
"@types/fs-extra": "^5.0.5",
"@types/js-yaml": "^3.12.1",
"@types/mocha": "^5.2.6",
"@types/request": "^2.48.1",
"fs-extra": "^7.0.1",
"glob": "^7.1.3",
Expand All @@ -31,7 +32,7 @@
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
"ts-node": "^8.1.0",
"typescript": "^3.4.3",
"typescript": "^3.4.4",
"z-schema": "^4.0.2"
},
"homepage": "https://github.com/azure/azure-rest-api-specs",
Expand Down
4 changes: 2 additions & 2 deletions preproduction-azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
inputs:
verbose: false
- script: 'npm install -D @azure/rest-api-specs-scripts@0.3.9'
- script: 'npm run tsc && node scripts/semanticValidation2.js'
- script: 'npm run tsc && node scripts/semanticValidation.js'
displayName: 'Semantic Validation'

- job: "ModelValidation"
Expand All @@ -63,7 +63,7 @@ jobs:
inputs:
verbose: false
- script: 'npm install -D @azure/rest-api-specs-scripts@0.3.9'
- script: 'npm run tsc && node scripts/modelValidation2.js'
- script: 'npm run tsc && node scripts/modelValidation.js'
displayName: 'Model Validation'

- job: "Avocado"
Expand Down
39 changes: 2 additions & 37 deletions scripts/modelValidation.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License in the project root for license information.

import { devOps, cli } from '@azure/avocado'
import { utils } from '@azure/rest-api-specs-scripts'
import * as cp from 'child_process'
import { modelValidation } from '@azure/rest-api-specs-scripts'

const exec = (cmd: string, options?: cp.SpawnSyncOptions) => {
const result = cp.spawnSync(
cmd,
{
...options,
shell: true,
stdio: [process.stdin, process.stdout, process.stderr]
}
)
return result.status
}

async function main() {
const pr = await devOps.createPullRequestProperties(cli.defaultConfig())
const swaggersToProcess = await utils.getFilesChangedInPR(pr);
let result = 0
for (const swagger of swaggersToProcess) {
try {
// await oav.validateExamples(swagger, null, {consoleLogLevel: 'error', pretty: true});
// run OAV as a separate process to avoid memory issues.
const r = exec(`node node_modules/oav/dist/cli.js validate-example ${swagger} --pretty`)
if (result === 0) {
result = r
}
} catch (e) {
console.error("error: ")
console.error(e)
result = 1
}
}
process.exitCode = result
}

main().catch(e => { console.log(e); process.exit(1); })
modelValidation.main().catch(e => { console.log(e); process.exit(1); })
7 changes: 0 additions & 7 deletions scripts/modelValidation2.js

This file was deleted.

Loading