Provide a way to demo changes & Fix m4 published version (#3814)

This commit is contained in:
Timothee Guerin 2021-01-28 16:25:28 -08:00 коммит произвёл GitHub
Родитель 56f0efdde4
Коммит 17e93ae6ae
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
10 изменённых файлов: 208 добавлений и 39 удалений

Просмотреть файл

@ -29,16 +29,11 @@
"shellCommand": "node .scripts/sync-versions.js"
},
{
"commandKind": "global",
"name": "watch",
"summary": "run npm watch on all projects",
"shellCommand": "node .scripts/watch.js"
},
{
"commandKind": "global",
"commandKind": "bulk",
"name": "clean",
"summary": "run npm clean on all projects",
"shellCommand": "node .scripts/npm-run.js clean"
"enableParallelism": false,
"ignoreMissingScript": true
},
{
"commandKind": "bulk",

Просмотреть файл

@ -1,7 +1,6 @@
dependencies:
'@azure-tools/async-io': 3.0.253
'@azure-tools/autorest-extension-base': 3.1.267
'@azure-tools/codegen': 2.5.290
'@azure-tools/codegen-csharp': 3.0.263
'@azure-tools/datastore': 4.1.270
'@azure-tools/deduplication': 3.0.267
@ -123,6 +122,15 @@ packages:
dev: false
resolution:
integrity: sha512-z0uY22Ko7FKqC9L1V/UCAyPKoqyaM8oawRmuVuhjtglds9eIxQ7b6K68a3WYw0NQU/YKhf8LBiTs1hG7nZM3aQ==
/@azure-tools/codegen/2.5.292:
dependencies:
'@azure-tools/async-io': 3.0.253
'@azure-tools/linq': 3.1.262
js-yaml: 3.13.1
semver: 5.7.1
dev: false
resolution:
integrity: sha512-UU9/OgJfd+br9C/M9R8k2r+pyWtanRfl/u865BvkX3yBbMLbDsj12QP/AcY3MoC40rHpWYUJVTBDB84X3zIiIw==
/@azure-tools/codemodel/4.13.349:
dependencies:
'@azure-tools/autorest-extension-base': 3.1.267
@ -8767,7 +8775,7 @@ packages:
dependencies:
'@azure-tools/async-io': 3.0.253
'@azure-tools/autorest-extension-base': 3.1.267
'@azure-tools/codegen': 2.5.290
'@azure-tools/codegen': 2.5.292
'@azure-tools/codegen-csharp': 3.0.263
'@azure-tools/codemodel': 4.13.349
'@azure-tools/datastore': 4.1.270
@ -8790,6 +8798,7 @@ packages:
js-yaml: 3.13.1
prettier: 2.2.1
recursive-diff: 1.0.8
rimraf: 3.0.2
source-map-support: 0.5.19
static-link: 0.3.0
ts-jest: 26.4.4_jest@26.6.3+typescript@3.9.7
@ -8797,7 +8806,7 @@ packages:
dev: false
name: '@rush-temp/modelerfour'
resolution:
integrity: sha512-lokZcSmnXJ8Lhinh3RPZ7v3vxH24X3VDM+/6qi6tZyG0aPIvJhOCwokzJfCw/K47RUzTP6k7GELsCfnpy9TN/A==
integrity: sha512-Fpn+sfIwI8eDlFc998JwlGPnegZfgyqu3zhQZpEYk75GFQ8CbTDBm9pZhNfef7+XldedKgH+aNhYh2VZqJgw+w==
tarball: 'file:projects/modelerfour.tgz'
version: 0.0.0
'file:projects/schemas.tgz':
@ -8811,7 +8820,6 @@ registry: ''
specifiers:
'@azure-tools/async-io': ~3.0.0
'@azure-tools/autorest-extension-base': ~3.1.0
'@azure-tools/codegen': 2.5.290
'@azure-tools/codegen-csharp': ~3.0.0
'@azure-tools/datastore': ~4.1.0
'@azure-tools/deduplication': ~3.0.266

Просмотреть файл

@ -14,28 +14,27 @@ jobs:
steps:
- template: ./templates/verify-changes.yaml
- template: ./templates/build.yaml
- script: npx @microsoft/rush test:ci -v
displayName: Test
- script: npx @microsoft/rush lint -v
displayName: Lint
- task: UsePythonVersion@0
inputs:
versionSpec: "3.x"
displayName: Install Python 3
- script: npx @microsoft/rush publish --publish --pack --include-all
displayName: Pack packages
- script: |
npm install @microsoft.azure/autorest.testserver --no-save
npm install -g @autorest/compare@~0.3.0
displayName: Install autorest-compare
- publish: $(Build.SourcesDirectory)/common/temp/artifacts/packages
artifact: packages
displayName: Publish packages(.tgz) as pipeline artifacts
- script: autorest-compare --compare:.scripts/regression-compare.yaml --language:python
displayName: Regression Test - @autorest/python
- template: ./templates/create-tryit-comment.yaml
- script: autorest-compare --compare:.scripts/regression-compare.yaml --language:typescript
displayName: Regression Test - @autorest/typescript
- job: regressiontests
displayName: Regression tests
dependsOn: main
steps:
- template: ./templates/regression-tests.yaml
- job: lintdocs
displayName: Lint docs
@ -43,4 +42,4 @@ jobs:
- script: |
sudo npm install -g markdown-link-check
find docs -name "*.md" -print0 | xargs -0 -n1 markdown-link-check -c ./markdown-link-check-config.json
displayName: Find
displayName: Find

Просмотреть файл

@ -0,0 +1,31 @@
You may test this build by running `autorest --reset` and then either:
<hr>
Add the following CLI flags
| Pacakge | Flag | Description |
| --------------------- | -------------------------------------------- | ----------------------------- |
| @autorest/core | `--version:{{AUTOREST_CORE_DOWNLOAD_URL}}` | For changes to autorest core. |
| @autorest/modelerfour | `--use:{{AUTOREST_MODELERFOUR_DOWNLOAD_URL}}` | For changes to modelerfour. |
Or with all
```bash
autorest --version:{{AUTOREST_CORE_DOWNLOAD_URL}} --use:{{AUTOREST_MODELERFOUR_DOWNLOAD_URL}}
```
<hr>
or use the following in your autorest configuration:
```yaml
# For changes to autorest core
version: "{{AUTOREST_CORE_DOWNLOAD_URL}}"
# For changes to modelerfour
use-extension:
"@autorest/modelerfour": "{{AUTOREST_MODELERFOUR_DOWNLOAD_URL}}"
```
<hr>
If this build is good for you, give this comment a thumbs up. (👍)
And you should run `autorest --reset` again once you're finished testing to remove it.

Просмотреть файл

@ -0,0 +1,64 @@
$root = $env:BUILD_SOURCESDIRECTORY
function Get-ArtifactBaseDownloadUrl() {
$url = "$env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI$env:SYSTEM_TEAMPROJECTID/_apis/build/builds/$env:BUILD_BUILDID/artifacts?artifactName=packages&api-version=5.1"
Write-Host "Getting artifact info at: '$url'"
$buildPipeline= Invoke-RestMethod -Uri $url -Headers @{ Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN" } -Method Get
$ArtifactDownloadURL= $buildPipeline.resource.downloadUrl
return $ArtifactDownloadURL
}
function Get-DownloadUrl([string] $baseDownloadUrl, [string] $filename) {
return $baseDownloadUrl -replace "format=zip","format=file&subPath=%2F$filename";
}
function Create-TinyUrlForArtifact([string] $baseDownloadUrl, [string] $filename, [string]$outVarName) {
$downloadUrl = Get-DownloadUrl -baseDownloadUrl $baseDownloadUrl -filename $filename
Write-Host "Raw Artifact Url: '$downloadUrl'"
$downurl = (iwr "http://tinyurl.com/api-create.php?url=$( [System.Web.HttpUtility]::UrlEncode($downloadUrl))" ).Content
Write-Host "Tiny Url: '$tinyUrl'"
return $downurl;
}
function Get-PackageVersion([string] $packageRoot) {
$version = (Get-Content "$packageRoot/package.json") -join "`n" | ConvertFrom-Json | Select -ExpandProperty "version";
Write-Host "Version for package at $packageRoot is $version"
return $version;
}
function Format-Comment([string] $coreDownloadUrl, [string] $modelerfourDownloadUrl) {
$template = get-content -raw -encoding utf8 "$root/eng/pipelines/resources/tryit-comment-template.md";
$AUTOREST_CORE_DOWNLOAD_URL = $coreDownloadUrl
$AUTOREST_MODELERFOUR_DOWNLOAD_URL = $modelerfourDownloadUrl
return $template `
-replace "{{AUTOREST_CORE_DOWNLOAD_URL}}", $coreDownloadUrl `
-replace "{{AUTOREST_MODELERFOUR_DOWNLOAD_URL}}", $modelerfourDownloadUrl
}
function Run() {
$baseDownloadUrl = Get-ArtifactBaseDownloadUrl
Write-Host "Base download url is $baseDownloadUrl";
$coreVersion = Get-PackageVersion -packageRoot $root/packages/extensions/core
$m4Version = Get-PackageVersion -packageRoot $root/packages/extensions/modelerfour
$coreDownloadUrl = Create-TinyUrlForArtifact -baseDownloadUrl $baseDownloadUrl -filename "autorest-core-$coreVersion.tgz";
$modelerfourDownloadUrl = Create-TinyUrlForArtifact -baseDownloadUrl $baseDownloadUrl -filename "autorest-modelerfour-$m4Version.tgz";
$comment = Format-Comment -coreDownloadUrl $coreDownloadUrl -modelerfourDownloadUrl $modelerfourDownloadUrl
Write-Host "Github comment content:"
Write-Host "-----------------------"
Write-Host $comment
Write-Host "-----------------------"
$escapedComment = $comment -replace "`n", "%0D%0A"
Write-Host "$escapedComment"
Write-Host "======================"
Write-Host "##vso[task.setvariable variable=TRYIT_COMMENT]$escapedComment"
}
Run

Просмотреть файл

@ -0,0 +1,9 @@
steps:
- pwsh: $(Build.SourcesDirectory)/eng/pipelines/scripts/get-tryit-github-comment.ps1
displayName: "Build Github Comment"
- task: GitHubComment@0
inputs:
gitHubConnection: "Azure"
repositoryName: "$(Build.Repository.Name)"
comment: $(TRYIT_COMMENT)

Просмотреть файл

@ -0,0 +1,42 @@
# Steps the for regresion test using autorest-compare.
steps:
- download: current
artifact: packages
displayName: Download packages(.tgz)
- script: |
corePkg="$(find $(Pipeline.Workspace)/packages -type f -iname "autorest-core-*.tgz" )"
modelerfourPkg="$(find $(Pipeline.Workspace)/packages -type f -iname "autorest-modelerfour-*.tgz" )"
[ -z "$corePkg" ] && echo "Error: Couldn't find autorest core package" && exit 1
[ -z "$modelerfourPkg" ] && echo "Error: Couldn't find autorest modelerfour package" && exit 1
echo "Found core package $corePkg"
echo "Found modelerfour package $modelerfourPkg"
sed -i "s,--version:../packages/extensions/core,--version:$corePkg," ./.scripts/regression-compare.yaml
sed -i "s,--use:../packages/extensions/modelerfour,--use:$modelerfourPkg," ./.scripts/regression-compare.yaml
displayName: Find packages path
- script: cat ./.scripts/regression-compare.yaml
- task: NodeTool@0
inputs:
versionSpec: "14.x"
displayName: "Install Node.js"
- task: UsePythonVersion@0
inputs:
versionSpec: "3.x"
displayName: Install Python 3
- script: |
npm install @microsoft.azure/autorest.testserver --no-save
npm install -g @autorest/compare@~0.3.0
displayName: Install autorest-compare
- script: autorest-compare --compare:.scripts/regression-compare.yaml --language:python
displayName: Regression Test - @autorest/python
- script: autorest-compare --compare:.scripts/regression-compare.yaml --language:typescript
displayName: Regression Test - @autorest/typescript

Просмотреть файл

@ -1,6 +1,18 @@
{
"name": "@autorest/modelerfour",
"entries": [
{
"version": "4.15.456",
"tag": "@autorest/modelerfour_v4.15.456",
"date": "Thu, 28 Jan 2021 00:22:27 GMT",
"comments": {
"patch": [
{
"comment": "Fix static linking issue with modelerfour resulting in incompatible dependency."
}
]
}
},
{
"version": "4.15.455",
"tag": "@autorest/modelerfour_v4.15.455",
@ -22,22 +34,22 @@
"version": "4.15.x",
"comments": {
"patch": [
{
{
"comment": "**Fix** Missing description in responses. ([PR 370](https://github.com/Azure/autorest.modelerfour/pull/370))"
},
{
{
"comment": "**Feature** Added new flag `always-create-accept-parameter` to enable/disable accept param auto generation. ([PR 366](https://github.com/Azure/autorest.modelerfour/pull/366))"
},
{
{
"comment": "**Fix** Allow request with body being a file and `application/json` content-type. ([PR 363](https://github.com/Azure/autorest.modelerfour/pull/363))"
},
{
{
"comment": "**Fix** Dictionaries of dictionaries not being modeled as such(`dict[str, object]` instead of `dict[str, dict[str, str]]`). ([PR 372](https://github.com/Azure/autorest.modelerfour/pull/372))"
},
{
{
"comment": "**Fix** Issue with sibling models(Model just being a ref of another) causing circular dependency exception. ([PR 375](https://github.com/Azure/autorest.modelerfour/pull/375))"
},
{
{
"comment": "**Fix** Issue with duplicates schemas names due to consequtive name duplicate removal. ([PR 374](https://github.com/Azure/autorest.modelerfour/pull/374))"
},
{
@ -219,7 +231,7 @@
"version": "4.2.75",
"comments": {
"patch": [
{
{
"comment": "add `style` to parameters to support collection format "
},
{

Просмотреть файл

@ -1,6 +1,13 @@
# Change Log - @autorest/modelerfour
This log was last generated on Tue, 26 Jan 2021 22:07:03 GMT and should not be manually modified.
This log was last generated on Thu, 28 Jan 2021 00:22:27 GMT and should not be manually modified.
## 4.15.456
Thu, 28 Jan 2021 00:22:27 GMT
### Patches
- Fix static linking issue with modelerfour resulting in incompatible dependency.
## 4.15.455
Tue, 26 Jan 2021 21:36:02 GMT

Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "@autorest/modelerfour",
"version": "4.15.455",
"version": "4.15.456",
"description": "AutoRest Modeler Version Four (component)",
"directories": {
"doc": "docs"
@ -11,6 +11,7 @@
"main": "dist/exports.js",
"typings": "dist/exports.d.ts",
"scripts": {
"clean": "rimraf ./dist",
"start": "node --max_old_space_size=4096 ./entrypoints/main.js",
"debug": "node --max_old_space_size=4096 --inspect-brk=localhost:9229 ./entrypoints/main.js",
"fix": "eslint ./src --fix --ext .ts",
@ -52,7 +53,7 @@
"jest-snapshot": "~26.6.2",
"expect": "~26.6.2",
"ts-jest": "^26.4.4",
"@azure-tools/codegen": "2.5.290",
"@azure-tools/codegen": "~2.5.292",
"@azure-tools/codegen-csharp": "~3.0.0",
"@azure-tools/autorest-extension-base": "~3.1.0",
"@autorest/codemodel": "~4.14.3",
@ -64,15 +65,16 @@
"chalk": "2.3.0",
"recursive-diff": "~1.0.6",
"prettier": "~2.2.1",
"eslint-plugin-prettier": "~3.2.0"
"eslint-plugin-prettier": "~3.2.0",
"rimraf": "~3.0.0"
},
"static-link": {
"entrypoints": [],
"dependencies": {
"@azure-tools/codegen": "~2.4.0",
"@azure-tools/codegen": "~2.5.292",
"@azure-tools/codegen-csharp": "~3.0.0",
"@azure-tools/autorest-extension-base": "~3.1.0",
"@autorest/codemodel": "~4.14.0",
"@autorest/codemodel": "~4.14.3",
"@azure-tools/tasks": "~3.0.0",
"@azure-tools/openapi": "~3.0.0",
"@azure-tools/datastore": "~4.1.0",