Skip to content

868: Update PR verification to ensure that the description portion of the PR is filled out - #867

Merged
angelayu0530 merged 2 commits into
mainfrom
868
Mar 19, 2026
Merged

868: Update PR verification to ensure that the description portion of the PR is filled out #867
angelayu0530 merged 2 commits into
mainfrom
868

Conversation

@angelayu0530

@angelayu0530 angelayu0530 commented Mar 18, 2026

Copy link
Copy Markdown
Member

868

Description of changes

-Ensured that the GH description section is filled out via the PR Verifications CI job

Checklist before review

  • I have done a thorough self-review of the PR
  • Copilot has reviewed my latest changes, and all comments have been fixed and/or closed.
  • If I have made database changes, I have made sure I followed all the db repo rules listed in the wiki here. (check if no db changes)
  • All tests have passed
  • I have successfully deployed this PR to staging
  • I have done manual QA in both dev (and staging if possible) and attached screenshots below.

Screenshots

Dev

Screenshot 2026-03-18 at 1 13 07 PM Screenshot 2026-03-18 at 1 17 49 PM

@github-actions

Copy link
Copy Markdown
Contributor

Available PR Commands

  • /ai - Triggers all AI review commands at once
  • /review - AI review of the PR changes
  • /describe - AI-powered description of the PR
  • /improve - AI-powered suggestions
  • /deploy - Deploy to staging

See: https://github.com/tahminator/codebloom/wiki/CI-Commands

@github-actions

Copy link
Copy Markdown
Contributor

Title

868: # Update PR verification to ensure that the description portion of the PR is filled out


PR Type

Enhancement


Description

  • Validate PR description content.

  • Remove ticket link from body.

  • Fail PR if description empty.

  • Post comment on PR.


Diagram Walkthrough

flowchart LR
  A[PR Verification Workflow] --> B{Call _validatePrDescription};
  B --> C{Fetch PR Body};
  C --> D{Remove Ticket Link};
  D --> E{Is Description Empty?};
  E -- Yes --> F[Send PR Comment];
  E -- Yes --> G[Exit with Error];
  E -- No --> H[Continue Workflow];
Loading

File Walkthrough

Relevant files
Workflow
index.ts
Integrate PR description validation into workflow               

.github/scripts/notion/index.ts

  • Imports the new _validatePrDescription function.
  • Calls _validatePrDescription to enforce PR description validation.
+3/-0     
New feature
validate-pr-description.ts
Implement PR description validation logic                               

.github/scripts/notion/pr/validate-pr-description.ts

  • Implements _validatePrDescription to check PR body content.
  • Fetches the PR body using gh pr view.
  • Removes the Notion ticket link from the PR body.
  • Sends a comment to the PR and exits with an error if the description
    is empty.
+29/-0   

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Regex Robustness

