diff --git a/.ci/ansible/Containerfile.j2 b/.ci/ansible/Containerfile.j2 index c6c21fdb..338ff697 100644 --- a/.ci/ansible/Containerfile.j2 +++ b/.ci/ansible/Containerfile.j2 @@ -1,4 +1,4 @@ -FROM {{ ci_base | default("ghcr.io/pulp/pulp-ci-centos:" + pulp_container_tag) }} +FROM {{ ci_base | default(pulp_default_container) }} # Add source directories to container {% for item in plugins %} @@ -11,7 +11,7 @@ ADD ./{{ item.name }} ./{{ item.name }} RUN pip3 install {%- if s3_test | default(false) -%} -{{ " " }}git+https://github.com/fabricio-aguiar/botocore.git@fix-100-continue +{{ " " }}git+https://github.com/gerrod3/botocore.git@fix-100-continue {%- endif -%} {%- for item in plugins -%} {{ " " }}{{ item.source }} diff --git a/.ci/scripts/check_release.py b/.ci/scripts/check_release.py index 1ae7713d..0ff2e147 100755 --- a/.ci/scripts/check_release.py +++ b/.ci/scripts/check_release.py @@ -29,7 +29,7 @@ def main(): "--branches", default="supported", help="A comma separated list of branches to check for releases. Can also use keyword: " - "'supported'. Defaults to 'supported', see `ci_update_branches` in " + "'supported'. Defaults to 'supported', see `supported_release_branches` in " "`plugin_template.yml`.", ) opts = parser.parse_args() @@ -46,12 +46,15 @@ def main(): if branches == "supported": with open(f"{d}/template_config.yml", mode="r") as f: tc = yaml.safe_load(f) - branches = tc["ci_update_branches"] - branches.append(DEFAULT_BRANCH) + branches = set(tc["supported_release_branches"]) + latest_release_branch = tc["latest_release_branch"] + if latest_release_branch is not None: + branches.add(latest_release_branch) + branches.add(DEFAULT_BRANCH) else: - branches = branches.split(",") + branches = set(branches.split(",")) - if diff := set(branches) - set(available_branches): + if diff := branches - set(available_branches): print(f"Supplied branches contains non-existent branches! {diff}") exit(1) diff --git a/.ci/scripts/collect_changes.py b/.ci/scripts/collect_changes.py index 3c8c3f22..4a7aae7b 100755 --- a/.ci/scripts/collect_changes.py +++ b/.ci/scripts/collect_changes.py @@ -19,9 +19,11 @@ CHANGELOG_FILE = tc_settings.get("filename", "NEWS.rst") START_STRING = tc_settings.get( "start_string", - "\n" - if CHANGELOG_FILE.endswith(".md") - else ".. towncrier release notes start\n", + ( + "\n" + if CHANGELOG_FILE.endswith(".md") + else ".. towncrier release notes start\n" + ), ) TITLE_FORMAT = tc_settings.get("title_format", "{name} {version} ({project_date})") diff --git a/.github/template_gitref b/.github/template_gitref index fa55350f..2b533f2f 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-304-gc53c1e3 +2021.08.26-315-g8ecb63d diff --git a/.github/workflows/create-branch.yml b/.github/workflows/create-branch.yml index 2472f0aa..52460fc3 100644 --- a/.github/workflows/create-branch.yml +++ b/.github/workflows/create-branch.yml @@ -33,7 +33,7 @@ jobs: - name: "Install python dependencies" run: | echo ::group::PYDEPS - pip install bump2version jinja2 pyyaml + pip install bump2version jinja2 pyyaml packaging echo ::endgroup:: - name: "Setting secrets" @@ -71,6 +71,19 @@ jobs: run: | find CHANGES -type f -regex ".*\.\(bugfix\|doc\|feature\|misc\|deprecation\|removal\)" -exec git rm {} + + - name: Checkout plugin template + uses: actions/checkout@v3 + with: + repository: pulp/plugin_template + path: plugin_template + fetch-depth: 0 + + - name: Update CI branches in template_config + working-directory: plugin_template + run: | + python3 ./plugin-template pulp_file --github --latest-release-branch "${NEW_BRANCH}" + git add -A + - name: Make a PR with version bump and without CHANGES/* uses: peter-evans/create-pull-request@v4 with: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8c7b5f31..f74995ff 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,7 @@ name: "File Publish Release" on: push: tags: - - "[0-9]+.[0-9]+.[0-9]" + - "[0-9]+.[0-9]+.[0-9]+" defaults: run: @@ -22,7 +22,7 @@ jobs: build-bindings-docs: needs: - - "build-artifacts" + - "build" runs-on: "ubuntu-latest" # Install scripts expect TEST to be set, 'docs' is most appropriate even though we don't run tests env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d357bc6e..74548017 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,7 @@ jobs: with: fetch-depth: 0 path: "pulp_file" + token: ${{ secrets.RELEASE_TOKEN }} - uses: "actions/setup-python@v4" with: diff --git a/.github/workflows/scripts/install.sh b/.github/workflows/scripts/install.sh index 462ac012..5faf7f97 100755 --- a/.github/workflows/scripts/install.sh +++ b/.github/workflows/scripts/install.sh @@ -80,9 +80,7 @@ cat >> vars/main.yaml << VARSYAML pulp_env: {} pulp_settings: {"allowed_content_checksums": ["sha1", "sha224", "sha256", "sha384", "sha512"], "allowed_export_paths": ["/tmp"], "allowed_import_paths": ["/tmp"]} pulp_scheme: https - -pulp_container_tag: "latest" - +pulp_default_container: ghcr.io/pulp/pulp-ci-centos:latest VARSYAML SCENARIOS=("pulp" "performance" "azure" "gcp" "s3" "generate-bindings" "lowerbounds") diff --git a/.github/workflows/scripts/release.sh b/.github/workflows/scripts/release.sh old mode 100644 new mode 100755 diff --git a/.github/workflows/scripts/script.sh b/.github/workflows/scripts/script.sh index 2f4b08fe..4ea9c680 100755 --- a/.github/workflows/scripts/script.sh +++ b/.github/workflows/scripts/script.sh @@ -129,14 +129,14 @@ echo "Checking for uncommitted migrations..." cmd_user_prefix bash -c "django-admin makemigrations file --check --dry-run" # Run unit tests. -cmd_user_prefix bash -c "PULP_DATABASES__default__USER=postgres pytest -v -r sx --color=yes -p no:pulpcore --pyargs pulp_file.tests.unit" +cmd_user_prefix bash -c "PULP_DATABASES__default__USER=postgres pytest -v -r sx --color=yes --suppress-no-test-exit-code -p no:pulpcore --pyargs pulp_file.tests.unit" # Run functional tests if [[ "$TEST" == "performance" ]]; then if [[ -z ${PERFORMANCE_TEST+x} ]]; then - cmd_user_prefix bash -c "pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_file.tests.performance" + cmd_user_prefix bash -c "pytest -vv -r sx --color=yes --suppress-no-test-exit-code --capture=no --durations=0 --pyargs pulp_file.tests.performance" else - cmd_user_prefix bash -c "pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_file.tests.performance.test_${PERFORMANCE_TEST}" + cmd_user_prefix bash -c "pytest -vv -r sx --color=yes --suppress-no-test-exit-code --capture=no --durations=0 --pyargs pulp_file.tests.performance.test_${PERFORMANCE_TEST}" fi exit fi @@ -144,15 +144,14 @@ fi if [ -f "$FUNC_TEST_SCRIPT" ]; then source "$FUNC_TEST_SCRIPT" else - if [[ "$GITHUB_WORKFLOW" == "File Nightly CI/CD" ]] - then - cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m parallel -n 8 --nightly" - cmd_user_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional -m 'not parallel' --nightly" - - else - cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m parallel -n 8" - cmd_user_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_file.tests.functional -m 'not parallel'" - fi + if [[ "$GITHUB_WORKFLOW" =~ "Nightly" ]] + then + cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m parallel -n 8 --nightly" + cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m 'not parallel' --nightly" + else + cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m parallel -n 8" + cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_file.tests.functional -m 'not parallel'" + fi fi export PULP_FIXTURES_URL="http://pulp-fixtures:8080" pushd ../pulp-cli diff --git a/.github/workflows/scripts/update_backport_labels.py b/.github/workflows/scripts/update_backport_labels.py index 854ff077..8cccd498 100755 --- a/.github/workflows/scripts/update_backport_labels.py +++ b/.github/workflows/scripts/update_backport_labels.py @@ -32,10 +32,14 @@ def random_color(): assert response.status_code == 200 old_labels = set([x["name"] for x in response.json() if x["name"].startswith("backport-")]) -# get ci_update_branches from template_config.yml +# get list of branches from template_config.yml with open("./template_config.yml", "r") as f: plugin_template = yaml.safe_load(f) -new_labels = set(["backport-" + x for x in plugin_template["ci_update_branches"]]) +branches = set(plugin_template["supported_release_branches"]) +latest_release_branch = plugin_template["latest_release_branch"] +if latest_release_branch is not None: + branches.add(latest_release_branch) +new_labels = {"backport-" + x for x in branches} # delete old labels that are not in new labels for label in old_labels.difference(new_labels): diff --git a/docs/template_gitref b/docs/template_gitref index fa55350f..2b533f2f 100644 --- a/docs/template_gitref +++ b/docs/template_gitref @@ -1 +1 @@ -2021.08.26-304-gc53c1e3 +2021.08.26-315-g8ecb63d diff --git a/functest_requirements.txt b/functest_requirements.txt index 44e10590..55c3f987 100644 --- a/functest_requirements.txt +++ b/functest_requirements.txt @@ -1,7 +1,7 @@ aiofiles aiohttp beautifulsoup4 -pytest +pytest<8 pytest-custom_exit_code pytest-xdist proxy.py~=2.4.1 diff --git a/lint_requirements.txt b/lint_requirements.txt index c710c3c3..cb7bb6ed 100644 --- a/lint_requirements.txt +++ b/lint_requirements.txt @@ -6,7 +6,7 @@ # For more info visit https://github.com/pulp/plugin_template # python packages handy for developers, but not required by pulp -black +black==23.12.1 check-manifest flake8 flake8-black diff --git a/template_config.yml b/template_config.yml index 96e74bdb..68175a94 100644 --- a/template_config.yml +++ b/template_config.yml @@ -1,27 +1,18 @@ # This config represents the latest values used when running the plugin-template. Any settings that # were not present before running plugin-template have been added with their default values. -# generated with plugin_template@2021.08.26-301-g83f0607 +# generated with plugin_template@2021.08.26-315-g8ecb63d -additional_repos: -- branch: main - name: pulp-certguard api_root: /pulp/ black: true check_commit_message: true check_gettext: true check_manifest: true check_stray_pulpcore_imports: true +ci_base_image: ghcr.io/pulp/pulp-ci-centos ci_env: {} ci_trigger: '{pull_request: {branches: [''*'']}}' -ci_update_branches: -- '1.10' -- '1.11' -- '1.12' -- '1.13' -- '1.14' ci_update_docs: true -ci_update_release_behavior: null cli_package: pulp-cli cli_repo: https://github.com/pulp/pulp-cli.git core_import_allowed: [] @@ -39,6 +30,7 @@ flake8_ignore: [] github_org: pulp issue_tracker: github kanban: true +latest_release_branch: null lint_requirements: true noissue_marker: '[noissue]' parallel_test_workers: 8 @@ -82,6 +74,12 @@ stalebot: true stalebot_days_until_close: 30 stalebot_days_until_stale: 90 stalebot_limit_to_pulls: true +supported_release_branches: +- '1.10' +- '1.11' +- '1.12' +- '1.13' +- '1.14' sync_ci: true test_azure: true test_cli: true diff --git a/unittest_requirements.txt b/unittest_requirements.txt index c4380ab7..421e7ba7 100644 --- a/unittest_requirements.txt +++ b/unittest_requirements.txt @@ -1,2 +1,3 @@ mock pytest-django +pytest<8