From 4f2a86ef34c8d278debf1a8fe44b48f39635cc41 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Thu, 18 Feb 2021 14:47:00 +0100 Subject: [PATCH] Update plugin template This accommodates for a change in pulpcore that will effect the CI. https://github.com/pulp/pulpcore/pull/1102 [noissue] --- .ci/ansible/settings.py.j2 | 1 - .ci/ansible/start_container.yaml | 23 ++++++++++++++------- .github/workflows/scripts/before_install.sh | 7 ++++++- .github/workflows/scripts/install.sh | 2 +- .github/workflows/scripts/script.sh | 2 +- template_config.yml | 7 +++++++ 6 files changed, 31 insertions(+), 11 deletions(-) diff --git a/.ci/ansible/settings.py.j2 b/.ci/ansible/settings.py.j2 index 7d1371fca..56794bc03 100644 --- a/.ci/ansible/settings.py.j2 +++ b/.ci/ansible/settings.py.j2 @@ -5,7 +5,6 @@ PRIVATE_KEY_PATH = "/etc/pulp/certs/token_private_key.pem" PUBLIC_KEY_PATH = "/etc/pulp/certs/token_public_key.pem" TOKEN_SERVER = "http://pulp:80/token" TOKEN_SIGNATURE_ALGORITHM = "ES256" -ALLOWED_CONTENT_CHECKSUMS = {"sha1", "sha224", "sha256", "sha384", "sha512"} {% if pulp_settings %} {% for key, value in pulp_settings.items() %} diff --git a/.ci/ansible/start_container.yaml b/.ci/ansible/start_container.yaml index 43d4d4709..bdf35b431 100644 --- a/.ci/ansible/start_container.yaml +++ b/.ci/ansible/start_container.yaml @@ -81,13 +81,22 @@ command: "docker logs pulp" failed_when: true - - name: "Check version of component being tested" - assert: - that: - - (result.json.versions | items2dict(key_name="component", value_name="version"))[component_name] | canonical_semver == (component_version | canonical_semver) - fail_msg: | - Component {{ component_name }} was expected to be installed in version {{ component_version }}. - Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[component_name] }}. + - block: + - name: "Check version of component being tested" + assert: + that: + - (result.json.versions | items2dict(key_name="component", value_name="version"))[component_name] | canonical_semver == (component_version | canonical_semver) + fail_msg: | + Component {{ component_name }} was expected to be installed in version {{ component_version }}. + Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[component_name] }}. + rescue: + - name: "Check version of component being tested (legacy)" + assert: + that: + - (result.json.versions | items2dict(key_name="component", value_name="version"))[legacy_component_name] | canonical_semver == (component_version | canonical_semver) + fail_msg: | + Component {{ legacy_component_name }} was expected to be installed in version {{ component_version }}. + Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[legacy_component_name] }}. - name: "Set pulp password in .netrc" copy: diff --git a/.github/workflows/scripts/before_install.sh b/.github/workflows/scripts/before_install.sh index caab88edc..bdbac1b86 100755 --- a/.github/workflows/scripts/before_install.sh +++ b/.github/workflows/scripts/before_install.sh @@ -34,7 +34,8 @@ else fi mkdir .ci/ansible/vars || true echo "---" > .ci/ansible/vars/main.yaml -echo "component_name: pulp_rpm" >> .ci/ansible/vars/main.yaml +echo "legacy_component_name: pulp_rpm" >> .ci/ansible/vars/main.yaml +echo "component_name: rpm" >> .ci/ansible/vars/main.yaml echo "component_version: '${COMPONENT_VERSION}'" >> .ci/ansible/vars/main.yaml export PRE_BEFORE_INSTALL=$PWD/.github/workflows/scripts/pre_before_install.sh @@ -57,11 +58,13 @@ then export PULPCORE_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulpcore\/pull\/(\d+)' | awk -F'/' '{print $7}') export PULP_SMASH_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-smash\/pull\/(\d+)' | awk -F'/' '{print $7}') export PULP_OPENAPI_GENERATOR_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-openapi-generator\/pull\/(\d+)' | awk -F'/' '{print $7}') + export PULP_CLI_PR_NUMBER=$(echo $COMMIT_MSG | grep -oP 'Required\ PR:\ https\:\/\/github\.com\/pulp\/pulp-cli\/pull\/(\d+)' | awk -F'/' '{print $7}') echo $COMMIT_MSG | sed -n -e 's/.*CI Base Image:\s*\([-_/[:alnum:]]*:[-_[:alnum:]]*\).*/ci_base: "\1"/p' >> .ci/ansible/vars/main.yaml else export PULPCORE_PR_NUMBER= export PULP_SMASH_PR_NUMBER= export PULP_OPENAPI_GENERATOR_PR_NUMBER= + export PULP_CLI_PR_NUMBER= export CI_BASE_IMAGE= fi @@ -80,6 +83,8 @@ sed -i -e 's/localhost:24817/pulp/g' generate.sh sed -i -e 's/:24817/pulp/g' generate.sh cd .. + + git clone --depth=1 https://github.com/pulp/pulpcore.git --branch master cd pulpcore diff --git a/.github/workflows/scripts/install.sh b/.github/workflows/scripts/install.sh index 26461d31c..f836faedf 100755 --- a/.github/workflows/scripts/install.sh +++ b/.github/workflows/scripts/install.sh @@ -72,7 +72,7 @@ VARSYAML fi cat >> vars/main.yaml << VARSYAML -pulp_settings: {"allowed_export_paths": ["/tmp"], "allowed_import_paths": ["/tmp"]} +pulp_settings: {"allowed_content_checksums": ["sha1", "sha224", "sha256", "sha384", "sha512"], "allowed_export_paths": ["/tmp"], "allowed_import_paths": ["/tmp"]} VARSYAML if [[ "$TEST" == "pulp" || "$TEST" == "performance" || "$TEST" == "s3" || "$TEST" == "plugin-from-pypi" ]]; then diff --git a/.github/workflows/scripts/script.sh b/.github/workflows/scripts/script.sh index ef676fd1c..d1a2e36a2 100755 --- a/.github/workflows/scripts/script.sh +++ b/.github/workflows/scripts/script.sh @@ -34,7 +34,7 @@ if [[ "$TEST" = "docs" || "$TEST" = "publish" ]]; then echo "Validating OpenAPI schema..." cat $PWD/.ci/scripts/schema.py | cmd_stdin_prefix bash -c "cat > /tmp/schema.py" cmd_prefix bash -c "python3 /tmp/schema.py" - # cmd_prefix bash -c "pulpcore-manager spectacular --file pulp_schema.yml --validate" + cmd_prefix bash -c "pulpcore-manager spectacular --file pulp_schema.yml --validate" if [ -f $POST_DOCS_TEST ]; then source $POST_DOCS_TEST diff --git a/template_config.yml b/template_config.yml index 8a1c3fad0..ce5279845 100644 --- a/template_config.yml +++ b/template_config.yml @@ -25,6 +25,12 @@ plugin_name: pulp_rpm plugin_snake: pulp_rpm publish_docs_to_pulpprojectdotorg: true pulp_settings: + allowed_content_checksums: + - "sha1" + - "sha224" + - "sha256" + - "sha384" + - "sha512" allowed_export_paths: - /tmp allowed_import_paths: @@ -37,6 +43,7 @@ pypi_username: pulp redmine_project: pulp_rpm stable_branch: '3.8' test_bindings: false +test_cli: false test_performance: - sync - publish