-
Notifications
You must be signed in to change notification settings - Fork 0
docs(git-and-github): PR bodies lead with "Why this PR exists" (4.4.0) #43
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
de76536
chore(reviewer-rigor): BP audit + release SKILL YAML fix + version 4.2.0
claude ae2bdda
feat(schema): add call_tree category + CALL- id prefix for reviewer c…
claude 22bdcae
Merge branch 'feat/reviewer-rigor-housekeeping' into feat/reviewer-rigor
claude e6975ee
feat(reviewer-rigor): call-tree inspection methodology + ephemeral-ID…
claude b76bf72
fix(reviewer-rigor): address Copilot review on PR #41
claude f10308d
feat(git-and-github): PR bodies lead with "Why this PR exists" rationale
claude ead92c6
fix(report-pipeline): derive severity on-the-fly + schema 3.1.0 addit…
claude a631c98
fix(report-pipeline): renderer on-the-fly severity + permalink @{u} +…
claude aa89655
style(consolidate): drop unused build_severity_stats import (ruff F401)
claude d7c93c8
Merge branch 'main' into feat/report-pipeline-severity
claude c107c11
fix(report-pipeline): address Copilot review on PR #42
claude ec9ad84
fix(report-pipeline): address second Copilot pass on PR #42
claude e33231d
Merge branch 'feat/report-pipeline-severity' into feat/pr-why-template
claude 67c1ce7
Merge remote-tracking branch 'origin/main' into feat/pr-why-template
claude e24a823
style(test): black-format test_pr_body_template.py
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| """Regression guard: the canonical PR-body template must lead with "Why this PR exists". | ||
|
|
||
| PR descriptions are owned by ONE skill (`git-and-github`); `push` delegates to it. | ||
| This test pins the contract so a refactor can't silently demote the rationale section | ||
| below the mechanics: `git-and-github/SKILL.md` must define a "Why this PR exists" | ||
| heading positioned AHEAD of the "What was done"/"Testing" sections, and `push/SKILL.md` | ||
| must reference it rather than inlining a duplicate template. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| REPO_ROOT = Path(__file__).resolve().parent.parent | ||
| GIT_GITHUB = REPO_ROOT / "skills" / "git-and-github" / "SKILL.md" | ||
| PUSH = REPO_ROOT / "skills" / "push" / "SKILL.md" | ||
|
|
||
| WHY = "Why this PR exists" | ||
|
|
||
|
|
||
| def test_git_github_has_why_section() -> None: | ||
| text = GIT_GITHUB.read_text(encoding="utf-8") | ||
| assert ( | ||
| f"## {WHY}" in text | ||
| ), f"{GIT_GITHUB}: missing '## {WHY}' heading in PR-body template" | ||
|
|
||
|
|
||
| def test_why_section_leads_what_and_testing() -> None: | ||
| text = GIT_GITHUB.read_text(encoding="utf-8") | ||
| why = text.index(f"## {WHY}") | ||
| what = text.index("## What was done") | ||
| testing = text.index("## Testing") | ||
| assert why < what, f"{GIT_GITHUB}: '{WHY}' must precede 'What was done'" | ||
| assert why < testing, f"{GIT_GITHUB}: '{WHY}' must precede 'Testing'" | ||
|
|
||
|
|
||
| def test_why_section_demands_reproduction_and_blocking() -> None: | ||
| """The skeleton must prompt for a concrete repro/threat scenario and blocking relationship.""" | ||
| text = GIT_GITHUB.read_text(encoding="utf-8") | ||
| lowered = text.lower() | ||
| assert ( | ||
| "reproduction" in lowered or "threat scenario" in lowered | ||
| ), f"{GIT_GITHUB}: '{WHY}' skeleton must ask for a reproduction or threat scenario" | ||
| assert ( | ||
| "blocking" in lowered | ||
| ), f"{GIT_GITHUB}: '{WHY}' skeleton must ask for the blocking relationship" | ||
|
lklimek marked this conversation as resolved.
|
||
|
|
||
|
|
||
| def test_push_references_why_without_inlining_template() -> None: | ||
| text = PUSH.read_text(encoding="utf-8") | ||
| assert WHY in text, f"{PUSH}: must reference the '{WHY}' section" | ||
| assert ( | ||
| "git-and-github" in text | ||
| ), f"{PUSH}: must delegate to git-and-github for the template" | ||
| # No duplicated skeleton: push references the section, it doesn't redefine the heading. | ||
| assert ( | ||
| f"## {WHY}" not in text | ||
| ), f"{PUSH}: must not inline a duplicate '## {WHY}' template — delegate to git-and-github" | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.