Skip to content

chore: add PR validation workflow and update contributing guidelines#2777

Open
fallenbagel wants to merge 1 commit intodevelopfrom
fallenbagel/chore/pr-template-check-with-updated-contributing-guides
Open

chore: add PR validation workflow and update contributing guidelines#2777
fallenbagel wants to merge 1 commit intodevelopfrom
fallenbagel/chore/pr-template-check-with-updated-contributing-guides

Conversation

@fallenbagel
Copy link
Copy Markdown
Collaborator

@fallenbagel fallenbagel commented Mar 28, 2026

Description

We've been getting an increasing number of PRs that completely ignore the PR template with no description, no testing details, unchecked checklists, and AI-generated descriptions that replace our template with their own format. This adds an automated PR template validation check that labels non-compliant PRs as blocked and comments with what's missing. It also updates the contributing guide to make it explicit that ignoring the PR template may result in closure without review.

How Has This Been Tested?

Screenshots / Logs (if applicable)

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Summary by CodeRabbit

  • Documentation

    • Strengthened contribution guidelines with explicit AI-disclosure rules, a detailed PR checklist, and clearer mandatory template sections; maintainers may close incomplete PRs
  • Chores

    • Added an automated PR validation workflow that enforces semantic titles, validates PR templates, posts issue comments, and adds/removes a blocking label as needed
    • Added a CLI PR-body validator to enforce description, testing, checklist, and disclosure requirements; replaced the prior semantic PR workflow

@fallenbagel fallenbagel requested a review from a team as a code owner March 28, 2026 22:47
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 40573c06-17b9-4a90-8d8a-381eb6ff4253

📥 Commits

Reviewing files that changed from the base of the PR and between c20b8f9 and cad6e3a.

📒 Files selected for processing (4)
  • .github/workflows/pr-validation.yml
  • .github/workflows/semantic-pr.yml
  • CONTRIBUTING.md
  • bin/check-pr-template.mjs
💤 Files with no reviewable changes (1)
  • .github/workflows/semantic-pr.yml
✅ Files skipped from review due to trivial changes (2)
  • bin/check-pr-template.mjs
  • .github/workflows/pr-validation.yml

📝 Walkthrough

Walkthrough

Adds a new PR validation GitHub Actions workflow that validates semantic titles and PR templates (via a Node.js script), removes the old semantic-pr workflow, and updates CONTRIBUTING.md to tighten AI-disclosure and template compliance guidance.

Changes

Cohort / File(s) Summary
New PR validation workflow
​.github/workflows/pr-validation.yml
Adds pull_request_target workflow with two jobs: semantic-title (runs amannn/action-semantic-pull-request) and template-check (checks PR body using Node script, posts/upserts bot comments, and manages blocked:template label).
Removed legacy workflow
​.github/workflows/semantic-pr.yml
Deletes previous standalone semantic PR workflow that enforced conventional PR titles.
PR template validator script
bin/check-pr-template.mjs
New Node CLI that parses PR body for ## Description, ## How Has This Been Tested?, ## Checklist, enforces specific checkboxes (including conditional AI disclosure based on author association), detects unresolved Fixes #XXXX`` placeholders, emits JSON issues and appropriate exit code.
Contribution guidance
CONTRIBUTING.md
Rewrites AI assistance/disclosure policy: lists detectable indicators of unreviewed AI output, requires use of the PR template and in-PR AI disclosure, adds standardized disclosure block and contributor expectations checklist.

Sequence Diagram(s)

sequenceDiagram
  participant Contributor
  participant GH_Actions as "GitHub Actions (runner)"
  participant NodeScript as "bin/check-pr-template.mjs"
  participant GH_API as "GitHub API (comments/labels)"

  Contributor->>GH_Actions: open/reopen/edit/synchronize PR
  GH_Actions->>GH_Actions: run semantic-title job
  GH_Actions->>GH_Actions: run template-check job (unless synchronize)
  alt PR author is bot
    GH_Actions-->>Contributor: emit skip=true (skip validation)
  else non-bot author
    GH_Actions->>NodeScript: run check-pr-template with PR body
    NodeScript-->>GH_Actions: return exit code + issues JSON
    alt issues found
      GH_Actions->>GH_API: upsert bot comment with "### Issues found"
      GH_Actions->>GH_API: add `blocked:template` label (create if needed)
      GH_Actions-->>GH_Actions: mark job failed
    else no issues
      GH_Actions->>GH_API: remove `blocked:template` label (if present)
      GH_Actions->>GH_API: delete matching bot comment (if present)
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

Possibly related PRs

Suggested reviewers

  • M0NsTeRRR
  • sudo-kraken
  • gauthier-th

