From 2ddd77f2193e7260165c2e3526f285dbe7948ac7 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Tue, 28 Sep 2021 15:10:59 -0400 Subject: [PATCH 1/5] skip autorest check --- sdk/appconfiguration/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/appconfiguration/ci.yml b/sdk/appconfiguration/ci.yml index 8954574d8e3f..13900cd093ba 100644 --- a/sdk/appconfiguration/ci.yml +++ b/sdk/appconfiguration/ci.yml @@ -29,7 +29,6 @@ extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: appconfiguration - VerifyAutorest: true ValidateFormatting: false Artifacts: - name: azure-appconfiguration From c567868080529f0b5bffbdfb5b81d241b38ada9f Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Tue, 28 Sep 2021 15:17:11 -0400 Subject: [PATCH 2/5] make verify autorest raise a warning instead --- scripts/devops_tasks/verify_autorest.py | 4 ++-- sdk/appconfiguration/ci.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/devops_tasks/verify_autorest.py b/scripts/devops_tasks/verify_autorest.py index 561ae2d8b18e..8318332be7a3 100644 --- a/scripts/devops_tasks/verify_autorest.py +++ b/scripts/devops_tasks/verify_autorest.py @@ -8,7 +8,7 @@ import argparse import os import logging -import sys +import warnings from common_tasks import run_check_call @@ -87,7 +87,7 @@ def check_diff(folder): if result: command = ["git", "status"] run_check_call(command, root_dir) - raise ValueError( + warnings.warn( "Found difference between re-generated code and current commit. Please re-generate with the latest autorest." ) diff --git a/sdk/appconfiguration/ci.yml b/sdk/appconfiguration/ci.yml index 13900cd093ba..8954574d8e3f 100644 --- a/sdk/appconfiguration/ci.yml +++ b/sdk/appconfiguration/ci.yml @@ -29,6 +29,7 @@ extends: template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml parameters: ServiceDirectory: appconfiguration + VerifyAutorest: true ValidateFormatting: false Artifacts: - name: azure-appconfiguration From 5a4f0d864cade9c983ee82664b78d27ec13fa1fe Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Tue, 28 Sep 2021 15:59:47 -0400 Subject: [PATCH 3/5] print warning in dev ops warning format --- scripts/devops_tasks/verify_autorest.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/devops_tasks/verify_autorest.py b/scripts/devops_tasks/verify_autorest.py index 8318332be7a3..bd2d72fc5c03 100644 --- a/scripts/devops_tasks/verify_autorest.py +++ b/scripts/devops_tasks/verify_autorest.py @@ -8,7 +8,6 @@ import argparse import os import logging -import warnings from common_tasks import run_check_call @@ -87,8 +86,8 @@ def check_diff(folder): if result: command = ["git", "status"] run_check_call(command, root_dir) - warnings.warn( - "Found difference between re-generated code and current commit. Please re-generate with the latest autorest." + print( + "##[warning]Found difference between re-generated code and current commit. Please re-generate with the latest autorest." ) From 43231701c7dc7bd0691cad773fa526061ef01b62 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Tue, 28 Sep 2021 17:30:01 -0400 Subject: [PATCH 4/5] use continueOnError and throw error --- eng/pipelines/templates/steps/verify-autorest.yml | 1 + scripts/devops_tasks/verify_autorest.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/templates/steps/verify-autorest.yml b/eng/pipelines/templates/steps/verify-autorest.yml index 0d6b19f2bf4a..2474dc599ad3 100644 --- a/eng/pipelines/templates/steps/verify-autorest.yml +++ b/eng/pipelines/templates/steps/verify-autorest.yml @@ -34,6 +34,7 @@ steps: - task: PythonScript@0 displayName: 'Verify autorest' + continueOneError: true inputs: scriptPath: 'scripts/devops_tasks/verify_autorest.py' arguments: >- diff --git a/scripts/devops_tasks/verify_autorest.py b/scripts/devops_tasks/verify_autorest.py index bd2d72fc5c03..90f683f0e89c 100644 --- a/scripts/devops_tasks/verify_autorest.py +++ b/scripts/devops_tasks/verify_autorest.py @@ -86,8 +86,8 @@ def check_diff(folder): if result: command = ["git", "status"] run_check_call(command, root_dir) - print( - "##[warning]Found difference between re-generated code and current commit. Please re-generate with the latest autorest." + raise ValueError( + "Found difference between re-generated code and current commit. Please re-generate with the latest autorest." ) From 049201d819506933b487aef30d771c23554efaa7 Mon Sep 17 00:00:00 2001 From: iscai-msft Date: Tue, 28 Sep 2021 17:37:49 -0400 Subject: [PATCH 5/5] fix typo for continueOnError --- eng/pipelines/templates/steps/verify-autorest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/pipelines/templates/steps/verify-autorest.yml b/eng/pipelines/templates/steps/verify-autorest.yml index 2474dc599ad3..ab52c69b6235 100644 --- a/eng/pipelines/templates/steps/verify-autorest.yml +++ b/eng/pipelines/templates/steps/verify-autorest.yml @@ -34,7 +34,7 @@ steps: - task: PythonScript@0 displayName: 'Verify autorest' - continueOneError: true + continueOnError: true inputs: scriptPath: 'scripts/devops_tasks/verify_autorest.py' arguments: >-