-
Notifications
You must be signed in to change notification settings - Fork 123
test: enable CodSpeed GitHub Action for performance benchmarking #625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add CodSpeed integration with vitest bench to enable continuous performance monitoring on PRs and pushes to master. - Add @codspeed/vitest-plugin dependency - Configure codspeed plugin in vite.config.ts - Create .github/workflows/codspeed.yml workflow - Add benchmark file with HttpClient and utility function benchmarks - Add `bench` npm script for local benchmark execution 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Warning Rate limit exceeded@fengmk2 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 5 minutes and 5 seconds before requesting another review. ⌛ 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. 📒 Files selected for processing (6)
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. 📝 WalkthroughWalkthroughAdds CodSpeed benchmarking: GitHub Actions workflow, Vitest bench script and plugin, Vite integration, Husky pre-commit hook, lint-staged config, lint/dev dependencies, .oxlintrc ignore pattern, and a new Vitest benchmark file for HttpClient and utilities. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer (push/PR)
participant GH as GitHub Actions
participant Runner as GitHub Runner (ubuntu-latest)
participant PNPM as pnpm / Node
participant CodSpeed as CodSpeedHQ/action
participant Vitest as Vitest (bench)
note over Dev,GH `#D3E4CD`: Trigger: push to master / PR / manual
Dev->>GH: push / open PR / workflow_dispatch
GH->>Runner: start "benchmarks" job
Runner->>PNPM: setup pnpm + Node.js v22
Runner->>PNPM: install dependencies (pnpm --frozen-lockfile)
Runner->>CodSpeed: invoke CodSpeed action (runs command)
CodSpeed->>Vitest: execute `pnpm vitest bench --run`
Vitest-->>CodSpeed: bench results
CodSpeed-->>GH: upload/record benchmark results
GH->>Dev: workflow status + artifacts
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
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 |
Summary of ChangesHello @fengmk2, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request sets up continuous performance monitoring by integrating CodSpeed with Vitest. This initiative aims to automatically run benchmarks on PRs and master branch pushes, providing an early warning system for any performance regressions and helping maintain the application's speed and efficiency. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #625 +/- ##
==========================================
+ Coverage 93.96% 94.57% +0.61%
==========================================
Files 14 14
Lines 1474 1474
Branches 321 321
==========================================
+ Hits 1385 1394 +9
+ Misses 85 76 -9
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request effectively lays the groundwork for performance benchmarking using CodSpeed and Vitest. The addition of the bench script, the @codspeed/vitest-plugin dependency, and the configuration in vite.config.ts are all correctly implemented. The new benchmark file, test/urllib.bench.ts, provides a good starting point for monitoring the performance of HttpClient and utility functions.
One critical point to address is that the pull request description mentions the creation of a .github/workflows/codspeed.yml workflow file, but this file does not appear to be included in the changes. This workflow is essential for integrating CodSpeed with your GitHub Actions and enabling continuous performance monitoring. Please add the workflow file to this pull request to complete the setup.
Configure pre-commit hook to run oxfmt via lint-staged on staged JavaScript and TypeScript files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds CodSpeed integration to enable continuous performance monitoring through automated benchmarking on PRs and pushes to master.
- Integrates @codspeed/vitest-plugin for performance tracking
- Creates a GitHub Actions workflow to run benchmarks automatically
- Adds initial benchmark suite covering HttpClient instantiation and utility functions
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/codspeed.yml | New workflow to run benchmarks on pushes to master and pull requests using CodSpeed |
| vite.config.ts | Adds codspeed plugin to vitest configuration |
| test/urllib.bench.ts | New benchmark file testing HttpClient creation and utility functions (parseJSON, digestAuthHeader, globalId, performanceTime) |
| package.json | Adds bench script and @codspeed/vitest-plugin dev dependency |
| pnpm-lock.yaml | Lockfile updates for new dependencies including @codspeed/core, axios, and related packages |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Action v4 requires explicit mode setting. Set to 'walltime' for standard benchmark measurements. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this 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)
package.json (1)
127-132: Consider narrowing the lint-staged file glob.The
"*"glob runs linting and formatting on all staged files, including non-code files (images, JSON, markdown, etc.). This is inefficient and may cause unexpected behavior or errors when oxlint processes non-TypeScript/JavaScript files.🔎 Proposed fix to target specific file types
"lint-staged": { - "*": [ + "*.{js,mjs,cjs,ts,mts,cts}": [ "pnpm run lint --fix", "oxfmt" ] }
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
.husky/pre-commit.oxlintrc.jsonpackage.jsontest/urllib.bench.tsvite.config.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- vite.config.ts
- test/urllib.bench.ts
🧰 Additional context used
🪛 Biome (2.1.2)
.oxlintrc.json
[error] 126-126: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 127-127: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 127-127: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
[error] 127-127: End of file expected
Use an array for a sequence of values: [1, 2]
(parse)
⏰ 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). (4)
- GitHub Check: Test (windows-latest, 24)
- GitHub Check: Test (windows-latest, 22)
- GitHub Check: Test (windows-latest, 18)
- GitHub Check: Test (windows-latest, 20)
🔇 Additional comments (4)
.oxlintrc.json (1)
126-127: LGTM - Static analysis false positive.The Biome parse errors are false positives. This file uses JSONC format (JSON with Comments), which oxlint supports, as evidenced by the comments throughout the configuration. The
ignorePatternsaddition is syntactically correct and appropriately excludes TypeScript fixture directories used for build testing.package.json (2)
25-51: LGTM on script changes.The script additions are well-structured:
lintwith--type-aware --type-checkenables TypeScript-aware lintingbenchscript properly integrates with CodSpeed via vitest benchpreparescript correctly initializes Husky v9+
61-93: LGTM on new devDependencies.The added dependencies are appropriate for the PR objectives:
@codspeed/vitest-pluginfor CodSpeed benchmarking integrationhuskyandlint-stagedfor pre-commit hooksoxlint-tsgolintfor enhanced TypeScript linting.husky/pre-commit (1)
1-1: LGTM!The pre-commit hook correctly uses Husky v9+ simplified format and invokes lint-staged via pnpm, aligning with the project's package manager configuration.
CodSpeed Performance ReportCongrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
Add CodSpeed integration with vitest bench to enable continuous performance monitoring on PRs and pushes to master.
benchnpm script for local benchmark execution🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.