diff --git a/.ci/scripts/check_release.py b/.ci/scripts/check_release.py index 4739a7e26..275b5f363 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 8a79931a4..1117d8d15 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 fa55350fa..06c4f52ab 100644 --- a/.github/template_gitref +++ b/.github/template_gitref @@ -1 +1 @@ -2021.08.26-304-gc53c1e3 +2021.08.26-310-g59cd732 diff --git a/.github/workflows/create-branch.yml b/.github/workflows/create-branch.yml index 7bac8e935..7b66ec6b8 100644 --- a/.github/workflows/create-branch.yml +++ b/.github/workflows/create-branch.yml @@ -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_deb --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 e6e318dc0..2b2640306 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,7 @@ name: "Deb 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 826502336..edf030bd9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,7 @@ jobs: with: fetch-depth: 0 path: "pulp_deb" + token: ${{ secrets.RELEASE_TOKEN }} - uses: "actions/setup-python@v4" with: 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 cf331bfbb..820b16259 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 deb --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_deb.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_deb.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_deb.tests.performance" + cmd_user_prefix bash -c "pytest -vv -r sx --color=yes --suppress-no-test-exit-code --capture=no --durations=0 --pyargs pulp_deb.tests.performance" else - cmd_user_prefix bash -c "pytest -vv -r sx --color=yes --pyargs --capture=no --durations=0 pulp_deb.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_deb.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" == "Deb Nightly CI/CD" ]] - then - cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_deb.tests.functional -m parallel -n 8 --nightly" - cmd_user_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_deb.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_deb.tests.functional -m parallel -n 8" - cmd_user_prefix bash -c "pytest -v -r sx --color=yes --pyargs pulp_deb.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_deb.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_deb.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_deb.tests.functional -m parallel -n 8" + cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_deb.tests.functional -m 'not parallel'" + fi fi export PULP_FIXTURES_URL="http://pulp-fixtures:8080" pushd ../pulp-cli-deb diff --git a/.github/workflows/scripts/update_backport_labels.py b/.github/workflows/scripts/update_backport_labels.py index 26b223213..5abf86dc8 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/lint_requirements.txt b/lint_requirements.txt index 4d7df1a0d..860678007 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 b22fa6292..05803a8c2 100644 --- a/template_config.yml +++ b/template_config.yml @@ -1,9 +1,8 @@ # 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-310-g59cd732 -additional_repos: [] api_root: /pulp/ black: true check_commit_message: true @@ -12,12 +11,7 @@ check_manifest: true check_stray_pulpcore_imports: true ci_env: {} ci_trigger: '{pull_request: {branches: [''*'']}}' -ci_update_branches: -- '2.20' -- '2.21' -- '3.0' ci_update_docs: false -ci_update_release_behavior: null cli_package: pulp-cli-deb cli_repo: https://github.com/pulp/pulp-cli-deb.git core_import_allowed: [] @@ -34,6 +28,7 @@ flake8_ignore: [] github_org: pulp issue_tracker: github kanban: false +latest_release_branch: null lint_requirements: true noissue_marker: '[noissue]' parallel_test_workers: 8 @@ -73,6 +68,10 @@ stalebot: true stalebot_days_until_close: 30 stalebot_days_until_stale: 90 stalebot_limit_to_pulls: true +supported_release_branches: +- '2.20' +- '2.21' +- '3.0' sync_ci: true test_azure: true test_cli: true