"🐇 I hopped in swift to guard the gate,
Titles checked and templates up to date.
Tell if AI helped, be clear and kind,
A little bot note to keep things aligned.
Hooray for checks that keep the code refined!"

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main changes: adding a PR validation workflow and updating contributing guidelines, which aligns with the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@fallenbagel fallenbagel requested review from a team and Copilot and removed request for a team March 28, 2026 22:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds automated PR metadata enforcement to reduce low-effort/non-template PR submissions by validating PR titles and PR-template completeness via GitHub Actions, and updates contributor guidance to set expectations around template compliance and AI disclosure.

Changes:

  • Add a PR Validation workflow that enforces semantic PR titles and validates PR template completion (labeling/commenting on failures).
  • Introduce a Node-based PR body validator script (bin/check-pr-template.mjs) used by the workflow.
  • Expand CONTRIBUTING.md guidance around PR template compliance and AI disclosure expectations; remove the old standalone semantic-pr workflow.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
bin/check-pr-template.mjs New script to parse PR body and report missing/placeholder sections and unchecked required checklist items.
CONTRIBUTING.md Clarifies AI assistance disclosure requirements and sets stricter expectations for filling out the PR template.
.github/workflows/semantic-pr.yml Removes the legacy standalone semantic PR title workflow (replaced by consolidated validation workflow).
.github/workflows/pr-validation.yml New consolidated workflow: semantic title check + PR template validation with automatic labeling/commenting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
.github/workflows/pr-validation.yml (1)

90-99: Mark the bot comment explicitly before updating or deleting it.

Matching any bot comment that contains ### Issues found: is too broad. This can overwrite or delete an unrelated automation comment. Add a workflow-specific marker to commentBody and match on that marker instead.

Suggested fix
+            const COMMENT_MARKER = '<!-- pr-template-validation -->';
             const issueList = issues.map(i => `- ${i}`).join('\n');
 
             const commentBody = [
+              COMMENT_MARKER,
               `Hey @${author}, thanks for submitting this PR! However, it looks like the PR template hasn't been fully filled out.\n`,
               `### Issues found:\n`,
               issueList,
@@
             const botComment = comments.data.find(
-              c => c.user.type === 'Bot' && c.body.includes('### Issues found:')
+              c => c.user.type === 'Bot' && c.body.includes(COMMENT_MARKER)
             );
@@
             const botComment = comments.data.find(
-              c => c.user.type === 'Bot' && c.body.includes('### Issues found:')
+              c => c.user.type === 'Bot' && c.body.includes(COMMENT_MARKER)
             );

Also applies to: 108-110, 184-185

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-validation.yml around lines 90 - 99, The bot's
commentBody (variable commentBody) currently uses a generic marker `### Issues
found:` which is too broad and risks matching unrelated automation comments;
update the commentBody to include a unique workflow-specific marker (e.g., a
short, unique token or HTML comment like `<!-- pr-validation-bot: v1 -->`) and
then change any comment-matching/updating logic to look for that exact marker
instead of `### Issues found:`; apply the same change to the other commentBody
instances referenced in the review so every workflow-specific bot comment has
the unique marker used for safe updates/deletes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/pr-validation.yml:
- Line 86: The workflow is using a generic LABEL constant ('blocked') that this
job later unconditionally removes; change LABEL to a workflow-owned name (e.g.,
'pr-template-blocked' or similar) and update all uses (the const LABEL and every
place that adds/removes it) so the job only touches that workflow-specific
label; additionally, when removing the label, guard the removal so it only
removes labels the workflow actually added (for example by checking the label
name matches the workflow-owned name or verifying the label was created/added by
the bot/this workflow) rather than unconditionally removing a generic 'blocked'
label.

In `@bin/check-pr-template.mjs`:
- Around line 19-22: The maintainer exemption implemented by MAINTAINER_ROLES
and isMaintainer lets OWNER/MEMBER/COLLABORATOR bypass the AI-disclosure
checkbox, which conflicts with CONTRIBUTING.md; either remove the exemption
logic or make it explicit in the guide. Update the code around MAINTAINER_ROLES
/ isMaintainer (and any checks that use isMaintainer) to require the AI
disclosure for all authors by removing/ignoring this maintainer whitelist, or if
you must keep it, add a clear comment and link to the documented exemption and
adjust CONTRIBUTING.md to describe the exception; ensure
process.env.AUTHOR_ASSOCIATION is still read but no longer used to skip
AI-disclosure validation (or document the exemption in the guide).
- Around line 24-29: The replacement only strips triple-dash comments (`<!---
... --->`) so template placeholders like `<!-- ... -->` remain and make empty
sections appear non-empty; update the comment-stripping regex used when building
descriptionContent (and the equivalent replacement at the other location
handling "How Has This Been Tested?") to match standard HTML comments (use a
pattern that matches `<!-- ... -->`, e.g., `<!--[\s\S]*?-->` with the same
flags) and ensure both occurrences (the logic around
descriptionMatch/descriptionContent and the similar testing-section variable)
use that corrected regex before trimming and checking emptiness.

In `@CONTRIBUTING.md`:
- Around line 66-69: Fix the typo in the maintainer-review paragraph by
replacing the garbled phrase "isn not a maintainers job" with the correct
wording, e.g., "isn't a maintainer's job" (or "is not a maintainer's job") so
the sentence reads clearly; update the string containing that sentence in the
CONTRIBUTING.md paragraph where the phrase appears.
- Around line 41-48: The blockquote examples are split by blank lines
(triggering MD028); remove the empty lines inside each example so each
blockquote is a single contiguous quoted paragraph—specifically make the three
example lines starting with "> **AI Disclosure:**" contiguous (no blank lines
between the '>' lines) so each example is one continuous blockquote.

---

Nitpick comments:
In @.github/workflows/pr-validation.yml:
- Around line 90-99: The bot's commentBody (variable commentBody) currently uses
a generic marker `### Issues found:` which is too broad and risks matching
unrelated automation comments; update the commentBody to include a unique
workflow-specific marker (e.g., a short, unique token or HTML comment like `<!--
pr-validation-bot: v1 -->`) and then change any comment-matching/updating logic
to look for that exact marker instead of `### Issues found:`; apply the same
change to the other commentBody instances referenced in the review so every
workflow-specific bot comment has the unique marker used for safe
updates/deletes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 12935931-2574-4035-a8af-5ba07cfafc05

📥 Commits

Reviewing files that changed from the base of the PR and between 56b79ff and ab05dc4.

📒 Files selected for processing (4)
  • .github/workflows/pr-validation.yml
  • .github/workflows/semantic-pr.yml
  • CONTRIBUTING.md
  • bin/check-pr-template.mjs
💤 Files with no reviewable changes (1)
  • .github/workflows/semantic-pr.yml

@fallenbagel fallenbagel force-pushed the fallenbagel/chore/pr-template-check-with-updated-contributing-guides branch from ab05dc4 to c20b8f9 Compare March 28, 2026 23:11
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
CONTRIBUTING.md (1)

68-68: ⚠️ Potential issue | 🟡 Minor

Fix possessive typo in maintainer-review sentence.

Line 68 should use possessive form: maintainer's (or maintainers', if plural possessive is intended).

