From b2f13199e63a2d3e6a38f3cd1a1b402b8ffd14a6 Mon Sep 17 00:00:00 2001 From: NarayanThiru Date: Thu, 15 Dec 2022 15:46:34 -0800 Subject: [PATCH] Upgrade Python version from 3.6 to 3.7 (#203) * Upgrade Python version from 3.6 to 3.10 Upgrade to 3.10 for the job that runs Wheel, PyLint, Flake, etc., since 3.6 is not supported anymore by hosted-agent-software. * Upgrade to Python 3.10 from 3.6 Upgrade to 3.10 as 3.6 is not supported * Switch PyLink to 1.9.4 Switch PyLink to 1.9.4 from 1.9.5, as 1.9.5 is not supported with Python 3.10 * Use Python 3.7 for Static Analysis Use 3.7, as 3.10 does not support certain properties used by astpeephole.py that is used by Static Analysis tools * Try unpinned version of PyLint PyLint 1.9.5 doesn't work with Python 3.7. So, trying to see if it automatically pulls the latest compatible version. * Run pylint as a separate command * Update pylintrc (#204) * Update pylintrc * Update k8s-custom-pipelines.yml * Disable PyLint (#205) Disable PyLint for now, as the new version has breaking changes and requires lot more fixes * Disable PyLint on CI scripts * Fixes for script errors * Upgrade Static Analysis Python version Upgrade the Python version for Static Analysis to 3.10, from 3.7, now that PyLint is disabled * Try 3.9, as 3.10 has breaking changes for Flake8 * Remove version pinning for flake8 Try Python 3.10, without pinning flake8 to a version * Update k8s-custom-pipelines.yml * Use Python 3.8.1 & flake8 6.0.0 * Use Python 3.8 instead of 3.8.1 * Update k8s-custom-pipelines.yml * Update .flake8 Update to reflect breaking change in flake8 6.0 * Update source_code_static_analysis.py Scope static analysis tools to only k8s-extension module's source in our branch. * Update k8s-custom-pipelines.yml * Update k8s-custom-pipelines.yml * Update k8s-custom-pipelines.yml * Update pool name in StaticAnalysis To mirror what is in main of azure-cli-extensions * Update k8s-custom-pipelines.yml * Fix indentation * Update k8s-custom-pipelines.yml * Update k8s-custom-pipelines.yml * Revert changes * Revert changes * Revert changes to source_code_static_analysis.py * Update source_code_static_analysis.py * Revert changes * Use Ubuntu 20.4 for BuiltTestPublish stage * Switch to ubuntu-20.04 from latest Co-authored-by: Rishik Hombal --- testing/pipeline/k8s-custom-pipelines.yml | 7 ++++--- testing/pipeline/templates/build-extension.yml | 2 +- testing/pipeline/templates/run-test.yml | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/testing/pipeline/k8s-custom-pipelines.yml b/testing/pipeline/k8s-custom-pipelines.yml index c9673e2af66..b5d6396dc2d 100644 --- a/testing/pipeline/k8s-custom-pipelines.yml +++ b/testing/pipeline/k8s-custom-pipelines.yml @@ -55,7 +55,7 @@ stages: path: ./test/extensions/public/Flux.Tests.ps1 - job: BuildPublishExtension pool: - vmImage: 'ubuntu-latest' + vmImage: 'ubuntu-20.04' displayName: "Build and Publish the Extension Artifact" variables: CLI_REPO_PATH: $(Agent.BuildDirectory)/s @@ -105,10 +105,11 @@ stages: azdev verify license + - job: StaticAnalysis displayName: "Static Analysis" pool: - vmImage: 'ubuntu-latest' + vmImage: 'ubuntu-20.04' steps: - task: UsePythonVersion@0 displayName: 'Use Python 3.6' @@ -209,4 +210,4 @@ stages: displayName: "CLI Linter on Modified Extension" env: ADO_PULL_REQUEST_LATEST_COMMIT: $(System.PullRequest.SourceCommitId) - ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch) \ No newline at end of file + ADO_PULL_REQUEST_TARGET_BRANCH: $(System.PullRequest.TargetBranch) diff --git a/testing/pipeline/templates/build-extension.yml b/testing/pipeline/templates/build-extension.yml index cf63db635a6..6ccd671f266 100644 --- a/testing/pipeline/templates/build-extension.yml +++ b/testing/pipeline/templates/build-extension.yml @@ -49,4 +49,4 @@ steps: azdev --version azdev setup -c ../azure-cli -r ${{ parameters.CLI_REPO_PATH }} -e $(EXTENSION_NAME) - azdev extension build $(EXTENSION_NAME) \ No newline at end of file + azdev extension build $(EXTENSION_NAME) diff --git a/testing/pipeline/templates/run-test.yml b/testing/pipeline/templates/run-test.yml index a9950f09063..c0897f3b83e 100644 --- a/testing/pipeline/templates/run-test.yml +++ b/testing/pipeline/templates/run-test.yml @@ -5,7 +5,7 @@ parameters: jobs: - job: ${{ parameters.jobName}} pool: - vmImage: 'ubuntu-latest' + vmImage: 'ubuntu-20.04' variables: ${{ if eq(variables['IS_PRIVATE_BRANCH'], 'False') }}: EXTENSION_NAME: "k8s-extension" @@ -101,4 +101,4 @@ jobs: inlineScript: | .\Cleanup.ps1 -CI workingDirectory: $(TEST_PATH) - condition: succeededOrFailed() \ No newline at end of file + condition: succeededOrFailed()