Skip to content

Commit

Permalink
Accept GitHub issues numbered only 32426 or above (#519)
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
  • Loading branch information
3 people committed Dec 29, 2023
1 parent d752290 commit c9c3e4a
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 8 deletions.
5 changes: 5 additions & 0 deletions blurb/blurb.py
Expand Up @@ -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',
Expand All @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions 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.
2 changes: 1 addition & 1 deletion blurb/tests/pass/basic.rst
@@ -1,5 +1,5 @@
.. date: 2017-05-02
.. gh-issue: 0
.. gh-issue: 40000
.. nonce: xyz
.. section: Library
Expand Down
2 changes: 1 addition & 1 deletion blurb/tests/pass/basic.rst.res
@@ -1,5 +1,5 @@
.. date: 2017-05-02
.. gh-issue: 0
.. gh-issue: 40000
.. nonce: xyz
.. section: Library

Expand Down
2 changes: 1 addition & 1 deletion blurb/tests/pass/case-insensitive.rst
@@ -1,5 +1,5 @@
.. date: 2017-05-02
.. GH-Issue: 0
.. GH-Issue: 35000
.. nonce: xyz
.. section: Library
Expand Down
2 changes: 1 addition & 1 deletion 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

Expand Down
2 changes: 1 addition & 1 deletion blurb/tests/pass/no-break-long-words.rst
@@ -1,5 +1,5 @@
.. date: 1234
.. gh-issue: 0
.. gh-issue: 35000
.. nonce: xyz
.. section: Library
Expand Down
2 changes: 1 addition & 1 deletion 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

Expand Down
2 changes: 1 addition & 1 deletion blurb/tests/pass/no-break-on-hyphens.rst
@@ -1,5 +1,5 @@
.. date: 7333
.. gh-issue: 21121
.. gh-issue: 41121
.. nonce: ZLsRil
.. section: Library
Expand Down
2 changes: 1 addition & 1 deletion 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

Expand Down

0 comments on commit c9c3e4a

Please sign in to comment.