From 43fe649fe57373e94ce57e56f60a62f6b9737c5c Mon Sep 17 00:00:00 2001 From: pulpbot Date: Thu, 10 Apr 2025 17:20:11 +0000 Subject: [PATCH] Bump minor version --- .ci/scripts/validate_commit_message.py | 126 ++++++++++++---------- .github/workflows/ci.yml | 2 +- .github/workflows/scripts/script.sh | 10 +- .github/workflows/update_ci.yml | 14 +-- CHANGES/+preliminary-md-24-support.misc | 1 - CHANGES/+proxy-sync-regression-313.bugfix | 1 - CHANGES/706.feature | 1 - CHANGES/809.misc | 1 - CHANGES/815.feature | 2 - pulp_python/app/__init__.py | 2 +- pyproject.toml | 4 +- template_config.yml | 6 +- 12 files changed, 87 insertions(+), 83 deletions(-) mode change 100755 => 100644 .ci/scripts/validate_commit_message.py delete mode 100644 CHANGES/+preliminary-md-24-support.misc delete mode 100644 CHANGES/+proxy-sync-regression-313.bugfix delete mode 100644 CHANGES/706.feature delete mode 100644 CHANGES/809.misc delete mode 100644 CHANGES/815.feature diff --git a/.ci/scripts/validate_commit_message.py b/.ci/scripts/validate_commit_message.py old mode 100755 new mode 100644 index bb9a7d8b..a4dc9004 --- a/.ci/scripts/validate_commit_message.py +++ b/.ci/scripts/validate_commit_message.py @@ -1,66 +1,31 @@ -# WARNING: DO NOT EDIT! -# -# This file was generated by plugin_template, and is managed by it. Please use -# './plugin-template --github pulp_python' to update this file. -# -# For more info visit https://github.com/pulp/plugin_template +# This file is managed by the plugin template. +# Do not edit. import os import re import subprocess import sys import tomllib +import yaml from pathlib import Path from github import Github -with open("pyproject.toml", "rb") as fp: - PYPROJECT_TOML = tomllib.load(fp) -KEYWORDS = ["fixes", "closes"] -BLOCKING_REGEX = [ - r"^DRAFT", - r"^WIP", - r"^NOMERGE", - r"^DO\s*NOT\s*MERGE", - r"^EXPERIMENT", - r"^FIXUP", - r"^fixup!", # This is created by 'git commit --fixup' - r"Apply suggestions from code review", # This usually comes from GitHub -] -try: - CHANGELOG_EXTS = [ - f".{item['directory']}" for item in PYPROJECT_TOML["tool"]["towncrier"]["type"] - ] -except KeyError: - CHANGELOG_EXTS = [".feature", ".bugfix", ".doc", ".removal", ".misc"] -NOISSUE_MARKER = "[noissue]" - -sha = sys.argv[1] -message = subprocess.check_output(["git", "log", "--format=%B", "-n 1", sha]).decode("utf-8") - -if NOISSUE_MARKER in message: - sys.exit(f"Do not add '{NOISSUE_MARKER}' in the commit message.") - -blocking_matches = [m for m in (re.match(pattern, message) for pattern in BLOCKING_REGEX) if m] -if blocking_matches: - print("Found these phrases in the commit message:") - for m in blocking_matches: - print(" - " + m.group(0)) - sys.exit("This PR is not ready for consumption.") -g = Github(os.environ.get("GITHUB_TOKEN")) -repo = g.get_repo("pulp/pulp_python") - - -def check_status(issue): +def check_status(issue, repo, cherry_pick): gi = repo.get_issue(int(issue)) if gi.pull_request: sys.exit(f"Error: issue #{issue} is a pull request.") - if gi.closed_at: + if gi.closed_at and not cherry_pick: + print("Make sure to use 'git cherry-pick -x' when backporting a change.") + print( + "If a backport of a change requires a significant amount of rewriting, " + "consider creating a new issue." + ) sys.exit(f"Error: issue #{issue} is closed.") -def check_changelog(issue): +def check_changelog(issue, CHANGELOG_EXTS): matches = list(Path("CHANGES").rglob(f"{issue}.*")) if len(matches) < 1: @@ -70,18 +35,63 @@ def check_changelog(issue): sys.exit(f"Invalid extension for changelog entry '{match}'.") -print("Checking commit message for {sha}.".format(sha=sha[0:7])) +def main() -> None: + TEMPLATE_CONFIG = yaml.safe_load(Path("template_config.yml").read_text()) + GITHUB_ORG = TEMPLATE_CONFIG["github_org"] + PLUGIN_NAME = TEMPLATE_CONFIG["plugin_name"] + + with Path("pyproject.toml").open("rb") as _fp: + PYPROJECT_TOML = tomllib.load(_fp) + KEYWORDS = ["fixes", "closes"] + BLOCKING_REGEX = [ + r"^DRAFT", + r"^WIP", + r"^NOMERGE", + r"^DO\s*NOT\s*MERGE", + r"^EXPERIMENT", + r"^FIXUP", + r"^fixup!", # This is created by 'git commit --fixup' + r"Apply suggestions from code review", # This usually comes from GitHub + ] + try: + CHANGELOG_EXTS = [ + f".{item['directory']}" for item in PYPROJECT_TOML["tool"]["towncrier"]["type"] + ] + except KeyError: + CHANGELOG_EXTS = [".feature", ".bugfix", ".doc", ".removal", ".misc"] + NOISSUE_MARKER = "[noissue]" + + sha = sys.argv[1] + message = subprocess.check_output(["git", "log", "--format=%B", "-n 1", sha]).decode("utf-8") + + if NOISSUE_MARKER in message: + sys.exit(f"Do not add '{NOISSUE_MARKER}' in the commit message.") + + blocking_matches = [m for m in (re.match(pattern, message) for pattern in BLOCKING_REGEX) if m] + if blocking_matches: + print("Found these phrases in the commit message:") + for m in blocking_matches: + print(" - " + m.group(0)) + sys.exit("This PR is not ready for consumption.") + + g = Github(os.environ.get("GITHUB_TOKEN")) + repo = g.get_repo(f"{GITHUB_ORG}/{PLUGIN_NAME}") + + print("Checking commit message for {sha}.".format(sha=sha[0:7])) + + # validate the issue attached to the commit + issue_regex = r"(?:{keywords})[\s:]+#(\d+)".format(keywords="|".join(KEYWORDS)) + issues = re.findall(issue_regex, message, re.IGNORECASE) + cherry_pick_regex = r"^\s*\(cherry picked from commit [0-9a-f]*\)\s*$" + cherry_pick = re.search(cherry_pick_regex, message, re.MULTILINE) + + if issues: + for issue in issues: + check_status(issue, repo, cherry_pick) + check_changelog(issue, CHANGELOG_EXTS) -# validate the issue attached to the commit -issue_regex = r"(?:{keywords})[\s:]+#(\d+)".format(keywords=("|").join(KEYWORDS)) -issues = re.findall(issue_regex, message, re.IGNORECASE) -cherry_pick_regex = r"^\s*\(cherry picked from commit [0-9a-f]*\)\s*$" -cherry_pick = re.search(cherry_pick_regex, message, re.MULTILINE) + print("Commit message for {sha} passed.".format(sha=sha[0:7])) -if issues: - for issue in issues: - if not cherry_pick: - check_status(issue) - check_changelog(issue) -print("Commit message for {sha} passed.".format(sha=sha[0:7])) +if __name__ == "__main__": + main() diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d82f9fee..0d16d126 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - name: "Install python dependencies" run: | echo ::group::PYDEPS - pip install requests pygithub + pip install requests pygithub pyyaml echo ::endgroup:: - name: "Check commit message" if: github.event_name == 'pull_request' diff --git a/.github/workflows/scripts/script.sh b/.github/workflows/scripts/script.sh index 0faec043..00932968 100755 --- a/.github/workflows/scripts/script.sh +++ b/.github/workflows/scripts/script.sh @@ -119,7 +119,7 @@ echo "Checking for uncommitted migrations..." cmd_user_prefix bash -c "django-admin makemigrations python --check --dry-run" # Run unit tests. -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_python.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 --durations=20 --pyargs pulp_python.tests.unit" # Run functional tests if [[ "$TEST" == "performance" ]]; then if [[ -z ${PERFORMANCE_TEST+x} ]]; then @@ -135,11 +135,11 @@ if [ -f "$FUNC_TEST_SCRIPT" ]; then else if [[ "$GITHUB_WORKFLOW" =~ "Nightly" ]] then - cmd_user_prefix bash -c "pytest -v --timeout=300 -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_python.tests.functional -m parallel -n 8 --nightly" - cmd_user_prefix bash -c "pytest -v --timeout=300 -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_python.tests.functional -m 'not parallel' --nightly" + cmd_user_prefix bash -c "pytest -v --timeout=300 -r sx --color=yes --suppress-no-test-exit-code --durations=20 --pyargs pulp_python.tests.functional -m parallel -n 8 --nightly" + cmd_user_prefix bash -c "pytest -v --timeout=300 -r sx --color=yes --suppress-no-test-exit-code --durations=20 --pyargs pulp_python.tests.functional -m 'not parallel' --nightly" else - cmd_user_prefix bash -c "pytest -v --timeout=300 -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_python.tests.functional -m parallel -n 8" - cmd_user_prefix bash -c "pytest -v --timeout=300 -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_python.tests.functional -m 'not parallel'" + cmd_user_prefix bash -c "pytest -v --timeout=300 -r sx --color=yes --suppress-no-test-exit-code --durations=20 --pyargs pulp_python.tests.functional -m parallel -n 8" + cmd_user_prefix bash -c "pytest -v --timeout=300 -r sx --color=yes --suppress-no-test-exit-code --durations=20 --pyargs pulp_python.tests.functional -m 'not parallel'" fi fi pushd ../pulp-cli diff --git a/.github/workflows/update_ci.yml b/.github/workflows/update_ci.yml index e66e7c2f..63c41b08 100644 --- a/.github/workflows/update_ci.yml +++ b/.github/workflows/update_ci.yml @@ -140,7 +140,7 @@ jobs: with: fetch-depth: 0 path: "pulp_python" - ref: "3.13" + ref: "3.14" - name: "Run update" working-directory: "pulp_python" @@ -149,21 +149,21 @@ jobs: - name: "Create Pull Request for CI files" uses: "peter-evans/create-pull-request@v6" - id: "create_pr_3_13" + id: "create_pr_3_14" with: token: "${{ secrets.RELEASE_TOKEN }}" path: "pulp_python" committer: "pulpbot " author: "pulpbot " - title: "Update CI files for branch 3.13" - branch: "update-ci/3.13" - base: "3.13" + title: "Update CI files for branch 3.14" + branch: "update-ci/3.14" + base: "3.14" delete-branch: true - name: "Mark PR automerge" working-directory: "pulp_python" run: | - gh pr merge --rebase --auto "${{ steps.create_pr_3_13.outputs.pull-request-number }}" - if: "steps.create_pr_3_13.outputs.pull-request-number" + gh pr merge --rebase --auto "${{ steps.create_pr_3_14.outputs.pull-request-number }}" + if: "steps.create_pr_3_14.outputs.pull-request-number" env: GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}" continue-on-error: true diff --git a/CHANGES/+preliminary-md-24-support.misc b/CHANGES/+preliminary-md-24-support.misc deleted file mode 100644 index 7fa38ffc..00000000 --- a/CHANGES/+preliminary-md-24-support.misc +++ /dev/null @@ -1 +0,0 @@ -Ensure uploading packages with metadata spec 2.4 is supported. diff --git a/CHANGES/+proxy-sync-regression-313.bugfix b/CHANGES/+proxy-sync-regression-313.bugfix deleted file mode 100644 index 7ae8a4e8..00000000 --- a/CHANGES/+proxy-sync-regression-313.bugfix +++ /dev/null @@ -1 +0,0 @@ -Fixed a proxy sync regression introduced in 3.13.0. diff --git a/CHANGES/706.feature b/CHANGES/706.feature deleted file mode 100644 index 6c01594c..00000000 --- a/CHANGES/706.feature +++ /dev/null @@ -1 +0,0 @@ -Pull-through caching now respects the include/exclude filters on the upstream remote. diff --git a/CHANGES/809.misc b/CHANGES/809.misc deleted file mode 100644 index 0a925a87..00000000 --- a/CHANGES/809.misc +++ /dev/null @@ -1 +0,0 @@ -Pin bandersnatch due to backwards-incompatible change in 6.6. diff --git a/CHANGES/815.feature b/CHANGES/815.feature deleted file mode 100644 index c5457dd4..00000000 --- a/CHANGES/815.feature +++ /dev/null @@ -1,2 +0,0 @@ -Added support for automatically saving pull-through content to a repository. -Requires pulpcore 3.74 or later. diff --git a/pulp_python/app/__init__.py b/pulp_python/app/__init__.py index 481f5b2e..832f57af 100644 --- a/pulp_python/app/__init__.py +++ b/pulp_python/app/__init__.py @@ -10,7 +10,7 @@ class PulpPythonPluginAppConfig(PulpPluginAppConfig): name = "pulp_python.app" label = "python" - version = "3.14.0.dev" + version = "3.15.0.dev" python_package_name = "pulp-python" domain_compatible = True diff --git a/pyproject.toml b/pyproject.toml index 9b97d09c..519ed7a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ build-backend = 'setuptools.build_meta' [project] name = "pulp-python" -version = "3.14.0.dev" +version = "3.15.0.dev" description = "pulp-python plugin for the Pulp Project" readme = "README.md" authors = [ @@ -77,7 +77,7 @@ ignore = [ [tool.bumpversion] # This section is managed by the plugin template. Do not edit manually. -current_version = "3.14.0.dev" +current_version = "3.15.0.dev" commit = false tag = false parse = "(?P\\d+)\\.(?P\\d+)\\.(?P0a)?(?P\\d+)(\\.(?P[a-z]+))?" diff --git a/template_config.yml b/template_config.yml index da28046b..f4aae5b3 100644 --- a/template_config.yml +++ b/template_config.yml @@ -1,7 +1,7 @@ # 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@unknown +# generated with plugin_template api_root: /pulp/ black: false @@ -23,7 +23,7 @@ docker_fixtures: false flake8: true flake8_ignore: [] github_org: pulp -latest_release_branch: '3.13' +latest_release_branch: '3.14' lint_requirements: true os_required_packages: [] parallel_test_workers: 8 @@ -46,8 +46,8 @@ pulp_settings: orphan_protection_time: 0 pypi_api_hostname: https://pulp:443 pulp_settings_azure: - domain_enabled: true content_origin: null + domain_enabled: true pulp_settings_gcp: null pulp_settings_s3: domain_enabled: true