Skip to content

CI: Make missing manual testing section a CI failure#33345

Merged
ndelangen merged 1 commit into
nextfrom
sidnioulz/dx-mandatory-manual-test
Dec 22, 2025
Merged

CI: Make missing manual testing section a CI failure#33345
ndelangen merged 1 commit into
nextfrom
sidnioulz/dx-mandatory-manual-test

Conversation

@Sidnioulz
Copy link
Copy Markdown
Member

@Sidnioulz Sidnioulz commented Dec 12, 2025

What I did

A little experiment because I keep having to tell LLMs disguised as humans to respect our PR template. I'm hoping causing an explicit CI failure will cause more agents to output repro steps we need to speed up reviews.

This is tested via child PRs targeting this branch.

Checklist for Contributors

Testing

Tested through mock PRs targeting this branch.

Manual testing

See:

Documentation

ø

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

  • 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

  • Documentation

    • Enhanced PR template with improved visual formatting for manual testing guidance.
  • Chores

    • Added automated validation to enforce manual testing documentation in pull requests.

✏️ Tip: You can customize this high-level summary in your review settings.

@Sidnioulz Sidnioulz self-assigned this Dec 12, 2025
@Sidnioulz Sidnioulz added build Internal-facing build tooling & test updates ci:docs Run the CI jobs for documentation checks only. ci:normal and removed ci:docs Run the CI jobs for documentation checks only. labels Dec 12, 2025
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Dec 12, 2025

View your CI Pipeline Execution ↗ for commit 55be007

Command Status Duration Result
nx run-many -t compile,check,knip,test,pretty-d... ✅ Succeeded 9m 56s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-19 09:33:35 UTC

@storybook-app-bot
Copy link
Copy Markdown

storybook-app-bot Bot commented Dec 12, 2025

Package Benchmarks

Commit: 55be007, ran on 16 December 2025 at 12:57:47 UTC

No significant changes detected, all good. 👏

@Sidnioulz Sidnioulz force-pushed the sidnioulz/dx-mandatory-manual-test branch from f918eb7 to 3816249 Compare December 16, 2025 11:42
Comment thread .github/workflows/danger-js.yml
Comment thread scripts/dangerfile.js Outdated
@Sidnioulz Sidnioulz force-pushed the sidnioulz/dx-mandatory-manual-test branch from 377436b to 502ab96 Compare December 16, 2025 12:23
Comment thread scripts/dangerfile.js Outdated
@Sidnioulz Sidnioulz force-pushed the sidnioulz/dx-mandatory-manual-test branch 2 times, most recently from b35a3d1 to 9234f79 Compare December 16, 2025 12:30
@Sidnioulz Sidnioulz marked this pull request as ready for review December 16, 2025 12:30
@Sidnioulz Sidnioulz removed their assignment Dec 16, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 16, 2025

📝 Walkthrough

Walkthrough

Two files are modified: a pull request template is updated to use Markdown admonition syntax for formatting guidance, and a new validation rule is added to dangerfile.js that enforces the presence and substantive content of a manual testing section in PR bodies, with bypass conditions for certain author roles.

Changes

Cohort / File(s) Change Summary
Pull Request Template Formatting
.github/PULL_REQUEST_TEMPLATE.md
Replaced plain-text manual testing notes with Markdown admonition blocks (> [!CAUTION]) for improved visual presentation.
PR Validation Logic
scripts/dangerfile.js
Added checkManualTestingSection(body) function that validates PR bodies contain a "#### Manual testing" section with substantive content, respecting bypass conditions for OWNER/MEMBER roles. Function is invoked during PR checks when prLogConfig is enabled.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Focus on the new validation logic in checkManualTestingSection() to verify correct section parsing, edge-case handling (empty sections, varied formatting), and proper role-based bypass conditions
  • Confirm integration point in the danger rule workflow is correctly placed and doesn't conflict with existing checks
✨ Finishing touches
  • 📝 Generate docstrings

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: 0

🧹 Nitpick comments (1)
scripts/dangerfile.js (1)

131-143: Replace [^] with [\s\S] for clarity and standard compliance.

