Skip to content

fix: Validate that an issue is linked in PR description#7719

Draft
c-warren wants to merge 1 commit intocadence-workflow:masterfrom
c-warren:cwarren/gitarissuechecker
Draft

fix: Validate that an issue is linked in PR description#7719
c-warren wants to merge 1 commit intocadence-workflow:masterfrom
c-warren:cwarren/gitarissuechecker

Conversation

@c-warren
Copy link
Contributor

What changed?

Validates whether the PR description contains a relevant GitHub issue.

Why?

We are aiming to improve the transparency of documentation, ease the process for creating new releases, and improve the context given to a reviewer for a PR. Adding an issue link reduces the need for duplication of reasoning (the issue should document part of the "why" for a given PR) and makes it easier for the release engineer to identify which commits relate to which issues.

We're using a gitar rule because:

  • its very easy to get started with and iterate on
  • we aren't allowed to use GitHub workflows that comment on PRs - which reduces the usability of open source GitHub actions

Unfortunately the gitar rule will be more expensive (an LLM request per PR update) and less deterministic. We will reevaluate as we test other actions.

How did you test it?

Tested via this PR and its integration with gitar.

Potential risks

None.

Release notes

N/A

Documentation Changes

N/A


Reviewer Validation

PR Description Quality (check these before reviewing code):

  • "What changed" provides a clear 1-2 line summary
    • Project Issue is linked
  • "Why" explains the full motivation with sufficient context
  • Testing is documented:
    • Unit test commands are included (with exact go test invocation)
    • Integration test setup/commands included (if integration tests were run)
    • Canary testing details included (if canary was mentioned)
  • Potential risks section is thoughtfully filled out (or legitimately N/A)
  • Release notes included if this completes a user-facing feature
  • Documentation needs are addressed (or noted if uncertain)

@gitar-bot
Copy link

gitar-bot bot commented Feb 17, 2026

Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Well-structured Gitar rule with clear validation logic and sensible skip conditions. One minor suggestion to add revert: to the exempt maintenance prefixes given it was recently added as a valid commit type for the project.

💡 Edge Case: Missing revert: from exempt maintenance commit prefixes

📄 .gitar/rules/issue-linking-required.md:31

The maintenance commit prefixes (docs:, chore:, ci:, style:) don't include revert:, which was recently added to the project's valid commit types (see commit 32ed638chore: add revert to commit types). Reverts are typically urgent rollbacks that shouldn't require issue linking since they're undoing a previous change that already has its own issue context. Similarly, test: is a common conventional commit prefix for test-only changes that may not warrant an issue link.

Consider adding revert: (and optionally test:) to the exempt prefixes list.

Suggested fix
PRs with titles starting with these conventional commit prefixes are exempt:
- `docs:` - Documentation changes
- `chore:` - Maintenance tasks, dependency updates
- `ci:` - CI/CD configuration changes
- `style:` - Code formatting or style changes
- `revert:` - Reverts of previous changes
Rules ❌ No requirements met

Repository Rules

PR Description Quality Standards: Expand 'Why?' section to explain the technical rationale for choosing Gitar over alternatives, and provide concrete test commands in 'How did you test it?' section instead of vague statements
GitHub Issue Linking Requirement: PR has 'ci:' prefix indicating CI/CD configuration changes

Hide rules that don't apply by commenting gitar display:compact.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: verbose → Showing more information.

Comment with these commands to change:

Auto-apply Verbose
gitar auto-apply:on         
gitar display:compact         

Was this helpful? React with 👍 / 👎 | Gitar

- Example: Quick typo fixes, minor documentation updates

### 2. Maintenance Commits
PRs with titles starting with these conventional commit prefixes are exempt:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Edge Case: Missing revert: from exempt maintenance commit prefixes

The maintenance commit prefixes (docs:, chore:, ci:, style:) don't include revert:, which was recently added to the project's valid commit types (see commit 32ed638chore: add revert to commit types). Reverts are typically urgent rollbacks that shouldn't require issue linking since they're undoing a previous change that already has its own issue context. Similarly, test: is a common conventional commit prefix for test-only changes that may not warrant an issue link.

Consider adding revert: (and optionally test:) to the exempt prefixes list.

Suggested fix:

PRs with titles starting with these conventional commit prefixes are exempt:
- `docs:` - Documentation changes
- `chore:` - Maintenance tasks, dependency updates
- `ci:` - CI/CD configuration changes
- `style:` - Code formatting or style changes
- `revert:` - Reverts of previous changes

Was this helpful? React with 👍 / 👎

@c-warren
Copy link
Contributor Author

gitar display:verbose

@c-warren c-warren changed the title ci: Validate that an issue is linked in PR description fix: Validate that an issue is linked in PR description Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant