Skip to content

Commit 73de40c

Browse files
committed
Bump minor version
1 parent 025b576 commit 73de40c

File tree

11 files changed

+86
-82
lines changed

11 files changed

+86
-82
lines changed

.ci/scripts/validate_commit_message.py

100755100644
Lines changed: 68 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,31 @@
1-
# WARNING: DO NOT EDIT!
2-
#
3-
# This file was generated by plugin_template, and is managed by it. Please use
4-
# './plugin-template --github pulp_python' to update this file.
5-
#
6-
# For more info visit https://github.com/pulp/plugin_template
1+
# This file is managed by the plugin template.
2+
# Do not edit.
73

84
import os
95
import re
106
import subprocess
117
import sys
128
import tomllib
9+
import yaml
1310
from pathlib import Path
1411

1512
from github import Github
1613

17-
with open("pyproject.toml", "rb") as fp:
18-
PYPROJECT_TOML = tomllib.load(fp)
19-
KEYWORDS = ["fixes", "closes"]
20-
BLOCKING_REGEX = [
21-
r"^DRAFT",
22-
r"^WIP",
23-
r"^NOMERGE",
24-
r"^DO\s*NOT\s*MERGE",
25-
r"^EXPERIMENT",
26-
r"^FIXUP",
27-
r"^fixup!", # This is created by 'git commit --fixup'
28-
r"Apply suggestions from code review", # This usually comes from GitHub
29-
]
30-
try:
31-
CHANGELOG_EXTS = [
32-
f".{item['directory']}" for item in PYPROJECT_TOML["tool"]["towncrier"]["type"]
33-
]
34-
except KeyError:
35-
CHANGELOG_EXTS = [".feature", ".bugfix", ".doc", ".removal", ".misc"]
36-
NOISSUE_MARKER = "[noissue]"
37-
38-
sha = sys.argv[1]
39-
message = subprocess.check_output(["git", "log", "--format=%B", "-n 1", sha]).decode("utf-8")
40-
41-
if NOISSUE_MARKER in message:
42-
sys.exit(f"Do not add '{NOISSUE_MARKER}' in the commit message.")
43-
44-
blocking_matches = [m for m in (re.match(pattern, message) for pattern in BLOCKING_REGEX) if m]
45-
if blocking_matches:
46-
print("Found these phrases in the commit message:")
47-
for m in blocking_matches:
48-
print(" - " + m.group(0))
49-
sys.exit("This PR is not ready for consumption.")
5014

51-
g = Github(os.environ.get("GITHUB_TOKEN"))
52-
repo = g.get_repo("pulp/pulp_python")
53-
54-
55-
def check_status(issue):
15+
def check_status(issue, repo, cherry_pick):
5616
gi = repo.get_issue(int(issue))
5717
if gi.pull_request:
5818
sys.exit(f"Error: issue #{issue} is a pull request.")
59-
if gi.closed_at:
19+
if gi.closed_at and not cherry_pick:
20+
print("Make sure to use 'git cherry-pick -x' when backporting a change.")
21+
print(
22+
"If a backport of a change requires a significant amount of rewriting, "
23+
"consider creating a new issue."
24+
)
6025
sys.exit(f"Error: issue #{issue} is closed.")
6126

6227

63-
def check_changelog(issue):
28+
def check_changelog(issue, CHANGELOG_EXTS):
6429
matches = list(Path("CHANGES").rglob(f"{issue}.*"))
6530

6631
if len(matches) < 1:
@@ -70,18 +35,63 @@ def check_changelog(issue):
7035
sys.exit(f"Invalid extension for changelog entry '{match}'.")
7136

7237

73-
print("Checking commit message for {sha}.".format(sha=sha[0:7]))
38+
def main() -> None:
39+
TEMPLATE_CONFIG = yaml.safe_load(Path("template_config.yml").read_text())
40+
GITHUB_ORG = TEMPLATE_CONFIG["github_org"]
41+
PLUGIN_NAME = TEMPLATE_CONFIG["plugin_name"]
42+
43+
with Path("pyproject.toml").open("rb") as _fp:
44+
PYPROJECT_TOML = tomllib.load(_fp)
45+
KEYWORDS = ["fixes", "closes"]
46+
BLOCKING_REGEX = [
47+
r"^DRAFT",
48+
r"^WIP",
49+
r"^NOMERGE",
50+
r"^DO\s*NOT\s*MERGE",
51+
r"^EXPERIMENT",
52+
r"^FIXUP",
53+
r"^fixup!", # This is created by 'git commit --fixup'
54+
r"Apply suggestions from code review", # This usually comes from GitHub
55+
]
56+
try:
57+
CHANGELOG_EXTS = [
58+
f".{item['directory']}" for item in PYPROJECT_TOML["tool"]["towncrier"]["type"]
59+
]
60+
except KeyError:
61+
CHANGELOG_EXTS = [".feature", ".bugfix", ".doc", ".removal", ".misc"]
62+
NOISSUE_MARKER = "[noissue]"
63+
64+
sha = sys.argv[1]
65+
message = subprocess.check_output(["git", "log", "--format=%B", "-n 1", sha]).decode("utf-8")
66+
67+
if NOISSUE_MARKER in message:
68+
sys.exit(f"Do not add '{NOISSUE_MARKER}' in the commit message.")
69+
70+
blocking_matches = [m for m in (re.match(pattern, message) for pattern in BLOCKING_REGEX) if m]
71+
if blocking_matches:
72+
print("Found these phrases in the commit message:")
73+
for m in blocking_matches:
74+
print(" - " + m.group(0))
75+
sys.exit("This PR is not ready for consumption.")
76+
77+
g = Github(os.environ.get("GITHUB_TOKEN"))
78+
repo = g.get_repo(f"{GITHUB_ORG}/{PLUGIN_NAME}")
79+
80+
print("Checking commit message for {sha}.".format(sha=sha[0:7]))
81+
82+
# validate the issue attached to the commit
83+
issue_regex = r"(?:{keywords})[\s:]+#(\d+)".format(keywords="|".join(KEYWORDS))
84+
issues = re.findall(issue_regex, message, re.IGNORECASE)
85+
cherry_pick_regex = r"^\s*\(cherry picked from commit [0-9a-f]*\)\s*$"
86+
cherry_pick = re.search(cherry_pick_regex, message, re.MULTILINE)
87+
88+
if issues:
89+
for issue in issues:
90+
check_status(issue, repo, cherry_pick)
91+
check_changelog(issue, CHANGELOG_EXTS)
7492

75-
# validate the issue attached to the commit
76-
issue_regex = r"(?:{keywords})[\s:]+#(\d+)".format(keywords=("|").join(KEYWORDS))
77-
issues = re.findall(issue_regex, message, re.IGNORECASE)
78-
cherry_pick_regex = r"^\s*\(cherry picked from commit [0-9a-f]*\)\s*$"
79-
cherry_pick = re.search(cherry_pick_regex, message, re.MULTILINE)
93+
print("Commit message for {sha} passed.".format(sha=sha[0:7]))
8094

81-
if issues:
82-
for issue in issues:
83-
if not cherry_pick:
84-
check_status(issue)
85-
check_changelog(issue)
8695

87-
print("Commit message for {sha} passed.".format(sha=sha[0:7]))
96+
if __name__ == "__main__":
97+
main()

.github/workflows/scripts/script.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ echo "Checking for uncommitted migrations..."
119119
cmd_user_prefix bash -c "django-admin makemigrations python --check --dry-run"
120120

121121
# Run unit tests.
122-
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"
122+
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"
123123
# Run functional tests
124124
if [[ "$TEST" == "performance" ]]; then
125125
if [[ -z ${PERFORMANCE_TEST+x} ]]; then
@@ -135,11 +135,11 @@ if [ -f "$FUNC_TEST_SCRIPT" ]; then
135135
else
136136
if [[ "$GITHUB_WORKFLOW" =~ "Nightly" ]]
137137
then
138-
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"
139-
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"
138+
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"
139+
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"
140140
else
141-
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"
142-
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'"
141+
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"
142+
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'"
143143
fi
144144
fi
145145
pushd ../pulp-cli

.github/workflows/update_ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
with:
141141
fetch-depth: 0
142142
path: "pulp_python"
143-
ref: "3.13"
143+
ref: "3.14"
144144

145145
- name: "Run update"
146146
working-directory: "pulp_python"
@@ -149,21 +149,21 @@ jobs:
149149
150150
- name: "Create Pull Request for CI files"
151151
uses: "peter-evans/create-pull-request@v6"
152-
id: "create_pr_3_13"
152+
id: "create_pr_3_14"
153153
with:
154154
token: "${{ secrets.RELEASE_TOKEN }}"
155155
path: "pulp_python"
156156
committer: "pulpbot <pulp-infra@redhat.com>"
157157
author: "pulpbot <pulp-infra@redhat.com>"
158-
title: "Update CI files for branch 3.13"
159-
branch: "update-ci/3.13"
160-
base: "3.13"
158+
title: "Update CI files for branch 3.14"
159+
branch: "update-ci/3.14"
160+
base: "3.14"
161161
delete-branch: true
162162
- name: "Mark PR automerge"
163163
working-directory: "pulp_python"
164164
run: |
165-
gh pr merge --rebase --auto "${{ steps.create_pr_3_13.outputs.pull-request-number }}"
166-
if: "steps.create_pr_3_13.outputs.pull-request-number"
165+
gh pr merge --rebase --auto "${{ steps.create_pr_3_14.outputs.pull-request-number }}"
166+
if: "steps.create_pr_3_14.outputs.pull-request-number"
167167
env:
168168
GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}"
169169
continue-on-error: true

CHANGES/+preliminary-md-24-support.misc

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGES/+proxy-sync-regression-313.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGES/706.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGES/809.misc

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGES/815.feature

Lines changed: 0 additions & 2 deletions
This file was deleted.

pulp_python/app/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class PulpPythonPluginAppConfig(PulpPluginAppConfig):
1010

1111
name = "pulp_python.app"
1212
label = "python"
13-
version = "3.14.0.dev"
13+
version = "3.15.0.dev"
1414
python_package_name = "pulp-python"
1515
domain_compatible = True
1616

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = 'setuptools.build_meta'
77

88
[project]
99
name = "pulp-python"
10-
version = "3.14.0.dev"
10+
version = "3.15.0.dev"
1111
description = "pulp-python plugin for the Pulp Project"
1212
readme = "README.md"
1313
authors = [
@@ -77,7 +77,7 @@ ignore = [
7777
[tool.bumpversion]
7878
# This section is managed by the plugin template. Do not edit manually.
7979

80-
current_version = "3.14.0.dev"
80+
current_version = "3.15.0.dev"
8181
commit = false
8282
tag = false
8383
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<alpha>0a)?(?P<patch>\\d+)(\\.(?P<release>[a-z]+))?"

0 commit comments

Comments
 (0)