From 188a279c5bf14b7cbd7cc0d65cc294fc6862b8d3 Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Mar 30 2021 10:18:09 +0000 Subject: Azure: Run Lint task as separate job Lint task uses PyPI to get the latest Pylint, which may pull in any other packages as dependencies. For distro isolation the Lint job should not produce any meaningful artifacts or they should not be used in subsequent jobs. So, this job have to be isolated from the others. Fixes: https://pagure.io/freeipa/issue/8772 Signed-off-by: Stanislav Levin Reviewed-By: Alexander Bokovoy --- diff --git a/Makefile.am b/Makefile.am index b423337..c5a33e6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -257,6 +257,7 @@ endif $(PYTHON) -m pycodestyle --diff || exit $$?; \ echo -e "\npylint"; \ echo "------"; \ + $(PYTHON) -m pylint --version; \ PYTHONPATH=$(abspath $(top_srcdir)) $(PYTHON) -m pylint \ --rcfile=$(top_srcdir)/pylintrc \ --load-plugins pylint_plugins \ @@ -365,6 +366,7 @@ pylint: $(GENERATED_PYTHON_FILES) ipasetup.py python_scripts -type f -exec grep -qsm1 '^#!.*\bpython' '{}' \; -print`; \ FILES=`echo -e "$${FILES}\n$(AZURE_PYTHON_SCRIPT_SUBDIR)"`; \ echo -e "Pylint on $(PYTHON) is running over files:\n$${FILES}\nPlease wait ...\n"; \ + $(PYTHON) -m pylint --version; \ PYTHONPATH=$(top_srcdir) $(PYTHON) -m pylint \ --rcfile=$(top_srcdir)/pylintrc \ --load-plugins pylint_plugins \ diff --git a/ipatests/azure/azure-pipelines.yml b/ipatests/azure/azure-pipelines.yml index 9cc9406..11c55be 100644 --- a/ipatests/azure/azure-pipelines.yml +++ b/ipatests/azure/azure-pipelines.yml @@ -66,12 +66,23 @@ jobs: options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged --env container=docker steps: - template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }} + - template: templates/${{ variables.PREPARE_LINT_TEMPLATE }} - template: templates/${{ variables.AUTOCONF_TEMPLATE }} - script: | set -e echo "Running make target 'lint'" make V=0 lint displayName: Lint sources + +- job: Docs + pool: + vmImage: $(VM_IMAGE) + container: + image: $(DOCKER_BUILD_IMAGE) + options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged --env container=docker + steps: + - template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }} + - template: templates/${{ variables.AUTOCONF_TEMPLATE }} - template: templates/${{ variables.BUILD_DOCS_TEMPLATE }} - template: templates/publish-build.yml parameters: diff --git a/ipatests/azure/templates/prepare-lint-fedora.yml b/ipatests/azure/templates/prepare-lint-fedora.yml new file mode 100644 index 0000000..d0e3988 --- /dev/null +++ b/ipatests/azure/templates/prepare-lint-fedora.yml @@ -0,0 +1,7 @@ +steps: +- script: | + set -e + sudo dnf -y install python3-pip + # https://pagure.io/freeipa/issue/8771 + python3 -m pip install --user --upgrade astroid pylint==2.7.1 + displayName: Install Lint dependencies diff --git a/ipatests/azure/templates/variables-fedora.yml b/ipatests/azure/templates/variables-fedora.yml index eaada50..115389a 100644 --- a/ipatests/azure/templates/variables-fedora.yml +++ b/ipatests/azure/templates/variables-fedora.yml @@ -17,6 +17,9 @@ variables: PREPARE_TOX_TEMPLATE: ${{ format('prepare-tox-{0}.yml', variables.IPA_PLATFORM) }} PREPARE_WEBUI_TEMPLATE: ${{ format('prepare-webui-{0}.yml', variables.IPA_PLATFORM) }} + # the template to install Lint dependencies + PREPARE_LINT_TEMPLATE: ${{ format('prepare-lint-{0}.yml', variables.IPA_PLATFORM) }} + # the template to build sphinx docs BUILD_DOCS_TEMPLATE: ${{ format('build-docs-{0}.yml', variables.IPA_PLATFORM) }} diff --git a/ipatests/azure/templates/variables-rawhide.yml b/ipatests/azure/templates/variables-rawhide.yml index 1a0b9f8..32bbfd9 100644 --- a/ipatests/azure/templates/variables-rawhide.yml +++ b/ipatests/azure/templates/variables-rawhide.yml @@ -20,6 +20,9 @@ variables: PREPARE_TOX_TEMPLATE: ${{ format('prepare-tox-{0}.yml', variables.IPA_PLATFORM) }} PREPARE_WEBUI_TEMPLATE: ${{ format('prepare-webui-{0}.yml', variables.IPA_PLATFORM) }} + # the template to install Lint dependencies + PREPARE_LINT_TEMPLATE: ${{ format('prepare-lint-{0}.yml', variables.IPA_PLATFORM) }} + # the template to build sphinx docs BUILD_DOCS_TEMPLATE: ${{ format('build-docs-{0}.yml', variables.IPA_PLATFORM) }}