Skip to content

feat(ci): add backend codecov workflow - #278

Merged
MasanoriSuda merged 2 commits into
developfrom
codex/277-backend-codecov
Mar 9, 2026
Merged

MasanoriSuda merged 2 commits into
developfrom
codex/277-backend-codecov

Conversation

@MasanoriSuda

@MasanoriSuda MasanoriSuda commented Mar 9, 2026 •

Copy link
Copy Markdown
Owner

Refs #277

Instruction by: @MasanoriSuda

Generated by: Codex

Summary by CodeRabbit

リリースノート

  • チョア
    • バックエンド向けのコードカバレッジ自動収集ワークフローを追加しました。プッシュやプルリクエスト時にカバレッジを生成して集計し、外部カバレッジサービスへ条件付きでアップロードします。CIでのカバレッジ監視を強化し、品質レポートの継続的な出力を実現します。

Refs #277

Instruction by: @MasanoriSuda

Generated by: Codex
@coderabbitai

coderabbitai Bot commented Mar 9, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 294ab665-af95-4618-85cd-09373e223350

📥 Commits

Reviewing files that changed from the base of the PR and between 58c2bf2 and 6411909.

📒 Files selected for processing (1)
  • .github/workflows/backend-coverage.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/backend-coverage.yml

📝 Walkthrough

Walkthrough

バックエンド用のRustカバレッジを生成する新しいGitHub Actionsワークフロー(.github/workflows/backend-coverage.yml)を追加します。トリガーは main または develop へのプッシュ(ワークフローまたは backend ディレクトリに影響する変更時)と、backend に関連するプルリクエストです。カバレッジは cargo-llvm-cov で生成し、条件付きでCodecovへアップロードします。

Changes

Cohort / File(s) Summary
Backend Coverage Workflow
.github/workflows/backend-coverage.yml
新しいGitHub Actionsワークフローを追加。リポジトリチェックアウト、Rustツールチェーン(llvm-tools-preview)導入、Cargo/targetキャッシュ、cargo-llvm-cov インストール、ワークスペース全体でのカバレッジ生成(lcov.info 出力)、および条件付きCodecovアップロード(CODECOV_TOKEN 使用)を定義。

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer
  participant GH as GitHub Actions
  participant Runner as Runner/VM
  participant Tool as Rust Toolchain & cargo-llvm-cov
  participant Codecov as Codecov

  Dev->>GH: push / open PR (changes in backend or workflow)
  GH->>Runner: start workflow
  Runner->>Tool: install Rust + llvm-tools-preview
  Runner->>Tool: install cargo-llvm-cov
  Runner->>Tool: run cargo llvm-cov -> produce lcov.info
  Runner->>Codecov: upload lcov.info (if conditions & token present)
  Codecov-->>GH: upload result/status
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 新しきワークフロー跳ねて、
バックエンドに光を当てる、
Rustの足跡を辿りつつ、
lcovは歌を紡ぎ出し、
小さな森にカバレッジの花咲く

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR タイトルは「feat(ci): add backend codecov workflow」であり、変更内容のメインポイント(バックエンド用の Codecov ワークフロー追加)を正確かつ簡潔に要約しています。
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.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/277-backend-codecov

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.

@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
.github/workflows/backend-coverage.yml (2)

3-15: 同じ backend 変更でフルテストが二重実行されています。

.github/workflows/ci.yml:1-46 でも同じ push 条件で cargo test --all --all-features を実行していて、cargo llvm-cov も内部でテストを走らせます。backend 変更のたびに同等のテストが 2 回走るので、PR 待ち時間と Actions コストがかなり増えます。coverage を毎回必須にしないなら、main / develop への push のみに絞るか workflow_dispatch に逃がす方が軽いです。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/backend-coverage.yml around lines 3 - 15, The backend
coverage workflow is causing duplicate full test runs because
.github/workflows/backend-coverage.yml triggers on: push with branches: - main -
develop - feature/** (and on pull_request) while .github/workflows/ci.yml
already runs cargo test (and cargo llvm-cov runs tests too); fix by narrowing
the backend-coverage.yml triggers — e.g., remove feature/** from
on.push.branches and only keep main and develop, or replace the push trigger
with workflow_dispatch (manual) and adjust pull_request accordingly — update the
on: push / branches and/or add workflow_dispatch entries in backend-coverage.yml
so full tests aren’t run twice (reference: on: push, branches: - main - develop
- feature/**, pull_request, cargo llvm-cov, .github/workflows/ci.yml).

30-30: 外部 Action をコミット SHA に固定する

GitHub Actions の参照を version tag (@v4、@stable など) からコミット SHA に変更してください。上流リポジトリのタグ差し替えや想定外の更新により、意図しないコードが実行される security risk を防ぐため、SHA pinning は best practice です。

該当箇所: 30行目 (actions/checkout@v4)、33行目 (dtolnay/rust-toolchain@stable)、38行目 (actions/cache@v4)、53行目 (taiki-e/install-action@cargo-llvm-cov)、60行目 (codecov/codecov-action@v5)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/backend-coverage.yml at line 30, Replace the external
GitHub Action version tags with pinned commit SHAs for each referenced action to
prevent supply-chain changes: update usages of actions/checkout@v4,
dtolnay/rust-toolchain@stable, actions/cache@v4,
taiki-e/install-action@cargo-llvm-cov, and codecov/codecov-action@v5 to the
corresponding full commit SHA values in the workflow file; ensure you fetch the
canonical commit SHAs from each action's upstream repository and replace the tag
references with the SHA strings (keeping the same owner/repo names) so the
workflow runs a fixed commit.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/backend-coverage.yml:
- Around line 3-15: The backend coverage workflow is causing duplicate full test
runs because .github/workflows/backend-coverage.yml triggers on: push with
branches: - main - develop - feature/** (and on pull_request) while
.github/workflows/ci.yml already runs cargo test (and cargo llvm-cov runs tests
too); fix by narrowing the backend-coverage.yml triggers — e.g., remove
feature/** from on.push.branches and only keep main and develop, or replace the
push trigger with workflow_dispatch (manual) and adjust pull_request accordingly
— update the on: push / branches and/or add workflow_dispatch entries in
backend-coverage.yml so full tests aren’t run twice (reference: on: push,
branches: - main - develop - feature/**, pull_request, cargo llvm-cov,
.github/workflows/ci.yml).
- Line 30: Replace the external GitHub Action version tags with pinned commit
SHAs for each referenced action to prevent supply-chain changes: update usages
of actions/checkout@v4, dtolnay/rust-toolchain@stable, actions/cache@v4,
taiki-e/install-action@cargo-llvm-cov, and codecov/codecov-action@v5 to the
corresponding full commit SHA values in the workflow file; ensure you fetch the
canonical commit SHAs from each action's upstream repository and replace the tag
references with the SHA strings (keeping the same owner/repo names) so the
workflow runs a fixed commit.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 102c40da-631b-4fcf-ae18-0d5555cfe892

📥 Commits

Reviewing files that changed from the base of the PR and between aa748bb and 58c2bf2.

📒 Files selected for processing (1)
  • .github/workflows/backend-coverage.yml

@MasanoriSuda
MasanoriSuda merged commit f5ce292 into develop Mar 9, 2026
3 checks passed
@MasanoriSuda
MasanoriSuda deleted the codex/277-backend-codecov branch March 9, 2026 14:11
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