Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

PR template: ask for the issue link in plain words, so a kept comment can't close an issue (#2217)

Eyal Golan5a81c9a59324
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index dce956052..9acc0b95e 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,6 +1,6 @@
## What this changes
-<!-- One or two sentences. Link the issue: "Fixes #123" only if this PR completes the issue, otherwise "Refs #123". -->
+<!-- One or two sentences. Link the issue: write "Fixes" plus the issue number only if this PR completes it, otherwise "Refs" plus the number. -->
## AI assistance
diff --git a/scripts/oss/tests/test_policies.py b/scripts/oss/tests/test_policies.py
index dd064537d..376b09e27 100644
--- a/scripts/oss/tests/test_policies.py
+++ b/scripts/oss/tests/test_policies.py
@@ -123,6 +123,16 @@ def test_pr_template_has_evidence_and_no_cla_item():
assert "CLA" not in text and "contributors/" not in text
+def test_pr_template_has_no_closing_keyword_with_an_issue_number():
+ """A PR body that keeps the template's comment must not close anything: GitHub reads a closing keyword followed by
+ an issue number even inside an HTML comment. The old example "Fixes #123" closed #123 when #2003 merged (30 Oct 2026),
+ so the template states the rule in plain words with no issue number."""
+ import re
+ text = read(".github/pull_request_template.md")
+ closing = re.compile(r"\b(?:close[sd]?|fix(?:e[sd])?|resolve[sd]?)\b:?\s*(?:[\w.-]+/[\w.-]+)?#\d+", re.IGNORECASE)
+ assert not closing.findall(text), closing.findall(text)
+
+
def test_contribution_terms_match_the_code_licence():
"""Owner, 22 Oct 2026: code comes in under MIT to the maintainer and goes out under PolyForm Noncommercial 1.0.0, so
the licence-line waiver covers docs only. The template line still starts "I contribute" (the merge tooling looks
@@ -140,7 +150,8 @@ def test_pr_template_asks_for_ai_disclosure_issue_link_and_goldens():
# Issue #264: the checklist pointed at a disclosure "above" that nothing asked for.
text = read(".github/pull_request_template.md")
assert "## AI assistance" in text and "disclosed under \"AI assistance\"" in text
- assert "Fixes #" in text and "Refs #" in text and "only if this PR completes the issue" in text
+ # The issue link is asked for in plain words, with no "#<number>" a kept comment could close (see the next test).
+ assert '"Fixes" plus the issue number only if this PR completes it' in text and '"Refs" plus the number' in text
assert "`Hash1950`" in text and "`Hash1952`" in text and "docs/determinism.md" in text
assert "## [Unreleased]" in text