From bd11ac5ccff0f6e192baf0258fb1ea6a26edb2f7 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sun, 10 Apr 2022 14:21:43 -0700 Subject: [PATCH 1/2] Fix gh-issue- prefix Blurb generates gh-issue- but Bedevere only accepted gh-. This was discussed here: https://github.com/python/core-workflow/pull/431#discussion_r827293459 --- bedevere/news.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bedevere/news.py b/bedevere/news.py index 06aa045f..a554a10a 100644 --- a/bedevere/news.py +++ b/bedevere/news.py @@ -17,7 +17,7 @@ FILENAME_RE = re.compile(r"""# YYYY-mm-dd or YYYY-mm-dd-HH-MM-SS \d{4}-\d{2}-\d{2}(?:-\d{2}-\d{2}-\d{2})?\. - (?:bpo|gh)-\d+(?:,\d+)*\. # Issue number(s) + (?:bpo|gh-issue)-\d+(?:,\d+)*\. # Issue number(s) [A-Za-z0-9_=-]+\. # Nonce (URL-safe base64) rst # File extension""", re.VERBOSE) From f0c65577bb81e508a7008f6428cb8d602bc1de99 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sun, 10 Apr 2022 14:23:06 -0700 Subject: [PATCH 2/2] update tests --- tests/test_news.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_news.py b/tests/test_news.py index 0c0b6ab6..07770ba1 100644 --- a/tests/test_news.py +++ b/tests/test_news.py @@ -30,26 +30,27 @@ async def post(self, url, *, data): return self._post_return -GOOD_BASENAME = '2017-06-16-20-32-50.gh-1234.nonce.rst' +GOOD_BASENAME = '2017-06-16-20-32-50.gh-issue-1234.nonce.rst' BPO_BASENAME = '2017-06-16-20-32-50.bpo-1234.nonce.rst' class TestFilenameRE: def test_malformed_basename(self): + assert news.FILENAME_RE.match('2017-06-16.gh-issue-1234.rst') is None assert news.FILENAME_RE.match('2017-06-16.gh-1234.rst') is None def test_success(self): assert news.FILENAME_RE.match(GOOD_BASENAME) - live_result = '2017-08-14-15-13-50.gh-1612262.-x_Oyq.rst' + live_result = '2017-08-14-15-13-50.gh-issue-1612262.-x_Oyq.rst' assert news.FILENAME_RE.match(live_result) def test_multiple_issue_numbers(self): - basename = '2018-01-01.gh-1234,5678,9012.nonce.rst' + basename = '2018-01-01.gh-issue-1234,5678,9012.nonce.rst' assert news.FILENAME_RE.match(basename) def test_date_only(self): - basename = '2017-08-14.gh-1234.nonce.rst' + basename = '2017-08-14.gh-issue-1234.nonce.rst' assert news.FILENAME_RE.match(basename) def test_malformed_basename_bpo(self):