Skip to content

build(ci): Enforce PR-issue linking requirement and update templates - #2550

Merged
ashleyshaw merged 2 commits into
developfrom
build/enforce-pr-issue-linking
Aug 30, 2026
Merged

build(ci): Enforce PR-issue linking requirement and update templates#2550
ashleyshaw merged 2 commits into
developfrom
build/enforce-pr-issue-linking

Conversation

@ashleyshaw

Copy link
Copy Markdown
Member

Summary

Implements PR-issue linking enforcement (Phase 3 Week 2-3 issues #2542-#2543) to ensure all PRs are linked to their corresponding issues for better tracking and automation.

Goal: All PRs automatically linked to issues via GitHub's auto-closing mechanism.

Changes

Issue #2542: Create PR-Issue Linking Enforcement Workflow

File: .github/workflows/enforce-pr-issue-linking.yml

  • Triggers on PR opened/synchronize/reopened events
  • Detects if PR body contains linking keywords: Closes, Fixes, Resolves, Relates to, Part of
  • Falls back to basic #123 pattern detection
  • If no linked issue found: posts helpful comment on PR
  • Comment includes:
    • Explanation of why linking matters
    • Examples of correct linking keywords
    • Link to documentation
    • Auto-closing behavior explanation
  • Idempotent: won't post duplicate comments

Design decisions:

  • Non-blocking: comments only, doesn't enforce at merge time (yet)
  • Informative: helps developers understand why linking matters
  • Graceful: handles already-linked PRs silently

Issue #2543: Update PR Templates with Linking Requirements

Files: All 9 PR templates in .github/PULL_REQUEST_TEMPLATE/

  • Enhanced "Linked issues" section in each template
  • Added clear examples of linking keywords:
    • Closes #123 — resolves an issue (auto-closes on merge)
    • Fixes #123 — alternative to Closes
    • Resolves #123 — alternative to Closes
    • Relates to #123 — related but not directly resolved
    • Part of #456 — part of larger initiative
  • Template-specific variants for special cases (hotfix, release)
  • Emphasized auto-closing behavior
  • Consistent guidance across all 9 templates

Linked issues

Closes #2542
Closes #2543

Relates to #2544
Relates to #2545
Relates to #2546

Changelog

Added

  • GitHub Action enforce-pr-issue-linking.yml for detecting PR-issue linking
  • Enhanced linking guidance in all 9 PR templates with keyword examples and auto-closing explanation
  • Workflow comment on PRs without linked issues (informational, non-blocking)

Changed

  • PR templates now include comprehensive linking keyword reference
  • Improved developer guidance on proper PR-issue linking

Fixed

  • N/A

Risk Assessment

Risk Level: Low

Potential Impact:

  • Workflow is informational only (comments, doesn't block merges)
  • Template changes are documentation only
  • No code changes or automation triggers
  • Non-invasive to existing PR workflows

Mitigation Steps:

  • Workflow tested with edge cases (empty body, no issues, multiple references)
  • Comments idempotent (won't duplicate)
  • Templates validated by linting before merge
  • No breaking changes to existing automation

How to Test

Prerequisites

  • GitHub repository access
  • Ability to create draft PRs

Test Steps

  1. Test linking detection:

    • Create PR with body: Closes #123
    • Verify workflow runs without comment (issue linked)
    • Create another PR with no linking keywords
    • Verify workflow posts helpful comment
    • Create PR from this branch to test
  2. Test template changes:

    • Create new PR from any feature branch
    • Verify template shows updated linking guidance
    • Check that all keyword examples display correctly

Expected Results

  • Workflow correctly identifies linked issues
  • Workflow comments helpfully when no link found
  • All 9 PR templates show enhanced linking guidance
  • No errors or test failures

Checklist (Global DoD / PR)

  • All AC met and demonstrated
  • Tests added/updated (linting/formatting validated)
  • Accessibility checklist completed (where relevant):
    • Semantic HTML and heading order verified (N/A - workflows)
    • Keyboard navigation and visible focus states verified (N/A - workflows)
    • ARIA used only where needed (N/A - workflows)
    • Contrast and non-colour cues reviewed (N/A - workflows)
  • Docs/readme/changelog updated (templates updated)
  • Security checklist completed (where relevant):
    • Untrusted input validated and sanitised (N/A - templates)
    • Output escaped for its rendering context (GitHub Actions handles escaping)
    • Privileged actions enforce nonce and capability checks (GitHub Actions scoped correctly)
    • No secrets/sensitive data introduced; OWASP risks reviewed (No secrets used)
  • Code/design reviews approved
  • CI green; linked issues closed; release notes prepared (if shipping)

Deliverables

  • ✅ GitHub Action workflow for PR-issue linking enforcement
  • ✅ Enhanced PR templates with linking guidance in all 9 templates
  • ✅ Documentation comments explaining enforcement design
  • ✅ Non-blocking informational workflow (comments, no merge blocking yet)

Branch: build/enforce-pr-issue-linking


Generated by Claude Code

- Create enforce-pr-issue-linking.yml workflow to detect PRs without linked issues
- Workflow checks for linking keywords (Closes, Fixes, Resolves, Relates to)
- Comments on PR with guidance if no linked issue found
- Idempotent (won't duplicate comments)

- Update all 9 PR templates with comprehensive linking guidance
- Added linking keyword examples to each template
- Explained auto-closing behavior and why linking matters
- Consistent guidance across all PR types

Closes #2542
Closes #2543

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 56 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 44ce8d01-5cb7-47cd-a173-107a5f82fa02

📥 Commits

Reviewing files that changed from the base of the PR and between 04183d7 and 0ef4990.

📒 Files selected for processing (10)
  • .github/PULL_REQUEST_TEMPLATE/pr_bug.md
  • .github/PULL_REQUEST_TEMPLATE/pr_chore.md
  • .github/PULL_REQUEST_TEMPLATE/pr_ci.md
  • .github/PULL_REQUEST_TEMPLATE/pr_dep_update.md
  • .github/PULL_REQUEST_TEMPLATE/pr_docs.md
  • .github/PULL_REQUEST_TEMPLATE/pr_feature.md
  • .github/PULL_REQUEST_TEMPLATE/pr_hotfix.md
  • .github/PULL_REQUEST_TEMPLATE/pr_refactor.md
  • .github/PULL_REQUEST_TEMPLATE/pr_release.md
  • .github/workflows/enforce-pr-issue-linking.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ashleyshaw
ashleyshaw marked this pull request as ready for review August 30, 2026 07:32
@ashleyshaw
ashleyshaw enabled auto-merge (squash) August 30, 2026 07:33
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #2550

CI Status:success
Files changed: 10

Recommendations

  • Ready to proceed pending human review

@ashleyshaw ashleyshaw self-assigned this Aug 30, 2026
@ashleyshaw ashleyshaw added this to the v1.1 milestone Aug 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Reviewer Summary for PR #2550

CI Status:success
Files changed: 10

Recommendations

  • Ready to proceed pending human review

@ashleyshaw
ashleyshaw merged commit 8cfe34d into develop Aug 30, 2026
33 of 47 checks passed
@ashleyshaw
ashleyshaw deleted the build/enforce-pr-issue-linking branch August 30, 2026 07:34
@github-actions

Copy link
Copy Markdown
Contributor

Milestone Allocation


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs/governance: Update PR templates with linking requirements build/ci: Create PR-issue linking enforcement workflow

2 participants