Skip to content

Add Danger configuration and enforce PR description template#111

Open
kpj2006 wants to merge 2 commits intoAOSSIE-Org:mainfrom
kpj2006:pach-8
Open

Add Danger configuration and enforce PR description template#111
kpj2006 wants to merge 2 commits intoAOSSIE-Org:mainfrom
kpj2006:pach-8

Conversation

@kpj2006
Copy link
Copy Markdown
Contributor

@kpj2006 kpj2006 commented Mar 29, 2026

Addressed Issues:

Fixes #(issue number)

Screenshots/Recordings:

Additional Notes:

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • Chores
    • Pull requests now undergo automated template validation: empty descriptions are flagged, required section headings are checked, and checklist items must be marked complete.
    • The system warns when issue references are missing or placeholder text is used.
    • Validation results are posted as advisory messages on PRs to help contributors fix descriptions before review.

@github-actions github-actions bot added no-issue-linked PR is not linked to any issue ci-cd CI/CD pipeline changes configuration Configuration file changes github-actions GitHub Actions workflow changes javascript JavaScript/TypeScript code changes size/M Medium PR (51-200 lines changed) repeat-contributor PR from an external contributor who already had PRs merged pending-coderabbit-review labels Mar 29, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 33a66655-cafd-4b0f-9f09-36560c3ddceb

📥 Commits

Reviewing files that changed from the base of the PR and between 1585f6a and 01f71a0.

📒 Files selected for processing (1)
  • .github/workflows/danger.yml

Walkthrough

Adds a GitHub Actions workflow and a Danger configuration to validate PR descriptions against the repository's PR template, checking required sections, issue references, and checklist items, and posting aggregated advisory messages on PRs.

Changes

Cohort / File(s) Summary
PR Template Validation
\.github/workflows/danger.yml, dangerfile.js
New GitHub Actions workflow (pull_request_target) runs Danger CI (Node 20) for repo-owner AOSSIE-Org; dangerfile.js validates PR body: required section headings, issue reference pattern, and that specific checklist items are checked, aggregating issues into a single advisory message.

Sequence Diagram(s)

sequenceDiagram
    participant GH as GitHub
    participant WF as Workflow<br/>`.github/workflows/danger.yml`
    participant CI as Node/Danger CI
    participant DF as dangerfile.js

    GH->>WF: pull_request_target (opened/edited/reopened/synchronize)
    WF->>WF: validate repository owner\ncheckout base branch\nsetup Node 20
    WF->>CI: run `npx danger ci` (with GITHUB_TOKEN)
    CI->>DF: load & execute rules
    DF->>DF: validate PR body\n- check headings\n- verify issue reference\n- ensure checklist items checked
    DF->>CI: return findings
    CI->>GH: post/update PR comment with advisory
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • add pr template #14: Adds Danger workflow and dangerfile that enforce the PR template—strongly related.

Suggested labels

Typescript Lang

Suggested reviewers

  • Zahnentferner

Poem

🐰 In branches and PRs I hop with delight,

Checking the headings and boxes in sight,
A Danger-run nudge, tidy and bright,
Now templates align, and reviews take flight ✨

🚥 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 summarizes the main changes: adding Danger configuration and enforcing PR description template validation, which directly corresponds to the two files added.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown
Contributor

@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: 3

🤖 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/danger.yml:
- Around line 29-32: The Danger JS invocation currently uses an unpinned npx
call ("npx --yes danger ci"), which allows runtime package drift; change the
workflow step to pin a specific Danger version (e.g., replace "npx --yes danger
ci" with "npx --yes danger@<version> ci") or install Danger as a managed
dependency with a lockfile and run the locked script, ensuring the step that
runs Danger (the "Run Danger JS" step invoking npx) uses the pinned/locked
dependency.

In `@dangerfile.js`:
- Around line 40-46: The check that collects missingSections and appends to
issues currently only posts advisory messages; change the enforcement so
required-template violations cause CI failure by calling fail(...) instead of
message(...) or pushing to issues alone—update the block that handles
missingSections (and the similar block around the checklist handling at the
other occurrence) to call danger.fail with a clear message including the
missingSections list (e.g., use the same formatted string currently built) and
ensure any use of issues.push or message() for required items is replaced by
fail() so the PR status is blocked.
- Around line 66-70: The hard-coded array requiredChecklistItems contains
checklist strings that no longer match the PR template and causes false
negatives; update the entries in requiredChecklistItems to exactly match the
current PR template text or, better, change the matching logic used by the
checklist validator (e.g., functions referencing requiredChecklistItems) to
perform label-based or case-insensitive/trimmed substring matching instead of
strict equality so existing PRs aren't incorrectly flagged—locate the
requiredChecklistItems declaration and the validator function that checks PR
body against it and either replace the strings with the template's exact phrases
or implement tolerant matching (normalize whitespace/case or match labels).
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 10f3e83b-46dd-46ed-8e74-57465ea2193f

📥 Commits

Reviewing files that changed from the base of the PR and between 6ef9363 and 1585f6a.

📒 Files selected for processing (2)
  • .github/workflows/danger.yml
  • dangerfile.js

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

Labels

ci-cd CI/CD pipeline changes configuration Configuration file changes github-actions GitHub Actions workflow changes javascript JavaScript/TypeScript code changes no-issue-linked PR is not linked to any issue pending-coderabbit-review repeat-contributor PR from an external contributor who already had PRs merged size/M Medium PR (51-200 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant