Skip to content

CI: Use Danger to safeguard against forgotten cherrypicks#35171

Merged
Sidnioulz merged 2 commits into
nextfrom
sidnioulz/add-release-checklist-safeguard
Jun 17, 2026
Merged

CI: Use Danger to safeguard against forgotten cherrypicks#35171
Sidnioulz merged 2 commits into
nextfrom
sidnioulz/add-release-checklist-safeguard

Conversation

@Sidnioulz

@Sidnioulz Sidnioulz commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

What I did

  • Added a dangerjs check that verifies all checkboxes are checked on a release PR template
  • Turned the individual commit items from checkboxes into bullet points so you don't spend half the supercycle checking boxes in the GitHub UI

Checklist for Contributors

Testing

Manual testing

  • Merge this
  • Perform a release
  • Report any issue

Documentation

N/A

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Declare whether manual QA will be needed for this PR during the next release, through qa:needed or qa:skip

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Chores
    • Implemented automated checklist validation for release-targeting pull requests that enforces completion of all required items before merging, providing immediate feedback when items remain incomplete.
    • Improved release pull request description generation to enhance the formatting and readability of changelist entries while maintaining warning formatting for direct-commit records.

@Sidnioulz Sidnioulz requested a review from JReinhold June 15, 2026 12:23
@Sidnioulz Sidnioulz self-assigned this Jun 15, 2026
Copilot AI review requested due to automatic review settings June 15, 2026 12:23
@Sidnioulz Sidnioulz added build Internal-facing build tooling & test updates ci:docs Run the CI jobs for documentation checks only. qa:skip Pull Requests that do not need any QA. labels Jun 15, 2026
@Sidnioulz Sidnioulz moved this to In Progress in Core Team Projects Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a Danger CI guard to prevent merging release PRs with unfinished checklist items, and tweaks the generated release PR description to reduce manual checkbox work during the release process.

Changes:

  • Add a Danger.js check that fails release PRs when any unchecked markdown tasks (- [ ]) remain in the PR body.
  • Update release PR description generation to use bullet points (instead of checkboxes) for changelist PR entries.
  • Adjust cherry-pick command formatting in the generated checklist.

Reviewed changes

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

File Description
scripts/release/generate-pr-description.ts Reduces checkbox usage in generated changelists; formats manual cherry-pick items.
scripts/dangerfile.js Adds a release-PR-only checklist completeness gate to CI via Danger.

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

Comment thread scripts/release/generate-pr-description.ts Outdated
Comment thread scripts/release/generate-pr-description.ts
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: dff8942f-16ef-4bcf-bcef-0fa472fc905e

📥 Commits

Reviewing files that changed from the base of the PR and between 3cdf66e and 8cb51bf.

📒 Files selected for processing (2)
  • scripts/dangerfile.js
  • scripts/release/generate-pr-description.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • scripts/release/generate-pr-description.ts
  • scripts/dangerfile.js

📝 Walkthrough

Walkthrough

Adds a checkReleaseChecklist(body) function to dangerfile.js that fails the Danger run when a release-targeting PR contains unchecked - [ ] or * [ ] task list items. The function is called unconditionally after checkTargetBranch(). Separately, mapToChangelist in generate-pr-description.ts no longer prepends unchecked checkboxes to label lines in PR changelist entries.

Changes

Release PR Checklist Validation and Description Formatting

Layer / File(s) Summary
Remove stray checkboxes from generated PR description
scripts/release/generate-pr-description.ts
mapToChangelist removes the leading - [ ] checkbox from the label line of pull-request changelist entries; direct-commit warning entries retain the checkbox format.
Danger release checklist validation
scripts/dangerfile.js
Adds checkReleaseChecklist(body) that regex-scans the PR body for unchecked - [ ] / * [ ] items and calls fail() with a release-manager message when isReleasePr is true. Wired into the Danger execution flow immediately after checkTargetBranch().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

  • storybookjs/storybook#34007: Directly extends the dangerfile.js Danger validation flow that this PR builds upon by adding checkReleaseChecklist after checkTargetBranch().
  • storybookjs/storybook#35011: Also modifies scripts/dangerfile.js to add a new Danger-based PR validation gated by release vs. non-release branch status, the same branching pattern used here.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

@Sidnioulz Sidnioulz force-pushed the sidnioulz/add-release-checklist-safeguard branch from bbf8885 to 4ab40fc Compare June 16, 2026 07:43

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/sustainability/scratch/baseline-stats.ts`:
- Line 11: The run command in the comment on line 11 uses `node scripts/...`
format, but the repository convention requires `node ./...` format for
TypeScript scripts. Update the command from `GH_TOKEN=$(gh auth token) node
scripts/sustainability/scratch/baseline-stats.ts` to use `node
./scripts/sustainability/scratch/baseline-stats.ts` to align with the native
Node `.ts` execution convention.
- Around line 71-73: The timelineItems queries for ISSUE_COMMENT at lines 71,
83, and 107-116 only fetch the first COMMENTS_PER_ITEM (100) items without
pagination, causing undercounting of external participants for items with more
than 100 comments. Implement cursor-based pagination for each of these three
timelineItems query blocks by adding pageInfo (with hasNextPage and endCursor)
to the query structure, then implement pagination logic to repeatedly fetch
additional pages using the after parameter with the endCursor until hasNextPage
is false, accumulating all comment authors across all pages into a single
collection for each node.
🪄 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: 31eb1b09-c0f1-4ca8-b4a8-166d04d09ba3

📥 Commits

Reviewing files that changed from the base of the PR and between bbf8885 and 4ab40fc.

📒 Files selected for processing (3)
  • scripts/dangerfile.js
  • scripts/release/generate-pr-description.ts
  • scripts/sustainability/scratch/baseline-stats.ts
✅ Files skipped from review due to trivial changes (1)
  • scripts/release/generate-pr-description.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/dangerfile.js

Comment thread scripts/sustainability/scratch/baseline-stats.ts Outdated
Comment thread scripts/sustainability/scratch/baseline-stats.ts Outdated
Comment thread scripts/sustainability/scratch/baseline-stats.ts Outdated
Comment thread scripts/dangerfile.js Outdated
@Sidnioulz Sidnioulz force-pushed the sidnioulz/add-release-checklist-safeguard branch from 3cdf66e to 8cb51bf Compare June 16, 2026 09:45
@Sidnioulz Sidnioulz requested a review from JReinhold June 16, 2026 10:04
@Sidnioulz Sidnioulz merged commit 4e43fdd into next Jun 17, 2026
16 checks passed
@Sidnioulz Sidnioulz deleted the sidnioulz/add-release-checklist-safeguard branch June 17, 2026 14:33
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Core Team Projects Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Internal-facing build tooling & test updates ci:docs Run the CI jobs for documentation checks only. qa:skip Pull Requests that do not need any QA.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants