Skip to content

Commit 1b5a665

Browse files
authored
Handle manual backport PRs (#303)
1 parent e684f36 commit 1b5a665

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

jupyter_releaser/changelog.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ def get_version_entry(
117117
entry = entry.splitlines()[2:]
118118

119119
for (ind, line) in enumerate(entry):
120-
if re.search(r"\[@meeseeksmachine\]", line) is not None:
121-
match = re.search(r"Backport PR #(\d+)", line)
122-
if match:
123-
entry[ind] = format_pr_entry(repo, match.groups()[0])
120+
# Look for a backport, either manual or automatic.
121+
match = re.search(r"Backport PR #(\d+) on branch", line)
122+
if match:
123+
entry[ind] = format_pr_entry(repo, match.groups()[0])
124124

125125
# Remove github actions PRs
126126
gh_actions = "[@github-actions](https://github.com/github-actions)"

jupyter_releaser/tests/test_cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,9 @@ def test_build_changelog_backport(py_package, mocker, runner, open_mock):
248248
runner(["prep-git", "--git-url", py_package])
249249
runner(["bump-version", "--version-spec", VERSION_SPEC])
250250

251-
entry = CHANGELOG_ENTRY.replace("consideRatio", "meeseeksmachine")
252-
entry = entry.replace("Support git references etc.", "Backport PR #50 (original title")
251+
entry = CHANGELOG_ENTRY.replace(
252+
"Support git references etc.", "Backport PR #50 on branch (original title"
253+
)
253254

254255
mocked_gen = mocker.patch("jupyter_releaser.changelog.generate_activity_md")
255256
mocked_gen.return_value = entry

0 commit comments

Comments
 (0)