chore(security): 🔒 Codeball による PR承認 強化 - #487
Conversation
Co-authored-by: genzouw <29957+genzouw@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Review limit reached
Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?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 reviews. How do review 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 refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughGitHub Actions に Codeball Approver のワークフローを追加しました。プルリクエストの作成、更新、再オープン時に実行します。権限、ラベル、承認設定を定義し、設定内容をセキュリティ文書に追加しました。 ChangesCodeball 自動承認
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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 |
PR Summary by QodoCodeballでPR自動レビュー/承認するGitHub Actionsを追加
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
34 rules 1.
|
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 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.
Inline comments:
In @.github/workflows/ai-codeball-approver.yml:
- Around line 11-13: Update the top-level permissions in the workflow to include
only contents: read, and move pull-requests: write from the workflow level into
the codeball job’s permissions block. Preserve the existing codeball job
behavior while ensuring the workflow satisfies the permissions audit.
- Around line 11-13: Update the workflow permissions block to add issues: write
alongside the existing contents: read and pull-requests: write permissions,
enabling label creation, application, and removal when
labelPullRequestsWhenApproved is enabled.
- Line 16: Update the composite action referenced by the workflow’s
sturdy-dev/codeball-action@... entry so its baller, status, labeler, approver,
and suggester action references use immutable 40-character commit SHAs instead
of the mutable v2 tags. Preserve each action’s existing behavior and ensure all
internal Codeball references are pinned within the same supply chain.
- Line 16: Update the Codeball action reference in the workflow from the pinned
v2.6.0 SHA to a release or fork that supports the Node 20 runtime, and update
the adjacent version comment to match the new reference.
- Around line 17-21:
明示されていないlabelPullRequestsWhenCarefulReviewNeededの設定を、既存のCodeball入力設定の近くに追加してください。低信頼PRへcodeball:needs-careful-reviewラベルを付与しない意図なら値を"false"にし、付与する場合は意図した値を明示して、デフォルト値に依存しないようにしてください。
In `@docs/security/ai-ci-tools.md`:
- Line 124: Update the workflow description in ai-codeball-approver.yml
documentation to say the AI review and automatic approval run when a pull
request is created, updated, or reopened, replacing the narrower “when created”
wording while preserving the rest of the description.
- Around line 124-127: Update the GitHub Secrets section in the Codeball
documentation to state that GitHub Actions must enable “Allow GitHub Actions to
Create and Approve Pull Requests” for
`.github/workflows/ai-codeball-approver.yml` to use `pull-requests: write` for
approvals and labels, and note that fork pull requests may lack GITHUB_TOKEN
write permissions and therefore cannot be approved or labeled.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 223c106d-8373-45d1-b68e-98e955697bb4
📒 Files selected for processing (2)
.github/workflows/ai-codeball-approver.ymldocs/security/ai-ci-tools.md
.github/workflows/ai-codeball-approver.yml にトップレベルの permissions が 無く、permissions-audit.yml の全ワークフロー監査(^permissions: の存在チェッ ク)に失敗しmainへのマージがブロックされるため、トップレベルに `permissions: contents: read` を追加。 また labelPullRequestsWhenApproved を有効化しているため、Codeball が ラベル(codeball:approved 等)を作成・付与・削除する際に issues: write 権限が必要となるため、ジョブレベルのpermissionsに追加。 レビューコメント: #487 (comment), #487 (comment) レビュアー: qodo-code-review, coderabbitai 優先度: critical
Codeball Approver は paths-ignore が無く全PRで動作するため、 .github/workflows/** を変更するPR(本ワークフロー自身の変更を含む)も 自動でApproveされ得た。既存の ai-pr-reviewer.yml 等はCI/セキュリティ設定 変更を人的レビュー必須として .github/workflows/** を明示的に除外している ため、同じ設計方針に合わせて paths-ignore を追加。 レビューコメント: #487 (comment) レビュアー: qodo-code-review 優先度: high
labelPullRequestsWhenReviewNeeded / failJobsWhenReviewNeeded が両方 false のため、Codeball が「要レビュー」と判定してもPR上に何の痕跡も 残らず、承認されなかった理由(要レビューなのか未実行/失敗なのか)が 判別できなかった。CIをブロックはせずラベルのみで可視化する方針とし、 labelPullRequestsWhenReviewNeeded を true に変更。 また labelPullRequestsWhenCarefulReviewNeeded も未指定でデフォルト値 (true) に依存していたため、意図を明示するため明示的に true を設定。 レビューコメント: #487 (comment), #487 (comment) レビュアー: qodo-code-review, coderabbitai 優先度: medium
「PR作成時」という記載は、実際のワークフロー(.github/workflows/ai-codeball-approver.yml) が opened に加えて synchronize / reopened でも実行される挙動を反映していな かった。PR更新(コミット追加)時にも再度Approve判定が走ることが伝わるよ う「PRの作成・更新・再オープン時」に修正。 レビューコメント: #487 (comment), #487 (comment) レビュアー: qodo-code-review, coderabbitai 優先度: low
Codeball Approver は pull-requests: write / issues: write で承認とラベル 付与を行うが、リポジトリ側で「Allow GitHub Actions to create and approve pull requests」が有効化されていないと動作しないこと、および fork PR では GITHUB_TOKEN に書き込み権限が付与されないため自動承認・ラベル付与が行われ ない場合があることがドキュメントに記載されていなかったため追記。 レビューコメント: #487 (comment) レビュアー: coderabbitai 優先度: medium
概要
OSS向けの無料AIコードレビューツールである Codeball (
sturdy-dev/codeball-action) を導入し、PR作成時にAIがコードをレビューし、安全な変更と判断された場合に自動で承認(Approve)を行うよう設定を追加しました。💡 What
.github/workflows/ai-codeball-approver.ymlの新規作成docs/security/ai-ci-tools.mdに手動設定および導入背景のドキュメント追記🎯 Why
AIツール・CI/CD連携に関する手動セットアップ(必要な場合のみ)
GITHUB_TOKENを使用して動作します)PR created automatically by Jules for task 3102428679333915619 started by @genzouw
Summary by CodeRabbit
新機能
ドキュメント