refactor(ci): test と deploy を再利用可能ワークフローへ分離#418
Conversation
ci.yml に同居していたテスト/品質ゲートとデプロイを workflow_call の 再利用可能ワークフローへ切り出し、責務を分離する。 - test.yml: test-web/e2e/backend/codegen-drift/smoke-backend/ detect-duplication を集約。deploy-gate ジョブが test-web/test-backend/codegen-drift の結果のみを集約し deploy_gate 出力として公開(e2e/smoke は従来通りゲート対象外) - deploy.yml: deploy-web/deploy-backend を environment で パラメータ化し、dev/stg/prod の 6 ジョブ相当を 1 定義へ集約。 env 差分は呼び出し側 (ci.yml) で解決して inputs/secrets で渡す - ci.yml: detect-changes + tests/deploy の呼び出しのみに縮小。 app filter に test.yml/deploy.yml を追加 デプロイのゲート条件は現行と等価。action の SHA pin は踏襲。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 48 minutes and 5 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughCI now delegates validation and deployments to reusable workflows. The new test workflow runs duplication, web, backend, codegen, and smoke checks, and publishes a deploy gate. The new deploy workflow handles web and backend deployments for the target environments. ChangesReusable CI workflow delegation
Sequence Diagram(s)sequenceDiagram
participant "ci.yml" as CI
participant "test.yml" as Tests
participant "deploy.yml" as Deploy
CI->>Tests: workflow_call(app, dupe)
Tests-->>CI: deploy_gate
CI->>Deploy: deploy-dev on dev when deploy_gate == pass
CI->>Deploy: deploy-stg on stg when deploy_gate == pass
CI->>Deploy: deploy-prod on main when deploy_gate == pass
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
@coderabbitai RVして |
|
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/test.yml (1)
34-37: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winDisable persisted checkout credentials in the remaining read-only test jobs.
Add
persist-credentials: falseto the checkout steps indetect-duplication,test-web,test-e2e, andtest-backend(.github/workflows/test.yml:34-37, 63-64, 99-100, 140-141).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/test.yml around lines 34 - 37, The remaining read-only test jobs still use checkout with persisted credentials, so update each Checkout step in detect-duplication, test-web, test-e2e, and test-backend to set persist-credentials to false. Apply this consistently in the workflow’s actions/checkout usages so these jobs do not retain GitHub credentials during test execution.Source: Linters/SAST tools
.github/workflows/deploy.yml (1)
55-58: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winDisable checkout credential persistence in both deploy jobs.
Neither job pushes back to git, so
actions/checkoutshould not leave credentials on disk. Addpersist-credentials: falseto both checkout steps.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/deploy.yml around lines 55 - 58, The Checkout step in both deploy jobs still leaves git credentials on disk even though neither job pushes changes. Update the actions/checkout usage in each deploy job to explicitly set persist-credentials to false, keeping the change localized to the Checkout step so both job definitions are covered.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/deploy.yml:
- Around line 55-58: The Checkout step in both deploy jobs still leaves git
credentials on disk even though neither job pushes changes. Update the
actions/checkout usage in each deploy job to explicitly set persist-credentials
to false, keeping the change localized to the Checkout step so both job
definitions are covered.
In @.github/workflows/test.yml:
- Around line 34-37: The remaining read-only test jobs still use checkout with
persisted credentials, so update each Checkout step in detect-duplication,
test-web, test-e2e, and test-backend to set persist-credentials to false. Apply
this consistently in the workflow’s actions/checkout usages so these jobs do not
retain GitHub credentials during test execution.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 69a32580-b73e-41dc-a53f-2be56eb91d6f
📒 Files selected for processing (3)
.github/workflows/ci.yml.github/workflows/deploy.yml.github/workflows/test.yml
…CodeRabbit 指摘) test.yml の detect-duplication/test-web/test-e2e/test-backend と deploy.yml の deploy-web/deploy-backend は git へ push しないため、 checkout の認証情報をディスクに残さない(サプライチェーン保護)。 同ファイル内の codegen-drift/smoke-backend と挙動を揃える。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
概要
.github/workflows/ci.ymlに同居していた テスト/品質ゲート と デプロイ を、workflow_callの再利用可能ワークフローへ分離する。デプロイ 6 ジョブ(web/backend × dev/stg/prod)の重複も environment パラメータ化で解消する。変更内容
ci.ymldetect-changes+tests/deploy-*の呼び出しのみ)。約 660 行 → 約 175 行test.yml(新規)workflow_call。test-web/test-e2e/test-backend/codegen-drift/smoke-backend/detect-duplicationを集約。deploy-gateジョブがdeploy_gate出力を公開deploy.yml(新規)workflow_call。deploy-web/deploy-backendを environment でパラメータ化(dev/stg/prod の 6 ジョブ相当を 1 定義 × 3 呼び出しへ集約)設計上のポイント
test.ymlのdeploy-gateジョブがtest-web/test-backend/codegen-driftの結果のみ(success または skipped)を集約してdeploy_gate=pass/failを出力する。test-e2e/smoke-backendは従来通りゲート対象外(フレーキーな e2e が deploy をブロックしないため)。if: always() && … && needs.tests.outputs.deploy_gate == 'pass'。always()は tests 内のフレーキージョブで result が success にならなくても gate 出力で判定するため。vars/secretsのフォールバック)は ci.yml の呼び出し側で解決し、deploy.ymlは env 非依存に保つ。detect-changesのappfilter にtest.yml/deploy.ymlを追加。再利用可能ワークフロー化により status check 名が
tests / test-backendのようにネストする。ブランチ保護の required status checks を設定している場合は、名称の更新が必要。検証
actionlint: 再利用ワークフローの配線(inputs/secrets/outputs/uses: ./)に構造エラーなし。残る指摘は元 ci.yml から移設したコード由来の既存 shellcheck 警告(CI 非対象)。.github/workflows/のみで app コードに影響しないためmake ciは対象外。🤖 Generated with Claude Code
Summary by CodeRabbit