Static analysis correctly flags [^] (negated empty character class) as problematic. While it works in JavaScript to match any character including newlines, [\s\S] is the conventional and more readable pattern.

Apply this diff:

   const contentWithoutInitialMessage = manualTestingContent
-    .replace(/>\s*\[!CAUTION\][^]*?This section is mandatory[^]*?Thanks!/i, '')
+    .replace(/>\s*\[!CAUTION\][\s\S]*?This section is mandatory[\s\S]*?Thanks!/i, '')
     .replace(
       /_This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!_/i,
       ''
     ) // FIXME: old syntax added to help debug the script until this PR is merged
     .trim();

   // Check if there's any substantial content (ignoring whitespace and template comments)
   const contentWithoutComments = contentWithoutInitialMessage
-    .replace(/<!--[^]*?-->/g, '') // Remove HTML comments
+    .replace(/<!--[\s\S]*?-->/g, '') // Remove HTML comments
     .replace(/\s+/g, ''); // Remove all whitespace
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b8df12 and 9234f79.

📒 Files selected for processing (3)
  • .github/PULL_REQUEST_TEMPLATE.md (1 hunks)
  • .github/workflows/danger-js.yml (0 hunks)
  • scripts/dangerfile.js (1 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/danger-js.yml
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use ESLint and Prettier configurations that are enforced in the codebase

Files:

  • scripts/dangerfile.js
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-28T14:50:24.889Z
Learning: Applies to README.md : Update relevant README files for significant code changes
📚 Learning: 2025-11-28T14:50:24.889Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-28T14:50:24.889Z
Learning: Applies to README.md : Update relevant README files for significant code changes

Applied to files:

  • .github/PULL_REQUEST_TEMPLATE.md
📚 Learning: 2025-11-28T14:50:24.889Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-28T14:50:24.889Z
Learning: Applies to code/{addons,frameworks}/**/README.md : Include code examples in addon/framework documentation for significant changes

Applied to files:

  • .github/PULL_REQUEST_TEMPLATE.md
🪛 Biome (2.1.2)
scripts/dangerfile.js

[error] 133-133: The regular expression includes this negated empty character class.

Negated empty character classes match anything.
If you want to match against [, escape it [.
Otherwise, remove the character class or fill it.

(lint/correctness/noEmptyCharacterClassInRegex)


[error] 133-133: The regular expression includes this negated empty character class.

Negated empty character classes match anything.
If you want to match against [, escape it [.
Otherwise, remove the character class or fill it.

(lint/correctness/noEmptyCharacterClassInRegex)


[error] 142-142: The regular expression includes this negated empty character class.

Negated empty character classes match anything.
If you want to match against [, escape it [.
Otherwise, remove the character class or fill it.

(lint/correctness/noEmptyCharacterClassInRegex)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: normal
  • GitHub Check: Core Unit Tests, windows-latest
  • GitHub Check: nx
🔇 Additional comments (4)
.github/PULL_REQUEST_TEMPLATE.md (1)

30-31: Improved visibility using GitHub admonition syntax.

The > [!CAUTION] block draws more attention to the mandatory section requirement and is properly handled by the corresponding regex in dangerfile.js.

scripts/dangerfile.js (3)

101-110: Bypass logic structure looks good.

The author association check correctly excludes bots while allowing maintainers to bypass. The commented return with the TODO is acknowledged in past review comments.


112-129: Section extraction logic is well-structured.

The regex correctly identifies the manual testing header and the boundary detection for the next section handles both cases (with/without subsequent sections).


145-155: Validation logic and integration are sound.

The empty content check correctly identifies PRs missing substantive manual testing instructions. The integration follows the established pattern alongside checkRequiredLabels and checkPrTitle.

@Sidnioulz Sidnioulz force-pushed the sidnioulz/dx-mandatory-manual-test branch from 9234f79 to f56d65e Compare December 16, 2025 12:44
@Sidnioulz Sidnioulz force-pushed the sidnioulz/dx-mandatory-manual-test branch from f56d65e to 55be007 Compare December 16, 2025 12:45
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: 0

🧹 Nitpick comments (1)
scripts/dangerfile.js (1)

132-145: Content validation logic is sound; static analysis warnings are false positives.

The validation correctly strips template boilerplate and checks for substantive content.

Regarding the static analysis warnings: The [^] pattern in JavaScript regex is a standard idiom that matches any character including newlines (equivalent to [\s\S] or . with the s flag). The Biome linter incorrectly interprets this as a negated empty character class. These warnings can be safely ignored.

Optional consideration: The regex on line 133 is tightly coupled to the exact wording in the PR template. If the admonition message changes, this validation will break. Consider whether a more flexible pattern (e.g., matching any content within > [!CAUTION] blocks) would be more maintainable.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9234f79 and 55be007.

📒 Files selected for processing (2)
  • .github/PULL_REQUEST_TEMPLATE.md (1 hunks)
  • scripts/dangerfile.js (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,json,html,ts,tsx,mjs}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use ESLint and Prettier configurations that are enforced in the codebase

Files:

  • scripts/dangerfile.js
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-28T14:50:24.889Z
Learning: Applies to README.md : Update relevant README files for significant code changes
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-28T14:50:24.889Z
Learning: Ensure all builds and tests pass before submitting pull requests
📚 Learning: 2025-11-28T14:50:24.889Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-28T14:50:24.889Z
Learning: Applies to README.md : Update relevant README files for significant code changes

Applied to files:

  • .github/PULL_REQUEST_TEMPLATE.md
📚 Learning: 2025-11-28T14:50:24.889Z
Learnt from: CR
Repo: storybookjs/storybook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-28T14:50:24.889Z
Learning: Applies to code/{addons,frameworks}/**/README.md : Include code examples in addon/framework documentation for significant changes

Applied to files:

  • .github/PULL_REQUEST_TEMPLATE.md
🪛 Biome (2.1.2)
scripts/dangerfile.js

[error] 133-133: The regular expression includes this negated empty character class.

Negated empty character classes match anything.
If you want to match against [, escape it [.
Otherwise, remove the character class or fill it.

(lint/correctness/noEmptyCharacterClassInRegex)


[error] 133-133: The regular expression includes this negated empty character class.

Negated empty character classes match anything.
If you want to match against [, escape it [.
Otherwise, remove the character class or fill it.

(lint/correctness/noEmptyCharacterClassInRegex)


[error] 138-138: The regular expression includes this negated empty character class.

Negated empty character classes match anything.
If you want to match against [, escape it [.
Otherwise, remove the character class or fill it.

(lint/correctness/noEmptyCharacterClassInRegex)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: normal
  • GitHub Check: Core Unit Tests, windows-latest
🔇 Additional comments (5)
.github/PULL_REQUEST_TEMPLATE.md (1)

30-31: LGTM! Good use of admonition syntax for visibility.

The Markdown admonition block makes the mandatory testing guidance more prominent, which aligns well with the CI enforcement being added in dangerfile.js.

scripts/dangerfile.js (4)

113-119: LGTM! Clear validation with helpful error message.

The section existence check correctly identifies the manual testing header and provides actionable guidance when missing.


122-129: LGTM! Robust content extraction.

The extraction logic correctly handles both mid-document sections and end-of-document cases, with an appropriate regex pattern to identify the next markdown section.


151-151: LGTM! Properly integrated into the validation flow.

The function is correctly invoked alongside other PR validation checks when prLogConfig is available.


104-109: No changes needed. The bot detection property is correct—Danger.js confirms the type property on GitHub user objects accepts the value "Bot" to identify bot accounts. The bypass logic correctly excludes bots from the OWNER/MEMBER privilege bypass.

@ndelangen ndelangen self-assigned this Dec 22, 2025
@ndelangen ndelangen merged commit a58fb91 into next Dec 22, 2025
69 of 70 checks passed
@ndelangen ndelangen deleted the sidnioulz/dx-mandatory-manual-test branch December 22, 2025 14:27
@github-actions github-actions Bot mentioned this pull request Dec 22, 2025
22 tasks
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:normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants