Skip to content

Conversation

@mafreud
Copy link
Contributor

@mafreud mafreud commented Oct 11, 2025

Summary by CodeRabbit

  • 新機能
    • なし(ユーザー向け挙動の変更はありません)
  • テスト
    • テスト実行をVitestに統一し、コードカバレッジ計測を有効化
    • カバレッジ結果をCodecovへ自動アップロード
  • 雑務
    • テスト関連ツールのバージョン更新とカバレッジ用プラグインを追加
    • ワークスペースのスペル辞書を更新(用語を追加)
  • デプロイ
    • 手順は維持(実行順のみ整理)

@linear
Copy link

linear bot commented Oct 11, 2025

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 11, 2025

Walkthrough

CI workflow now runs Vitest with coverage and uploads results to Codecov. Firebase Functions package adds coverage plugin and bumps Vitest. Workspace dictionary updated to include “vitest”. Deployment step remains functionally unchanged.

Changes

Cohort / File(s) Summary
CI workflow: Vitest + coverage, Codecov upload
.github/workflows/reusable-deploy-firebase-functions.yml
Switch test command to npx vitest run --coverage; add Codecov upload step using codecov-action@v5 with token; deploy step order adjusted without command changes.
Firebase Functions dev deps
openci-runner/firebase/functions/package.json
Add @vitest/coverage-v8 as devDependency; bump vitest from ^1.6.0 to ^1.6.1.
Workspace settings (cSpell)
openci.code-workspace
Add “vitest” to cSpell.words; minor list formatting adjustment (trailing comma).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions
  participant Test as Vitest
  participant CC as Codecov
  participant Firebase as Firebase Deploy

  Dev->>GH: Push/PR triggers reusable workflow
  GH->>Test: Run npx vitest run --coverage
  alt Tests pass
    GH->>CC: Upload coverage reports (codecov-action@v5)
    GH->>Firebase: Run deploy step
  else Tests fail
    GH-->>Dev: Report failure (no deploy, no upload)
  end

  %% Styling hints (labels used alongside color)
  rect rgba(200,230,255,0.2)
    Note over GH,Test: New/changed: Vitest with coverage
  end
  rect rgba(220,255,220,0.2)
    Note over GH,CC: New: Codecov upload step
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

ぽんぽん跳ねて CI を見る
テストはヴィテスト、耳もピン
カバレッジ包み、雲へと送る
コードコブさん、受け取りぴょん
デプロイ前に、にんじんチェック
緑の草原、ビルドも安泰 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed タイトルはCodecovの追加とテストカバレッジ計測の導入という変更セットの主要な側面を端的に示しており、具体性と簡潔さを両立しています。
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch op-315

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

@mafreud mafreud changed the title feat: update testing framework to use Vitest and add Codecov integration Codecovを追加 Oct 11, 2025
@mafreud mafreud changed the title Codecovを追加 Codecovを追加し、テストカバレッジを計測できるように変更 Oct 11, 2025
Copy link
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: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fc12e85 and f1f2857.

⛔ Files ignored due to path filters (1)
  • openci-runner/firebase/functions/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • .github/workflows/reusable-deploy-firebase-functions.yml (1 hunks)
  • openci-runner/firebase/functions/package.json (1 hunks)
  • openci.code-workspace (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/reusable-deploy-firebase-functions.yml

38-38: property "codecov_token" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; firebase_project_id: string; gha_service_account: string; github_token: string}

(expression)

🔇 Additional comments (3)
openci.code-workspace (1)

77-78: LGTM!

スペルチェッカーの辞書に"vitest"を追加し、"validkey"にトレーリングカンマを付けることで、今後のメンテナンスが容易になります。Vitestテストフレームワークの導入と整合性が取れています。

openci-runner/firebase/functions/package.json (2)

27-27: LGTM!

カバレッジプラグイン @vitest/coverage-v8 の追加により、CI環境でのコードカバレッジ測定が可能になります。バージョン ^1.6.1 は、更新された vitest のバージョンと一致しており、適切です。


32-32: LGTM!

Vitestのバージョンを ^1.6.0 から ^1.6.1 へ更新することで、カバレッジプラグインとの互換性が保証されます。パッチバージョンのアップデートなので、破壊的変更のリスクは最小限です。

Comment on lines 32 to +33
- name: Test
run: npm test
run: npx vitest run --coverage
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

カバレッジ設定の確認を推奨します

Vitestカバレッジコマンドは正しく実装されていますが、vitest.config.tsまたはvitest.config.jsファイルでカバレッジ設定(カバレッジプロバイダー、対象ディレクトリ、除外パターンなど)が適切に定義されているか確認してください。

以下のスクリプトを実行してVitest設定ファイルの存在を確認してください:


🏁 Script executed:

#!/bin/bash
# Description: Vitest設定ファイルとカバレッジ設定の確認

# Vitest設定ファイルの検索
fd -t f 'vitest.config\.(ts|js|mts|mjs)' openci-runner/firebase/functions

# 設定ファイルが見つかった場合、カバレッジ設定を確認
if fd -t f 'vitest.config\.(ts|js|mts|mjs)' openci-runner/firebase/functions | grep -q .; then
  echo "=== Vitest設定ファイルの内容 ==="
  fd -t f 'vitest.config\.(ts|js|mts|mjs)' openci-runner/firebase/functions --exec cat {}
fi

Length of output: 0


🏁 Script executed:

#!/bin/bash
# リポジトリ全体で Vitest 設定ファイルを検索
fd -t f 'vitest.config\.(ts|js|mts|mjs)' .

# ファイルが見つかった場合、その内容を表示
if fd -t f 'vitest.config\.(ts|js|mts|mjs)' . | grep -q .; then
  echo "=== Vitest設定ファイルの内容 ==="
  fd -t f 'vitest.config\.(ts|js|mts|mjs)' . --exec cat {}
else
  echo "Vitest設定ファイルが見つかりませんでした。"
  echo "カバレッジ設定キーワードを検索します:"
  rg -n 'coverage' --glob='*.config.*'
fi

Length of output: 193


Vitest設定ファイルの追加とカバレッジ設定の明示化 プロジェクトルートにvitest.config.ts(または.js)を作成し、coverage.provider、include、excludeなどのカバレッジ設定を定義してください。

🤖 Prompt for AI Agents
.github/workflows/reusable-deploy-firebase-functions.yml around lines 32-33: the
workflow calls "npx vitest run --coverage" but the project lacks a vitest.config
file specifying coverage options; create a vitest.config.ts (or .js) at the repo
root and export configuration that explicitly sets coverage.provider (e.g., 'c8'
or 'v8'), coverage.include (globs for source files to measure), coverage.exclude
(tests, mocks, build outputs), and any thresholds or reporter settings required
by CI, then commit that config so the workflow's --coverage run uses the defined
settings.

Comment on lines +35 to +38
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

CODECOV_TOKENシークレットの宣言が不足しています

ワークフローでは secrets.CODECOV_TOKEN を参照していますが、ファイル冒頭の workflow_call.secrets セクション(3-7行目)で宣言されていません。これによりワークフローの実行が失敗するか、カバレッジのアップロードが機能しません。

次のdiffを適用してシークレット宣言を追加してください:

 on:
   workflow_call:
     secrets:
       gha_service_account:
         required: true
       firebase_project_id:
         required: true
+      codecov_token:
+        required: true
📝 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.

Suggested change
- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
on:
workflow_call:
secrets:
gha_service_account:
required: true
firebase_project_id:
required: true
codecov_token:
required: true
🧰 Tools
🪛 actionlint (1.7.7)

38-38: property "codecov_token" is not defined in object type {actions_runner_debug: string; actions_step_debug: string; firebase_project_id: string; gha_service_account: string; github_token: string}

(expression)

🤖 Prompt for AI Agents
.github/workflows/reusable-deploy-firebase-functions.yml lines ~3-7: the
workflow references secrets.CODECOV_TOKEN later but that secret is not declared
in the workflow_call.secrets block at the top; update the workflow_call.secrets
section to include CODECOV_TOKEN (mark as required) so the secret is exposed to
callers and available when the Codecov upload step runs.

@mafreud mafreud merged commit b9ac141 into develop Oct 11, 2025
4 checks passed
@mafreud mafreud deleted the op-315 branch October 11, 2025 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants