Skip to content

feat: CodSpeed導入(パフォーマンスリグレッション検出)#166

Merged
is0692vs merged 5 commits intomainfrom
feat/issue-162-codspeed
Mar 22, 2026
Merged

feat: CodSpeed導入(パフォーマンスリグレッション検出)#166
is0692vs merged 5 commits intomainfrom
feat/issue-162-codspeed

Conversation

@is0692vs
Copy link
Copy Markdown
Contributor

@is0692vs is0692vs commented Mar 21, 2026

Summary

  • add CodSpeed GitHub Actions workflow for push / pull_request / workflow_dispatch
  • add Vitest benchmark script and dedicated ESM bench config for API workspace
  • add initial validation benchmarks for slug / name / description validators
  • update lockfile for @codspeed/vitest-plugin

Scope

  • .github/workflows/codspeed.yml
  • apps/api/vitest.bench.config.mts
  • apps/api/src/utils/__tests__/validation.bench.ts
  • package dependency updates required for benchmark execution

Validation

  • npm run bench -w apps/api
  • npm run typecheck
  • npm run test
  • npm run lint

Closes #162

Closes #162

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
open-shelf Ignored Ignored Mar 22, 2026 5:43am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 21, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Summary by CodeRabbit

リリースノート

  • Tests

    • パフォーマンス測定機能を追加しました。バリデーション機能のベンチマークテストが実装されました。
  • Chores

    • CI/CDパイプラインにパフォーマンス測定ワークフローを統合しました。
    • ベンチマークテストファイルをカバレッジ計算から除外するよう設定を更新しました。

Walkthrough

CodSpeed パフォーマンス監視ツールを導入し、GitHub Actions ワークフロー、Vitest ベンチマーク設定、検証関数のベンチマークテスト、および Codecov 設定を追加してパフォーマンスリグレッション検出を自動化。

Changes

Cohort / File(s) Summary
CI/CD 設定
.github/workflows/codspeed.yml, codecov.yml
CodSpeed GitHub Actions ワークフローを追加し、main ブランチへのプッシュと PR をトリガーとして npm run bench を実行。Codecov 設定でベンチマークファイル(**/*.bench.ts)をカバレッジから除外。
ベンチマークセットアップ
apps/api/package.json, apps/api/vitest.bench.config.mts
bench npm スクリプトを追加(vitest.bench.config.mts で設定)。CodSpeed Vitest プラグイン(v5.2.0)を開発依存関係に追加。ベンチマーク検出パターンを src/**/__tests__/**/*.bench.ts に設定。
バリデーションベンチマーク
apps/api/src/utils/__tests__/validation.bench.ts
validateSlugvalidateNamevalidateDescription の 3 つの検証関数について、有効な入力と無効な入力の複数ケースをカバーするベンチマークテストを追加。

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

size/M

Poem

🐰 ベンチマークの歩みぞ速く、
パフォーマンス監視の輪広がり、
CodSpeed の目ぬ漏らさず、
PR ごとに品質確かめ、
高速化への道、開かれり ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PRタイトル「feat: CodSpeed導入(パフォーマンスリグレッション検出)」は変更内容の主要な点を明確に要約しており、CodSpeed導入という中心的な目的を正確に反映しています。
Description check ✅ Passed PR説明は変更内容と密接に関連しており、CodSpeedワークフロー追加、Vitestベンチマーク設定、バリデーションベンチマーク追加、ロックファイルの更新など具体的な実装内容を適切に記述しています。
Linked Issues check ✅ Passed PR変更はリンク先の#162で指定された全ての要件を満たしており、CodSpeedワークフロー追加、Vitestベンチマーク作成、バリデーション関数のベンチマーク追加、GitHub Actions統合が適切に実装されています。
Out of Scope Changes check ✅ Passed PR内の全ての変更は#162の要件に直接関連しており、スコープ外の変更は認められません。ワークフロー設定、ベンチマーク構成、テストファイル、codecov設定の変更は全てCodSpeed導入という目的に沿っています。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📋 Issue Planner

Built with CodeRabbit's Coding Plans for faster development and fewer bugs.

View plan used: #162

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/issue-162-codspeed

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.

❤️ Share

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

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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!

このプルリクエストは、CodSpeedを導入することで、APIワークスペースにおけるパフォーマンスリグレッションを自動的に検出する基盤を構築します。これにより、コードの変更がパフォーマンスに与える影響を早期に把握し、最適化を維持することが可能になります。Vitestを用いたベンチマーク環境が整備され、主要なバリデーションロジックの性能が測定されるようになります。

Highlights

  • CodSpeedの導入: パフォーマンスリグレッション検出のためにCodSpeed GitHub Actionsワークフローを追加しました。
  • Vitestベンチマーク設定: APIワークスペース向けにVitestベンチマークスクリプトと専用のESMベンチマーク設定を追加しました。
  • 初期バリデーションベンチマーク: slug、name、descriptionバリデーターの初期検証ベンチマークを追加しました。
  • ロックファイルの更新: @codspeed/vitest-pluginのロックファイルを更新しました。
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/codspeed.yml
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 21, 2026

Congrats! CodSpeed is installed 🎉

🆕 12 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks


Open in CodSpeed

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a 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 introduces CodSpeed for performance regression detection, which is a valuable addition. The changes include adding the necessary dependencies, benchmark scripts, and an initial set of benchmarks for validation functions. My review focuses on improving the structure of the new benchmark tests to ensure they provide clear and granular metrics. Specifically, I've suggested replacing the 'batch' tests, which loop over multiple scenarios, with individual benchmarks for each distinct case. This will make performance regressions easier to pinpoint and understand.

Comment thread apps/api/src/utils/__tests__/validation.bench.ts Outdated
Comment thread apps/api/src/utils/__tests__/validation.bench.ts Outdated
Comment thread apps/api/src/utils/__tests__/validation.bench.ts Outdated
Comment thread apps/api/src/utils/__tests__/validation.bench.ts Outdated
Comment thread .github/workflows/codspeed.yml
Copy link
Copy Markdown
Contributor Author

@is0692vs is0692vs left a comment

Choose a reason for hiding this comment

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

(review thread follow-up in progress)

Comment thread .github/workflows/codspeed.yml
@is0692vs
Copy link
Copy Markdown
Contributor Author

メンテナ確認済みです。Botコメント(Codecov / CodeRabbit / Gemini / Jules / Greptile / Vercel)を確認し、現時点で追加対応が必要な指摘はありません。必要な追対応が出た場合はこのPRで反映します。

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 22, 2026

Deployment failed with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/hirokis-projects-afd618c7?upgradeToPro=build-rate-limit

is0692vs and others added 2 commits March 22, 2026 14:14
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: CodSpeed導入(パフォーマンスリグレッション検出)

1 participant