Skip to content

Commit 3fbe0cf

Browse files
authored
Merge pull request #259 from blink1073/set-docs-label
2 parents 7564ec3 + 6d3fba1 commit 3fbe0cf

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

jupyter_releaser/lib.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ def make_changelog_pr(auth, branch, repo, title, commit_message, body, dry_run=F
182182
# title, head, base, body, maintainer_can_modify, draft, issue
183183
pull = gh.pulls.create(title, head, base, body, maintainer_can_modify, False, None)
184184

185+
# Try to add the documentation label to the PR.
186+
number = pull.number
187+
try:
188+
gh.issues.add_labels(number, ["documentation"])
189+
except Exception as e:
190+
print(e)
191+
185192
util.actions_output("pr_url", pull.html_url)
186193

187194

jupyter_releaser/tests/test_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ def test_draft_changelog_full(py_package, mocker, runner, open_mock, git_prep):
311311
assert "before-draft-changelog" in log
312312
assert "after-draft-changelog" in log
313313

314-
open_mock.assert_called_once()
314+
assert len(open_mock.call_args) == 2
315315

316316

317317
def test_draft_changelog_skip_config(py_package, mocker, runner, open_mock, git_prep):
@@ -357,7 +357,7 @@ def test_draft_changelog_dry_run(npm_package, mocker, runner, git_prep):
357357
def test_draft_changelog_lerna(workspace_package, mocker, runner, open_mock, git_prep):
358358
mock_changelog_entry(workspace_package, runner, mocker)
359359
runner(["draft-changelog", "--version-spec", VERSION_SPEC])
360-
open_mock.assert_called_once()
360+
assert len(open_mock.call_args) == 2
361361

362362

363363
def test_check_links(py_package, runner):
@@ -933,7 +933,7 @@ def test_forwardport_changelog_no_new(npm_package, runner, mocker, open_mock, gi
933933
# Run the forwardport workflow against default branch
934934
runner(["forwardport-changelog", HTML_URL])
935935

936-
assert len(open_mock.mock_calls) == 2
936+
assert len(open_mock.mock_calls) == 3
937937

938938
log = get_log()
939939
assert "before-forwardport-changelog" in log

jupyter_releaser/tests/util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ class MockHTTPResponse:
269269
def __init__(self, data=None):
270270
self.url = ""
271271
data = data or {}
272-
defaults = dict(id="foo", html_url=HTML_URL, url=URL, upload_url=URL)
272+
defaults = dict(
273+
id="foo", html_url=HTML_URL, url=URL, upload_url=URL, number=100
274+
)
273275
if isinstance(data, list):
274276
for datum in data:
275277
for key in defaults:

0 commit comments

Comments
 (0)