The regular expression used to remove the ticket link from the PR body (.replace(new RegExp(^##\s*\[${taskId}\]\(.?\)\s, "m"), "")) should be thoroughly validated to ensure it correctly identifies and removes only the auto-generated ticket link at the beginning of the description, without inadvertently removing legitimate user-provided content or failing to match variations of the link format.

const bodyWithoutTicketLink = (body ?? "")
  .replace(new RegExp(`^##\\s*\\[${taskId}\\]\\(.*?\\)\\s*`, "m"), "")
  .trim();
External Dependency

The sendMessage utility is used to post a comment to the PR when the description is empty. The functionality and reliability of this external utility should be confirmed to ensure that messages are consistently and correctly posted to GitHub.

  await sendMessage(
    prId,
    `
### PR Description Required
The PR description is empty. Please fill out the description below the ticket link.`.trim(),
  );

Comment thread .github/scripts/notion/pr/validate-pr-description.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Title

868: # Update PR verification to ensure that the description portion of the PR is filled out


PR Type

Enhancement


Description

  • Add PR description validation.

  • Fail CI if PR description is empty.

  • Exclude Notion ticket link from validation.


Diagram Walkthrough

flowchart LR
  A[Start CI] --> B{Check Commits};
  B --> C{Update Notion Task};
  C --> D{Update PR Description};
  D --> E{Validate PR Description};
  E -- "Description Empty" --> F[Fail CI];
  E -- "Description Present" --> G[Continue CI];
Loading

File Walkthrough

Relevant files
Configuration changes
index.ts
Integrate PR description validation into CI workflow         

.github/scripts/notion/index.ts

  • Imports the new _validatePrDescription function.
  • Calls _validatePrDescription after updating the PR description with
    the ticket link.
+3/-0     
Enhancement
validate-pr-description.ts
Implement PR description validation logic                               

.github/scripts/notion/pr/validate-pr-description.ts

  • Fetches the PR body using gh pr view.
  • Removes the Notion ticket link from the PR body.
  • Checks if the remaining PR description is empty.
  • Sends a message to the PR and exits with an error if the description
    is empty.
+29/-0   

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Regex Robustness

The regular expression used to remove the Notion ticket link from the PR body (new RegExp(^##\s*\[${taskId}\]\(.?\)\s, "m")) is specific to the current auto-generated format. If the format of the Notion ticket link in the PR description changes in the future, this regex might need to be updated to ensure the validation continues to work correctly.

const bodyWithoutTicketLink = (body ?? "")
  .replace(new RegExp(`^##\\s*\\[${taskId}\\]\\(.*?\\)\\s*`, "m"), "")
  .trim();

Comment thread .github/scripts/notion/pr/validate-pr-description.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Title

868: # Update PR verification to ensure that the description portion of the PR is filled out


PR Type

Enhancement


Description

  • Enforce PR description presence.

  • New GitHub Action validates PR body.

  • Fails CI if description is empty.


Diagram Walkthrough

flowchart LR
  A[PR Event] --> B{Verify PR Description Action}
  B --> C{Is PR description filled?}
  C -- Yes --> D[CI Passes]
  C -- No --> E[CI Fails & Comments]
Loading

File Walkthrough

Relevant files
Enhancement
index.ts
New script to validate PR description content                       

.github/scripts/pr-description-check/index.ts

  • Implements a Bun script to fetch and validate the PR body.
  • Checks if the body of the PR is empty after trimming.
  • Sends a comment to the PR and exits with an error if the description
    is missing.
  • Logs a success message and exits if the description is present.
+42/-0   
Configuration changes
action.yml
Composite action for PR description validation                     

.github/composite/pr-description-check/action.yml

  • Defines a new composite GitHub Action named Verify PR Description.
  • Sets up the CI environment using a shared setup-ci composite action.
  • Executes the pr-description-check script, passing the PR_ID input.
+18/-0   
pr-verifications.yml
Integrate PR description check into workflow                         

.github/workflows/pr-verifications.yml

  • Adds a new step Verify PR description is filled out to the verifyPr
    job.
  • Integrates the new pr-description-check composite action.
  • Passes github.event.number as the PR_ID to the action.
+5/-0     

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Description Check Logic

The current implementation checks if the entire PR body is non-empty after trimming. However, the PR description template itself contains content (e.g., "## Description of changes", "## Checklist before review"). If a user creates a PR and does not add any custom content, but leaves the template as is, this check will still pass. Consider if the intent is to ensure that the specific "Description of changes" section is filled out, rather than just the overall PR body. This might require a more sophisticated parsing of the PR body to target specific sections.

if (body?.trim()) {

Comment thread .github/scripts/pr-description-check/index.ts
Comment thread .github/scripts/pr-description-check/index.ts Fixed
@github-actions

Copy link
Copy Markdown
Contributor

Title

868: # Update PR verification to ensure that the description portion of the PR is filled out


PR Type

Enhancement


Description

  • Adds CI check for PR descriptions.

  • Validates 'Description of changes' section.

  • Fails PR if description is empty.

  • Notifies author if description is missing.


Diagram Walkthrough

flowchart LR
  A["PR Verification Workflow"] --> B{"Verify PR Description"};
  B -- "Uses" --> C["Composite Action: pr-description-check"];
  C -- "Runs Bun Script" --> D["Script: pr-description-check/index.ts"];
  D -- "Fetches PR Body" --> E["GitHub API"];
  D -- "Checks 'Description of changes' section" --> F{Is Description Empty?};
  F -- "Yes" --> G["Fail PR & Send Message"];
  F -- "No" --> H["Pass"];
Loading

File Walkthrough

Relevant files
Script
index.ts
Script to validate PR description content                               

.github/scripts/pr-description-check/index.ts

  • Implements a Bun script to fetch PR details.
  • Extracts content from the 'Description of changes' section.
  • Removes HTML comments from the extracted description.
  • Checks if the cleaned description is empty.
  • Sends a GitHub comment and exits with an error if the description is
    empty.
+55/-0   
Configuration changes
action.yml
Composite action for PR description check                               

.github/composite/pr-description-check/action.yml

  • Defines a new composite GitHub Action named 'Verify PR Description'.
  • Sets up the CI environment using a shared setup action.
  • Executes the pr-description-check/index.ts script.
  • Passes the PR ID as an input to the script.
+18/-0   
pr-verifications.yml
Integrate PR description check into workflow                         

.github/workflows/pr-verifications.yml

  • Adds a new step to the verifyPr job.
  • Integrates the Verify PR description is filled out action.
  • Uses the newly created pr-description-check composite action.
  • Passes github.event.number as the PR_ID input.
+5/-0     

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Template Dependency

The script's regex for extracting the Description of changes section is tightly coupled to the current PR template's heading structure. If the PR template changes significantly (e.g., different heading levels or wording), this script might fail to correctly parse the description.

const match = (body ?? "").match(
  /## Description of changes\s*([\s\S]*?)(?=\n##|$)/,
);

Comment thread .github/scripts/pr-description-check/index.ts
@github-actions

Copy link
Copy Markdown
Contributor

PR Description Required

Please fill out the Description of changes section of the PR.

@github-actions

Copy link
Copy Markdown
Contributor

Title

868: # Update PR verification to ensure that the description portion of the PR is filled out


PR Type

Enhancement


Description

  • Adds CI check for PR descriptions

  • Extracts and validates 'Description of changes'

  • Notifies if PR description is empty

  • Integrates into pr-verifications workflow


Diagram Walkthrough

flowchart LR
  Start --> Checkout["Checkout Repository"];
  Checkout --> VerifyPRDescription["Verify PR description is filled out"];
  VerifyPRDescription -- "If empty" --> NotifyError["Notify and Exit with Error"];
  VerifyPRDescription -- "If filled" --> RunNotionChecks["Run Notion Checks"];
  NotifyError --> End;
  RunNotionChecks --> End;
Loading

File Walkthrough

Relevant files
Enhancement
index.ts
Script to validate PR description content                               

.github/scripts/pr-description-check/index.ts

  • Implements a Bun script to check PR description content.
  • Fetches the PR body using gh pr view command.
  • Extracts text under ## Description of changes and removes HTML
    comments.
  • Sends a message and exits with an error if the description is empty.
+55/-0   
Configuration changes
action.yml
Composite action for PR description verification                 

.github/composite/pr-description-check/action.yml

  • Defines a new composite GitHub Action named "Verify PR Description".
  • Sets up the CI environment using a reusable setup-ci action.
  • Executes the pr-description-check/index.ts script with the PR ID.
+18/-0   
pr-verifications.yml
Integrate PR description check into workflow                         

.github/workflows/pr-verifications.yml

  • Integrates the new Verify PR description is filled out step into the
    verifyPr job.
  • Uses the .github/composite/pr-description-check action.
  • Passes github.event.number as the PR_ID input to the action.
+5/-0     

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Regex Robustness

The regular expression used to extract the 'Description of changes' section relies on specific markdown headings. If the PR template's heading structure or wording for this section changes, the script might fail to correctly identify and extract the description content. It's important to validate that this regex is resilient to minor variations or that the PR template is strictly enforced.

const match = (body ?? "").match(
  /## Description of changes([\s\S]*?)(?=\n##|$)/,
);

Comment thread .github/scripts/pr-description-check/index.ts
@angelayu0530

Copy link
Copy Markdown
Member Author

/deploy

@angelayu0530 angelayu0530 changed the title 868: # Update PR verification to ensure that the description portion of the PR is filled out 868: Update PR verification to ensure that the description portion of the PR is filled out Mar 18, 2026
Comment thread .github/scripts/pr-description-check/index.ts Outdated
Comment thread .github/scripts/pr-description-check/index.ts Outdated
@angelayu0530
angelayu0530 force-pushed the 868 branch 3 times, most recently from 11650b9 to a2f68d5 Compare March 18, 2026 19:37
@github-actions

Copy link
Copy Markdown
Contributor

Title

868: Update PR verification to ensure that the description portion of the PR is filled out


PR Type

Enhancement


Description

  • Enforces PR description content.

  • Introduces new GitHub composite action.

  • Integrates into PR verification workflow.

  • Utilizes TypeScript script for validation.


Diagram Walkthrough

flowchart LR
  A[Pull Request Event] --> B{pr-verifications.yml};
  B --> C[Verify PR description step];
  C --> D[pr-description-check/action.yml];
  D --> E[pr-description-check/index.ts];
  E -- "Fetches PR body" --> F[PR Description Content];
  F{Is 'Description of changes' empty?} -- "Yes" --> G[Fail PR & Comment];
  F -- "No" --> H[Continue CI Workflow];
Loading

File Walkthrough

Relevant files
Script
index.ts
Adds script for PR description content validation               

.github/scripts/pr-description-check/index.ts

  • Implements a TypeScript script to validate PR descriptions.
  • Uses Octokit to fetch PR details and yargs for argument parsing.
  • Extracts content from the 'Description of changes' section, removing
    HTML comments.
  • Sends a comment to the PR and fails the CI if the description is
    empty.
+66/-0   
Configuration changes
action.yml
Creates composite action for PR description check               

.github/composite/pr-description-check/action.yml

  • Defines a new GitHub composite action for PR description verification.
  • Takes PR_ID as a required input.
  • Executes the pr-description-check/index.ts script using bun.
+18/-0   
pr-verifications.yml
Adds PR description verification to CI workflow                   

.github/workflows/pr-verifications.yml

  • Integrates the new pr-description-check composite action into the
    verifyPr job.
  • Passes the current PR number (github.event.number) to the action.
  • Ensures PR description validation runs as part of the CI workflow.
+5/-0     

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Regex Robustness

The regular expression used to extract the 'Description of changes' section relies on specific markdown headers. If the PR template's heading structure for this section changes in the future, this script might fail to correctly identify the description content. Consider if a more flexible parsing approach is needed, or ensure strict adherence to the PR template.

const descriptionContent = (() => {
  const match = (body ?? "").match(
    /## Description of changes([\s\S]*?)(?=\n##|$)/,
  );

Comment thread .github/scripts/pr-description-check/index.ts
Comment thread .github/scripts/pr-description-check/index.ts
@angelayu0530

Copy link
Copy Markdown
Member Author

/deploy

@github-actions

Copy link
Copy Markdown
Contributor

Title

868: Update PR verification to ensure that the description portion of the PR is filled out


PR Type

Enhancement


Description

  • Enforces PR description content via CI.

  • New script extracts and validates 'Description of changes'.

  • Integrates validation into pr-verifications workflow.


Diagram Walkthrough

flowchart LR
  A["pr-verifications.yml"] -- "calls" --> B["pr-description-check/action.yml"]
  B -- "executes" --> C["pr-description-check/index.ts"]
Loading

File Walkthrough

Relevant files
New feature
index.ts
New script for PR description validation                                 

.github/scripts/pr-description-check/index.ts

  • Implements a new TypeScript script to validate PR descriptions.
  • Uses Octokit to fetch the PR body based on prId.
  • Extracts content from the "## Description of changes" section,
    removing HTML comments.
  • If the extracted description is empty, it sends a message and exits
    with an error.
+66/-0   
action.yml
New composite action for PR description check                       

.github/composite/pr-description-check/action.yml

  • Creates a new GitHub composite action to verify PR descriptions.
  • Defines PR_ID as a required input for the action.
  • Sets up the CI environment using a shared setup composite action.
  • Runs the index.ts script using bun, passing the PR_ID input.
+18/-0   
Configuration changes
pr-verifications.yml
Integrate PR description check into CI workflow                   

.github/workflows/pr-verifications.yml

  • Integrates the new pr-description-check composite action into the
    verifyPr job.
  • The new step runs before other verification checks.
  • Passes the current GitHub event's PR number (github.event.number) as
    the PR_ID.
+5/-0     

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

**🎫 Ticket compliance analysis **

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Regex Robustness

The regular expression used to extract the 'Description of changes' section relies on the exact heading '## Description of changes'. If the heading format changes slightly (e.g., capitalization, extra spaces), the script might fail to correctly identify the section. Consider making the regex more flexible to variations in the heading.

const match = (body ?? "").match(
  /## Description of changes([\s\S]*?)(?=\n##|$)/,
);

Comment thread .github/scripts/pr-description-check/index.ts
Comment thread .github/scripts/pr-description-check/index.ts
@github-actions

Copy link
Copy Markdown
Contributor

PR Description Required

Please fill out the Description of changes section of the PR.

changes

trigger ci

Changes

changes

changes

changes
changes

removed useless code
@github-actions

Copy link
Copy Markdown
Contributor

Title

868: Update PR verification to ensure that the description portion of the PR is filled out


PR Type

Enhancement


Description

  • Add GitHub Action for PR verification.

  • Validate 'Description of changes' section.

  • Fail PR if description is empty.

  • Post comment for missing description.


Diagram Walkthrough

flowchart LR
  A["PR Created"] --> B{"Verify Description"};
  B -- "Description Found" --> C["Pass PR Verification"];
  B -- "Description Empty" --> D["Fail PR Verification"];
  D --> E["Post Comment on PR"];
Loading

File Walkthrough

Relevant files
Enhancement
index.ts
New script to validate PR description content                       

.github/scripts/pr-description-check/index.ts

  • Implements a new TypeScript script to validate PR descriptions.
  • Uses Octokit to fetch the PR body and extract the 'Description of
    changes' section.
  • Exits with an error if the description is empty, otherwise succeeds.
  • Sends a comment to the PR if the description is missing.
+60/-0   
Configuration changes
action.yml
New composite action for PR description check                       

.github/composite/pr-description-check/action.yml

  • Defines a new composite GitHub Action named Verify PR Description.
  • Accepts PR_ID as a required input.
  • Executes the pr-description-check/index.ts script using bun.
+18/-0   
pr-verifications.yml
Integrate PR description check into workflow                         

.github/workflows/pr-verifications.yml

  • Integrates the new pr-description-check composite action into the
    pr-verifications workflow.
  • Adds a step to verify the PR description is filled out.
  • Passes the GitHub event number (github.event.number) as the PR_ID.
+5/-0     

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

**🎫 Ticket compliance analysis **

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Fragile Logic

The script relies on a hardcoded string '## Description of changes' to identify the relevant section in the PR body. If the PR template or the exact wording of this header changes in the future, the script will fail to correctly parse the description, requiring an update to this script. Consider making this pattern configurable or more resilient to minor variations.

  const match = (body ?? "").match(
    /## Description of changes([\s\S]*?)(?=\n##|$)/,
  );
  return (match?.[1] ?? "").trim();
})();

Comment thread .github/scripts/pr-description-check/index.ts
Comment thread .github/scripts/pr-description-check/index.ts
@angelayu0530

Copy link
Copy Markdown
Member Author

/deploy

@angelayu0530
angelayu0530 enabled auto-merge (rebase) March 19, 2026 16:56
@angelayu0530
angelayu0530 disabled auto-merge March 19, 2026 17:02
@angelayu0530
angelayu0530 merged commit d4f09f6 into main Mar 19, 2026
35 checks passed
@angelayu0530
angelayu0530 deleted the 868 branch March 19, 2026 17:03
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.

3 participants