From c9c3e4a4883f6dcc27f6ea16c582b04d3f0e1ccd Mon Sep 17 00:00:00 2001 From: Menelaos Kotoglou Date: Fri, 29 Dec 2023 21:20:31 +0200 Subject: [PATCH] Accept GitHub issues numbered only 32426 or above (#519) Co-authored-by: Hugo van Kemenade Co-authored-by: Pradyun Gedam --- blurb/blurb.py | 5 +++++ blurb/tests/fail/small-gh-number.rst | 4 ++++ blurb/tests/pass/basic.rst | 2 +- blurb/tests/pass/basic.rst.res | 2 +- blurb/tests/pass/case-insensitive.rst | 2 +- blurb/tests/pass/case-insensitive.rst.res | 2 +- blurb/tests/pass/no-break-long-words.rst | 2 +- blurb/tests/pass/no-break-long-words.rst.res | 2 +- blurb/tests/pass/no-break-on-hyphens.rst | 2 +- blurb/tests/pass/no-break-on-hyphens.rst.res | 2 +- 10 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 blurb/tests/fail/small-gh-number.rst diff --git a/blurb/blurb.py b/blurb/blurb.py index 7557c23..14f2a7f 100755 --- a/blurb/blurb.py +++ b/blurb/blurb.py @@ -473,6 +473,8 @@ def finish_entry(): no_changes = metadata.get('no changes') + lowest_possible_gh_issue_number = 32426 + issue_keys = { 'gh-issue': 'GitHub', 'bpo': 'bpo', @@ -486,6 +488,9 @@ def finish_entry(): # we'll complain about the *first* error # we see in the blurb file, which is a # better user experience. + if key == "gh-issue" and int(value) < lowest_possible_gh_issue_number: + throw(f"The gh-issue number must be {lowest_possible_gh_issue_number} or above, not a PR number.") + if key in issue_keys: try: int(value) diff --git a/blurb/tests/fail/small-gh-number.rst b/blurb/tests/fail/small-gh-number.rst new file mode 100644 index 0000000..9e702fb --- /dev/null +++ b/blurb/tests/fail/small-gh-number.rst @@ -0,0 +1,4 @@ +.. gh-issue: 100 +.. section: Library + +This is an invalid blurb. GitHub issues should be 32426 or above. \ No newline at end of file diff --git a/blurb/tests/pass/basic.rst b/blurb/tests/pass/basic.rst index 9667423..e6b0b75 100644 --- a/blurb/tests/pass/basic.rst +++ b/blurb/tests/pass/basic.rst @@ -1,5 +1,5 @@ .. date: 2017-05-02 -.. gh-issue: 0 +.. gh-issue: 40000 .. nonce: xyz .. section: Library diff --git a/blurb/tests/pass/basic.rst.res b/blurb/tests/pass/basic.rst.res index 9667423..e6b0b75 100644 --- a/blurb/tests/pass/basic.rst.res +++ b/blurb/tests/pass/basic.rst.res @@ -1,5 +1,5 @@ .. date: 2017-05-02 -.. gh-issue: 0 +.. gh-issue: 40000 .. nonce: xyz .. section: Library diff --git a/blurb/tests/pass/case-insensitive.rst b/blurb/tests/pass/case-insensitive.rst index 8148b68..ca1cbd5 100644 --- a/blurb/tests/pass/case-insensitive.rst +++ b/blurb/tests/pass/case-insensitive.rst @@ -1,5 +1,5 @@ .. date: 2017-05-02 -.. GH-Issue: 0 +.. GH-Issue: 35000 .. nonce: xyz .. section: Library diff --git a/blurb/tests/pass/case-insensitive.rst.res b/blurb/tests/pass/case-insensitive.rst.res index 9667423..4f1aad5 100644 --- a/blurb/tests/pass/case-insensitive.rst.res +++ b/blurb/tests/pass/case-insensitive.rst.res @@ -1,5 +1,5 @@ .. date: 2017-05-02 -.. gh-issue: 0 +.. gh-issue: 35000 .. nonce: xyz .. section: Library diff --git a/blurb/tests/pass/no-break-long-words.rst b/blurb/tests/pass/no-break-long-words.rst index 334f913..10f5d9e 100644 --- a/blurb/tests/pass/no-break-long-words.rst +++ b/blurb/tests/pass/no-break-long-words.rst @@ -1,5 +1,5 @@ .. date: 1234 -.. gh-issue: 0 +.. gh-issue: 35000 .. nonce: xyz .. section: Library diff --git a/blurb/tests/pass/no-break-long-words.rst.res b/blurb/tests/pass/no-break-long-words.rst.res index 334f913..10f5d9e 100644 --- a/blurb/tests/pass/no-break-long-words.rst.res +++ b/blurb/tests/pass/no-break-long-words.rst.res @@ -1,5 +1,5 @@ .. date: 1234 -.. gh-issue: 0 +.. gh-issue: 35000 .. nonce: xyz .. section: Library diff --git a/blurb/tests/pass/no-break-on-hyphens.rst b/blurb/tests/pass/no-break-on-hyphens.rst index 4b46c52..48bd427 100644 --- a/blurb/tests/pass/no-break-on-hyphens.rst +++ b/blurb/tests/pass/no-break-on-hyphens.rst @@ -1,5 +1,5 @@ .. date: 7333 -.. gh-issue: 21121 +.. gh-issue: 41121 .. nonce: ZLsRil .. section: Library diff --git a/blurb/tests/pass/no-break-on-hyphens.rst.res b/blurb/tests/pass/no-break-on-hyphens.rst.res index 0b6e892..cb76b62 100644 --- a/blurb/tests/pass/no-break-on-hyphens.rst.res +++ b/blurb/tests/pass/no-break-on-hyphens.rst.res @@ -1,5 +1,5 @@ .. date: 7333 -.. gh-issue: 21121 +.. gh-issue: 41121 .. nonce: ZLsRil .. section: Library