-
-
Notifications
You must be signed in to change notification settings - Fork 113
Accept resolve and reference verbs in bounty checks #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,10 @@ | |
| from urllib.error import HTTPError, URLError | ||
| from urllib.request import urlopen | ||
|
|
||
| BOUNTY_REF_RE = re.compile(r"\b(?:bounty|refs?|fixes|closes|claims?)\s+#(\d+)", re.IGNORECASE) | ||
| BOUNTY_REF_RE = re.compile( | ||
| r"\b(?:bounty|refs?|references?|fixes|closes|claims?|resolves?)\s+#(\d+)", | ||
| re.IGNORECASE, | ||
| ) | ||
|
Comment on lines
+14
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep submission error text consistent with expanded regex.
|
||
| EVIDENCE_RE = re.compile( | ||
| r"\b(pytest|ruff|mypy|validation|verified|test evidence|checks? passed)\b", | ||
| re.IGNORECASE, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,6 +127,33 @@ def test_pr_queue_health_accepts_claim_command_reference() -> None: | |
| assert report["missing_bounty_references"] == [] | ||
|
|
||
|
|
||
| def test_pr_queue_health_accepts_resolve_and_reference_words() -> None: | ||
| report = analyze_queue( | ||
| { | ||
| "bounties": [{"number": 310, "state": "OPEN", "awards_remaining": 1}], | ||
| "pull_requests": [ | ||
| { | ||
| "number": 8, | ||
| "title": "Harden bounty submission checks", | ||
| "body": "Resolves #310", | ||
| "merge_state": "clean", | ||
| "labels": [], | ||
| }, | ||
| { | ||
| "number": 9, | ||
| "title": "Harden bounty queue checks", | ||
| "body": "References #310", | ||
| "merge_state": "clean", | ||
| "labels": [], | ||
| }, | ||
| ], | ||
| } | ||
| ) | ||
|
|
||
| assert report["summary"]["missing_bounty_references"] == 0 | ||
| assert report["missing_bounty_references"] == [] | ||
|
|
||
|
Comment on lines
+130
to
+155
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win Add singular verb coverage for this regression test. This test validates plural forms, but not singular As per coding guidelines, “ |
||
|
|
||
| def test_pr_queue_health_markdown_report_includes_required_sections() -> None: | ||
| report = analyze_queue( | ||
| { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,6 +66,28 @@ def test_submission_quality_gate_accepts_claim_command_reference() -> None: | |
| } in result["checks"] | ||
|
|
||
|
|
||
| def test_submission_quality_gate_accepts_resolve_and_reference_words() -> None: | ||
| for text in ("Resolves #319", "Reference #319", "References #319"): | ||
| result = evaluate_submission( | ||
| { | ||
| "submission_text": f""" | ||
| Summary: | ||
| Harden the bounty reference parser. | ||
|
|
||
| {text} | ||
|
|
||
| Validation: | ||
| - pytest passed. | ||
| """, | ||
| "bounties": [{"number": 319, "state": "OPEN", "awards_remaining": 1}], | ||
| "pull_requests": [], | ||
| } | ||
| ) | ||
|
|
||
| assert result["status"] == "pass" | ||
| assert result["bounty_reference"] == 319 | ||
|
|
||
|
Comment on lines
+69
to
+89
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial | ⚡ Quick win Include You already cover As per coding guidelines, “ |
||
|
|
||
| def test_submission_quality_gate_fails_missing_reference() -> None: | ||
| result = evaluate_submission( | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update missing-reference guidance to match accepted verbs.
The parser now accepts
reference(s)andresolve(s), but the missing-reference message still only advertisesBounty,Refs, and/claim. Please align the guidance string so users see the full valid set.