feat: configure CI and pages for storybook tests#2
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThese changes establish comprehensive CI/CD infrastructure via GitHub Actions workflows for automated testing and GitHub Pages deployment. Vite and Vitest configurations are updated to handle dynamic base paths and CI-aware timeouts, while supporting coverage reporting. Build tooling specification and documentation are added to reflect the new deployment capabilities. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR configures comprehensive CI/CD infrastructure for the project, including automated testing, coverage reporting, and deployment to GitHub Pages for both the application and Storybook documentation.
Changes:
- Added GitHub Actions workflows for testing (with coverage) and deployment to GitHub Pages
- Configured Vitest with coverage thresholds and CI-specific browser testing settings
- Set up base path configuration for GitHub Pages deployment in Vite and Storybook configs
- Added mise.toml for Bun version management and new test:coverage npm script
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Added coverage configuration with thresholds, CI environment detection, and Playwright browser settings optimized for CI |
| vite.config.ts | Added CI-aware base path configuration for GitHub Pages deployment |
| .storybook/main.ts | Added viteFinal hook to configure base path for Storybook in CI/production builds |
| .github/workflows/test.yml | New workflow for running tests, linting, type checking, and uploading coverage reports |
| .github/workflows/storybook-deploy.yml | New workflow for building and deploying both the app and Storybook to GitHub Pages |
| package.json | Added test:coverage script for generating coverage reports |
| mise.toml | New file specifying Bun version 1.1.38 for consistent tooling |
| README.md | Updated with Live section and comprehensive CI/CD documentation |
| src/reatom.init.ts | Added comment emphasizing importance of clearStack() call |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 43-46: In the "Live" section of README.md (the "## Live" heading
and its list items), replace the bare URLs that trigger MD034 with explicit
Markdown link syntax; e.g. change the plain URL list items for the App and
Storybook to use link text like [App](https://guria.github.io/modern-stack/) and
[Storybook](https://guria.github.io/modern-stack/storybook/) so the URLs are not
bare.
♻️ Duplicate comments (4)
.github/workflows/test.yml (1)
67-75: Use a JSON-aware transform for the coverage summary.Line 74’s
sedcan corrupt JSON; this was already flagged in a prior review.✅ Suggested fix
- sed "s|$PWD/||g" coverage/coverage-summary.json >> $GITHUB_STEP_SUMMARY + jq --arg cwd "$PWD/" 'walk(if type == "string" then gsub($cwd; "") else . end)' \ + coverage/coverage-summary.json >> "$GITHUB_STEP_SUMMARY".github/workflows/storybook-deploy.yml (2)
34-41: SetCIenvironment variable explicitly for build steps.The build steps rely on
CI === 'true'checks invite.config.tsand.storybook/main.tsfor base path configuration. While GitHub Actions setsCI=trueby default, explicitly defining it improves clarity and self-documentation.Suggested fix
- name: Build app + env: + CI: 'true' run: bun run build - name: Verify app build run: test -f dist/index.html || exit 1 - name: Build Storybook + env: + CI: 'true' run: bun run build-storybookAlternatively, set it at the job level:
build: runs-on: ubuntu-latest timeout-minutes: 10 + env: + CI: 'true' permissions: contents: read
23-26: Consider usingmise-actionfor Bun version consistency.The
test.ymlworkflow usesmise-actionwhich reads the Bun version frommise.toml, while this workflow hardcodesbun-version: 1.1.38. Using a single source of truth reduces maintenance burden.vite.config.ts (1)
4-4: Standardize variable naming:isCi→isCI.This file uses
isCiwhilevitest.config.tsusesisCI. JavaScript conventions typically capitalize acronyms in camelCase identifiers.Suggested fix
-const isCi = process.env['CI'] === 'true' +const isCI = process.env['CI'] === 'true'And update the reference on line 8:
- base: command === 'build' && isCi ? '/modern-stack/' : '/', + base: command === 'build' && isCI ? '/modern-stack/' : '/',
🧹 Nitpick comments (1)
vitest.config.ts (1)
45-46: Consider documenting the timeout rationale.The 6x timeout increase (10s → 60s) for CI is significant. While reasonable for containerized browser tests, a brief comment explaining why CI needs longer timeouts would help future maintainers.
Suggested improvement
test: { name: 'storybook', + // CI environments are slower due to containerization and shared resources testTimeout: isCI ? 60000 : 10000, hookTimeout: isCI ? 60000 : 10000,
| ## Live | ||
|
|
||
| - App: https://guria.github.io/modern-stack/ | ||
| - Storybook: https://guria.github.io/modern-stack/storybook/ |
There was a problem hiding this comment.
Convert bare URLs to Markdown links.
Line 45–46 trips MD034 and is easy to fix with link syntax.
✅ Suggested fix
- - App: https://guria.github.io/modern-stack/
- - Storybook: https://guria.github.io/modern-stack/storybook/
+ - App: [https://guria.github.io/modern-stack/](https://guria.github.io/modern-stack/)
+ - Storybook: [https://guria.github.io/modern-stack/storybook/](https://guria.github.io/modern-stack/storybook/)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ## Live | |
| - App: https://guria.github.io/modern-stack/ | |
| - Storybook: https://guria.github.io/modern-stack/storybook/ | |
| ## Live | |
| - App: [https://guria.github.io/modern-stack/](https://guria.github.io/modern-stack/) | |
| - Storybook: [https://guria.github.io/modern-stack/storybook/](https://guria.github.io/modern-stack/storybook/) |
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
45-45: Bare URL used
(MD034, no-bare-urls)
46-46: Bare URL used
(MD034, no-bare-urls)
🤖 Prompt for AI Agents
In `@README.md` around lines 43 - 46, In the "Live" section of README.md (the "##
Live" heading and its list items), replace the bare URLs that trigger MD034 with
explicit Markdown link syntax; e.g. change the plain URL list items for the App
and Storybook to use link text like [App](https://guria.github.io/modern-stack/)
and [Storybook](https://guria.github.io/modern-stack/storybook/) so the URLs are
not bare.
Summary by CodeRabbit
Release Notes
New Features
Documentation
Chores
✏️ Tip: You can customize this high-level summary in your review settings.