Suggested fix
-is not a maintainers job to review a PR so broken that it requires
+is not a maintainer's job to review a PR so broken that it requires
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CONTRIBUTING.md` at line 68, Replace the non-possessive phrase "is not a
maintainers job to review a PR so broken that it requires" with the correct
possessive form; change to either "is not a maintainer's job to review a PR so
broken that it requires" (singular) or "is not a maintainers' job to review a PR
so broken that it requires" (plural) depending on the intended meaning, updating
the sentence containing the exact phrase "is not a maintainers job to review a
PR so broken that it requires".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@bin/check-pr-template.mjs`:
- Around line 29-30: The current .replace call that removes the placeholder ("-
Fixes `#XXXX`") is too strict; update both .replace(...) usages (the calls that
currently use /- Fixes `#XXXX/g`) to use a case-insensitive pattern that matches
variants with optional surrounding backticks/quotes/dashes and arbitrary
whitespace (e.g., accepts "Fixes `#XXXX`", "`fixes  `#XXXX``", "- fixes `#XXXX`",
etc.), then trim as before; apply the same change to the second occurrence
around lines 77-79 so all placeholder variants are removed reliably.

---

Duplicate comments:
In `@CONTRIBUTING.md`:
- Line 68: Replace the non-possessive phrase "is not a maintainers job to review
a PR so broken that it requires" with the correct possessive form; change to
either "is not a maintainer's job to review a PR so broken that it requires"
(singular) or "is not a maintainers' job to review a PR so broken that it
requires" (plural) depending on the intended meaning, updating the sentence
containing the exact phrase "is not a maintainers job to review a PR so broken
that it requires".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5d511490-6345-4403-832d-d8190460ade7

📥 Commits

Reviewing files that changed from the base of the PR and between ab05dc4 and c20b8f9.

📒 Files selected for processing (4)
  • .github/workflows/pr-validation.yml
  • .github/workflows/semantic-pr.yml
  • CONTRIBUTING.md
  • bin/check-pr-template.mjs
💤 Files with no reviewable changes (1)
  • .github/workflows/semantic-pr.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/pr-validation.yml

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fallenbagel fallenbagel force-pushed the fallenbagel/chore/pr-template-check-with-updated-contributing-guides branch from c20b8f9 to cad6e3a Compare March 28, 2026 23:26
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.

2 participants