dx: compact storybook PR comment to single-line header#9078
dx: compact storybook PR comment to single-line header#9078christian-byrne merged 3 commits intomainfrom
Conversation
🎨 Storybook: ✅ Built — View Storybook |
📝 WalkthroughWalkthroughRefactors CI comment/deploy scripts and workflow steps to remove timestamp-based branching, simplify starting and completed PR comments, standardize status labels, and enhance Playwright reporting with per‑browser parallel report deployment and aggregated results. Changes
Sequence Diagram(s)sequenceDiagram
participant CI as CI Job
participant Scripts as Deploy & Comment Script
participant Storage as Report Host / Deployer
participant GitHub as GitHub (PR Comment)
CI->>Scripts: invoke script (starting)
Scripts->>GitHub: post "starting" comment
CI->>Scripts: invoke script (completed) with results
Scripts->>Storage: deploy per-browser reports (parallel)
Storage-->>Scripts: return report URLs
Scripts->>Scripts: aggregate counts, build comment (Browser Reports, failed tests)
Scripts->>GitHub: update PR comment with final header + Details (include deployment URL if success)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
🎭 Playwright: ✅ 526 passed, 0 failed · 4 flaky📊 Browser Reports
|
📦 Bundle: 4.37 MB gzip ⚪ 0 BDetailsSummary
Category Glance App Entry Points — 21.5 kB (baseline 21.5 kB) • ⚪ 0 BMain entry bundles and manifests
Graph Workspace — 942 kB (baseline 942 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Views & Navigation — 68.8 kB (baseline 68.8 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Panels & Settings — 436 kB (baseline 436 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
User & Accounts — 16 kB (baseline 16 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Editors & Dialogs — 738 B (baseline 738 B) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
UI Components — 43.2 kB (baseline 43.2 kB) • ⚪ 0 BReusable component library chunks
Data & Services — 2.51 MB (baseline 2.51 MB) • ⚪ 0 BStores, services, APIs, and repositories
Utilities & Hooks — 58 kB (baseline 58 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Vendor & Third-Party — 8.83 MB (baseline 8.83 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 7.61 MB (baseline 7.61 MB) • ⚪ 0 BBundles that do not match a named category
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@scripts/cicd/pr-storybook-deploy-and-comment.sh`:
- Around line 175-204: The details block currently always includes a markdown
link using $WORKFLOW_URL which may be empty; update the construction of the
details string so the "[📊 View Workflow Run]" link is only appended when
WORKFLOW_URL is non-empty (e.g., test $WORKFLOW_URL and append the "- [📊 View
Workflow Run]($WORKFLOW_URL)" line into details only if it exists), keeping the
rest of the details/header assembly (variables details, header, comment)
unchanged.
| # Build details section | ||
| details="<details> | ||
| <summary>Details</summary> | ||
|
|
||
| ⏰ Completed at: $(date -u '+%m/%d/%Y, %I:%M:%S %p') UTC | ||
|
|
||
| ### 🔗 Links | ||
| **Links** | ||
| - [📊 View Workflow Run]($WORKFLOW_URL)" | ||
|
|
||
| # Add deployment status | ||
|
|
||
| if [ "$deployment_url" != "Not deployed" ]; then | ||
| if [ "$deployment_url" = "Deployment failed" ]; then | ||
| comment="$comment | ||
| details="$details | ||
| - ❌ Storybook deployment failed" | ||
| elif [ "$WORKFLOW_CONCLUSION" = "success" ]; then | ||
| comment="$comment | ||
| - 🎨 $deployment_url" | ||
| else | ||
| comment="$comment | ||
| - ⚠️ Build failed - $deployment_url" | ||
| elif [ "$WORKFLOW_CONCLUSION" != "success" ]; then | ||
| details="$details | ||
| - ⚠️ Build failed — $deployment_url" | ||
| fi | ||
| elif [ "$WORKFLOW_CONCLUSION" != "success" ]; then | ||
| comment="$comment | ||
| details="$details | ||
| - ⏭️ Storybook deployment skipped (build did not succeed)" | ||
| fi | ||
|
|
||
| comment="$comment | ||
|
|
||
| --- | ||
| $footer_text" | ||
| details="$details | ||
|
|
||
| </details>" | ||
|
|
||
| comment="$COMMENT_MARKER | ||
| $header | ||
|
|
||
| $details" |
There was a problem hiding this comment.
Avoid emitting an empty workflow-run link.
If WORKFLOW_URL is unset, the current output renders a dead markdown link. Guard the link so the details block doesn’t include an empty URL.
🔧 Proposed fix
- details="<details>
-<summary>Details</summary>
-
-⏰ Completed at: $(date -u '+%m/%d/%Y, %I:%M:%S %p') UTC
-
-**Links**
-- [📊 View Workflow Run]($WORKFLOW_URL)"
+ details="<details>
+<summary>Details</summary>
+
+⏰ Completed at: $(date -u '+%m/%d/%Y, %I:%M:%S %p') UTC
+
+**Links**"
+
+ if [ -n "$WORKFLOW_URL" ]; then
+ details="$details
+- [📊 View Workflow Run]($WORKFLOW_URL)"
+ fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@scripts/cicd/pr-storybook-deploy-and-comment.sh` around lines 175 - 204, The
details block currently always includes a markdown link using $WORKFLOW_URL
which may be empty; update the construction of the details string so the "[📊
View Workflow Run]" link is only appended when WORKFLOW_URL is non-empty (e.g.,
test $WORKFLOW_URL and append the "- [📊 View Workflow Run]($WORKFLOW_URL)" line
into details only if it exists), keeping the rest of the details/header assembly
(variables details, header, comment) unchanged.
|
I like it. Can we make the Playwright comment text bigger too, maybe add 🎭 as a prefix? |
There was a problem hiding this comment.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@scripts/cicd/pr-storybook-deploy-and-comment.sh`:
- Around line 174-181: The details string currently always inserts the markdown
link using WORKFLOW_URL which can be empty; update the code that builds the
details variable (the details assignment) to conditionally include the "- [📊
View Workflow Run]($WORKFLOW_URL)" line only when WORKFLOW_URL is non-empty (or
alternatively render a non-linked placeholder like "Workflow URL not
available"); locate the assignment that defines details and modify it to append
the link segment only if the WORKFLOW_URL variable is set.
Summary
Compact the Storybook build status PR comment to a single-line header with collapsible details, matching the approach from #8677.
Changes
## 🎨 Storybook: ⏳ Building...## 🎨 Storybook: ✅ Built — [View Storybook](url)with timestamp/links in<details>## 🎨 Storybook: ❌ Failedwith details collapsed┆Issue is synchronized with this Notion page by Unito