Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/reusable-deploy-firebase-functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ jobs:
run: npm run build

- name: Test
run: npm test
run: npx vitest run --coverage
Comment on lines 32 to +33
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.


- name: Upload results to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
Comment on lines +35 to +38
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.


- name: Deploy Functions
working-directory: openci-runner/firebase
Expand Down
123 changes: 87 additions & 36 deletions openci-runner/firebase/functions/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion openci-runner/firebase/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
},
"devDependencies": {
"@types/supertest": "^6.0.3",
"@vitest/coverage-v8": "^1.6.1",
"firebase-functions-test": "^3.1.0",
"smee-client": "^4.3.1",
"supertest": "^7.0.0",
"typescript": "^4.9.0",
"vitest": "^1.6.0"
"vitest": "^1.6.1"
},
"private": true,
"type": "module"
Expand Down
3 changes: 2 additions & 1 deletion openci.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
"urandom",
"utoipa",
"vadimcn",
"validkey"
"validkey",
"vitest"
],
"[dockerfile]": {
"editor.defaultFormatter": "ms-azuretools.vscode-containers"
Expand Down