Skip to content

Commit 97a5b47

Browse files
committed
2 parents 8028f96 + afcce36 commit 97a5b47

File tree

16 files changed

+178
-210
lines changed

16 files changed

+178
-210
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.0.3.dev
2+
current_version = 0.0.5.dev
33
commit = False
44
tag = False
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+))?

.ci/scripts/validate_commit_message.py

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,44 @@
1+
import os
12
import re
23
import subprocess
34
import sys
45
from pathlib import Path
56

7+
import toml
68
from github import Github
79

810
KEYWORDS = ["fixes", "closes"]
11+
BLOCKING_REGEX = [
12+
"DRAFT",
13+
"WIP",
14+
"NOMERGE",
15+
r"DO\s*NOT\s*MERGE",
16+
"EXPERIMENT",
17+
]
918
NO_ISSUE = "[noissue]"
10-
CHANGELOG_EXTS = [".feature", ".bugfix", ".doc", ".removal", ".misc", ".deprecation"]
19+
CHANGELOG_EXTS = [
20+
f".{item['directory']}" for item in toml.load("pyproject.toml")["tool"]["towncrier"]["type"]
21+
]
1122

1223
sha = sys.argv[1]
13-
project = "pulp-cli-deb"
1424
message = subprocess.check_output(["git", "log", "--format=%B", "-n 1", sha]).decode("utf-8")
1525

16-
g = Github()
26+
if any((re.match(pattern, message) for pattern in BLOCKING_REGEX)):
27+
sys.exit("This PR is not ready for consumption.")
28+
29+
g = Github(os.environ.get("GITHUB_TOKEN"))
1730
repo = g.get_repo("pulp/pulp-cli-deb")
1831

1932

20-
def __check_status(issue):
33+
def check_status(issue):
2134
gi = repo.get_issue(int(issue))
2235
if gi.pull_request:
2336
sys.exit(f"Error: issue #{issue} is a pull request.")
2437
if gi.closed_at:
2538
sys.exit(f"Error: issue #{issue} is closed.")
2639

2740

28-
def __check_changelog(issue):
41+
def check_changelog(issue):
2942
matches = list(Path("CHANGES").rglob(f"{issue}.*"))
3043

3144
if len(matches) < 1:
@@ -38,15 +51,16 @@ def __check_changelog(issue):
3851
print("Checking commit message for {sha}.".format(sha=sha[0:7]))
3952

4053
# validate the issue attached to the commit
41-
regex = r"(?:{keywords})[\s:]+#(\d+)".format(keywords=("|").join(KEYWORDS))
42-
pattern = re.compile(regex, re.IGNORECASE)
43-
44-
issues = pattern.findall(message)
54+
issue_regex = r"(?:{keywords})[\s:]+#(\d+)".format(keywords=("|").join(KEYWORDS))
55+
issues = re.findall(issue_regex, message, re.IGNORECASE)
56+
cherry_pick_regex = r"^\s*\(cherry picked from commit [0-9a-f]*\)\s*$"
57+
cherry_pick = re.search(cherry_pick_regex, message, re.MULTILINE)
4558

4659
if issues:
47-
for issue in pattern.findall(message):
48-
__check_status(issue)
49-
__check_changelog(issue)
60+
for issue in issues:
61+
if not cherry_pick:
62+
check_status(issue)
63+
check_changelog(issue)
5064
else:
5165
if NO_ISSUE in message:
5266
print("Commit {sha} has no issues but is tagged {tag}.".format(sha=sha[0:7], tag=NO_ISSUE))

.github/workflows/kanban.yml

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

.github/workflows/main.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,16 @@ jobs:
5353
- python: "3.6"
5454
image_tag: "3.21"
5555
- python: "3.7"
56+
pulp_cli: "0.17.0"
5657
image_tag: "3.20"
5758
- python: "3.8"
59+
pulp_cli: "0.16.0"
5860
image_tag: "3.19"
5961
- python: "3.9"
6062
image_tag: "3.18"
6163
- python: "3.10"
6264
pulp_cli: "0.15.0"
63-
image_tag: "3.17"
65+
image_tag: "3.22"
6466
steps:
6567
- uses: actions/checkout@v2
6668
- name: Set up Python
@@ -70,7 +72,9 @@ jobs:
7072
- name: Install Test Dependencies
7173
run: pip install -r test_requirements.txt
7274
- name: Install pulp-cli from source
73-
run: pip install git+https://github.com/pulp/pulp-cli@main
75+
run: |
76+
pip install "git+https://github.com/pulp/pulp-cli@main#egg=pulp-glue&subdirectory=pulp-glue"
77+
pip install "git+https://github.com/pulp/pulp-cli@main#egg=pulp-cli"
7478
if: ${{ ! matrix.pulp_cli }}
7579
- name: Install specific pulp-cli version
7680
run: pip install pulp_cli==${{ matrix.pulp_cli }}

.github/workflows/nightly.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,16 @@ jobs:
2525
- python: "3.6"
2626
image_tag: "3.21"
2727
- python: "3.7"
28+
pulp_cli: "0.17.0"
2829
image_tag: "3.20"
2930
- python: "3.8"
31+
pulp_cli: "0.16.0"
3032
image_tag: "3.19"
3133
- python: "3.9"
3234
image_tag: "3.18"
3335
- python: "3.10"
3436
pulp_cli: "0.15.0"
35-
image_tag: "3.17"
37+
image_tag: "3.22"
3638
steps:
3739
- uses: actions/checkout@v2
3840
- name: Set up Python
@@ -42,7 +44,9 @@ jobs:
4244
- name: Install Test Dependencies
4345
run: pip install -r test_requirements.txt
4446
- name: Install pulp-cli from source
45-
run: pip install git+https://github.com/pulp/pulp-cli@main
47+
run: |
48+
pip install "git+https://github.com/pulp/pulp-cli@main#egg=pulp-glue&subdirectory=pulp-glue"
49+
pip install "git+https://github.com/pulp/pulp-cli@main#egg=pulp-cli"
4650
if: ${{ ! matrix.pulp_cli }}
4751
- name: Install specific pulp-cli version
4852
run: pip install pulp_cli==${{ matrix.pulp_cli }}

CHANGES.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,58 @@
1010

1111
[//]: # (towncrier release notes start)
1212

13+
## 0.0.4 (2023-03-09)
14+
=====================
15+
16+
17+
### Misc
18+
19+
- Adopted PREFIX_ID pattern introduced in pulp-cli 0.14.
20+
[#27](https://github.com/pulp/pulp-cli-deb/issues/27)
21+
22+
23+
---
24+
25+
26+
## 0.0.3 (2023-01-03)
27+
=====================
28+
29+
30+
### Features
31+
32+
- Added support for the new --optimize/--no-optimize sync option.
33+
[#31](https://github.com/pulp/pulp-cli-deb/issues/31)
34+
- Use flags for ``--simple`` and ``--structured`` on publication create instead of having users
35+
specify a value of ``True``.
36+
[#36](https://github.com/pulp/pulp-cli-deb/issues/36)
37+
38+
39+
### Improved Documentation
40+
41+
- Added a help text for the --mirror/--no-mirror sync option.
42+
[#30](https://github.com/pulp/pulp-cli-deb/issues/30)
43+
44+
45+
### Deprecations and Removals
46+
47+
- Bumped pulp-cli dependency to >=0.13.0.
48+
[#10](https://github.com/pulp/pulp-cli-deb/issues/10)
49+
50+
51+
### Translations
52+
53+
- Added rudimentary German translations files.
54+
[#10](https://github.com/pulp/pulp-cli-deb/issues/10)
55+
56+
57+
### Misc
58+
59+
- [#10](https://github.com/pulp/pulp-cli-deb/issues/10)
60+
61+
62+
---
63+
64+
1365
## 0.0.2 (2022-01-03)
1466

1567
### Features

CHANGES/10.misc

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

CHANGES/10.removal

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

CHANGES/10.translation

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

CHANGES/30.doc

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

0 commit comments

Comments
 (0)