This repository was archived by the owner on Aug 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
docs: レビューフローの見直し(Draft先行 + CodeRabbit導入) #35
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
522d99d
docs: レビューフローの見直し(Draft先行 + CodeRabbit導入)
reitojike 4af910b
fix: CodeRabbitの初回レビュー指摘に対応
reitojike fe445e8
fix: CodeRabbit 2回目レビュー指摘を反映
reitojike 36212ed
fix: CodeRabbit 4回目レビュー指摘を反映(Claudeレビューのトークン条件を明記)
reitojike 4ef0ec8
fix: Claude 3回目レビュー指摘を反映(未検証事項の明記)
reitojike c68ebb4
fix: CodeRabbit 5回目レビュー指摘を反映(Planの食い違い・INSERT否定テスト観点)
reitojike 2ec236b
fix: Claude 4回目レビュー指摘を反映(RETURNING/USING句の自己矛盾を修正)
reitojike 509c11f
fix: Copilot初回レビュー指摘を反映 + auto_pauseの実地検証結果を反映
reitojike 40bf55d
fix: Claude 5回目レビュー指摘を反映(Copilot挙動の実地確認結果を記載)
reitojike 9447f05
fix: Copilot 2回目レビュー指摘を反映(dataのnullフォールバックがエラーを隠す)
reitojike a9c1811
fix: Copilot 3回目・Claude 6回目レビュー指摘を反映(error検証の一貫性)
reitojike File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| language: "ja-JP" | ||
|
|
||
| reviews: | ||
| profile: assertive | ||
| auto_review: | ||
| enabled: true | ||
| # デフォルトはdraft PRをスキップするが、このリポジトリはDraftで | ||
| # Claude/Codexと反復してからReady化する運用(CLAUDE.md「ブランチとPR」)。 | ||
| # CodeRabbitはCopilotと違いdraft中も含めて都度レビュー対象にする | ||
| # (実際に消費するのはFreeプランのレート制限: GitHub連携のPRレビューは | ||
| # 1回/時/開発者。1時間に複数pushしても2回目以降はスキップされうる。 | ||
| # 詳細: https://docs.coderabbit.ai/management/plans) | ||
| drafts: true | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| # 既定値5だと5コミット分レビューした時点で自動レビューが止まり、以降は | ||
| # `@coderabbitai review` の手動実行が必要になる。pushのたびに反復する | ||
| # 運用と相性が悪いため無効化する。PR #35で7コミット分pushした後に | ||
| # `@coderabbitai review` を手動実行したところ、応答は「Review rate limited」 | ||
| # であり、「レビューがpauseされているので手動実行が必要」という案内には | ||
| # ならなかった(pause中ならその旨のメッセージが返る仕様)。つまりauto_pauseの | ||
| # 5コミット上限には引っかかっていない = 0が意図通り無効化として機能している | ||
| # と判断できる。実際にpushのたびのレビューが止まった原因はレート制限であり、 | ||
| # auto_pauseとは別物(詳細はdocs/roadmap.md「CodeRabbitの導入」参照)。 | ||
| auto_pause_after_reviewed_commits: 0 | ||
|
reitojike marked this conversation as resolved.
|
||
| path_instructions: | ||
| - path: "**/*.{ts,tsx}" | ||
| instructions: | | ||
| CLAUDE.md の絶対ルールに違反していないか重点的に確認すること。 | ||
| - `as` によるキャスト、`any`、`@ts-ignore` / `@ts-expect-error` / `eslint-disable` による | ||
| エラーの黙殺がないか | ||
| - common/ に置くべき判断ロジック(フィルタ・並び順・検証・集計・権限判定・日付計算)が | ||
| app/ や mcp/ に複製・直書きされていないか | ||
| - 型を手書きせず、生成型(supabase/types.ts)かZodスキーマの z.infer から導出しているか | ||
| - path: "supabase/migrations/**" | ||
| instructions: | | ||
| docs/data-model.md・docs/permissions.md の権限マトリクスと突き合わせて確認すること。 | ||
| - RLSポリシー内の自己参照サブクエリ(同一テーブルを問い合わせるEXISTS等)は | ||
| 呼び出し元のRLS越しに評価され、本来見えるべき行が見えず誤判定することがある | ||
| (security definer関数でラップする必要がないか確認する) | ||
| - security definer関数を使う場合、`set search_path = ''`または安全な固定値を | ||
| 必須にし、内部の参照はスキーマ修飾名(`public.xxx`)にしているか。 | ||
| `PUBLIC`ロールへの不要なEXECUTE権限が残っていないか(必要なロールにのみGRANTする) | ||
| - path: "test/db/**" | ||
| instructions: | | ||
| docs/testing.md・docs/permissions.md「RLS検証の必須要件」に沿っているか確認すること。 | ||
| - service_roleキーを使っていないか | ||
| - 否定側のテストが、対象行を見られない側から実行した結果(RETURNINGやSELECTが空) | ||
| だけで判定していないか。`WHERE`不一致で0件なのか、RLSで正しく弾かれて0件なのかは | ||
| その視点からは区別できない。UPDATEは対象行を見られる側の視点で値が変化していない | ||
| ことを、DELETEは行が存在し続けていることを、INSERTは対象行を見られる側の視点で | ||
| 新しい行が作られていないことを、それぞれ確認しているか(service_roleは使わない) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,9 +49,31 @@ | |
| **mainへの直接pushは禁止。**必ずブランチを作成し、PRを経由してmainにマージする。 | ||
| mainはRulesetで保護されており、リポジトリ管理者(あなた)のみ緊急時にバイパスできる。 | ||
|
|
||
| - PRを作成すると、Claude(`claude-review.yml`)とCodex(`codex-review.yml`)による | ||
| 自動レビューが走る。シークレット未設定の間は自動でスキップされる | ||
| (`docs/roadmap.md`「保留: 外部アカウント待ち」) | ||
| **PRはまずDraftで作成する。** | ||
| Claude(`claude-review.yml`)は`CLAUDE_CODE_OAUTH_TOKEN`設定時にdraftのpushごとに走り、 | ||
| 未設定時はスキップする。Codexは`OPENAI_API_KEY`設定時(`codex-review.yml`)、CodeRabbitは | ||
| `drafts: true`(`.coderabbit.yaml`)でdraft中もレビュー対象になるが、CodeRabbitはFreeプランの | ||
| レート制限を受ける(下記参照)。 | ||
| GitHub Copilotの自動レビュー(`copilot_code_review` Ruleset)は | ||
| `review_draft_pull_requests: false`に設定済みのためdraft中は走らない。 | ||
|
reitojike marked this conversation as resolved.
|
||
| Draftで指摘がなくなるまで反復し、`gh pr ready`でReady for reviewに | ||
| 変えたタイミングでCopilotの最終レビューを1回受ける。Copilotは1レビューあたり | ||
| プレミアムリクエストを消費するため、Claude/Codex/CodeRabbitとの反復で消費しないように | ||
| するための運用(PR #18〜#32の実績分析に基づく判断)。 | ||
|
reitojike marked this conversation as resolved.
|
||
|
|
||
| - CodeRabbitのFreeプランはGitHub連携のPRレビューが1回/時/開発者に制限されている。 | ||
| Draftで短時間に何度もpushしても2回目以降はレート制限でスキップされうる | ||
| (`docs/roadmap.md`「保留: 外部アカウント待ち」参照)。反復の主力はClaude/Codexで、 | ||
| CodeRabbitは取れたときに追加の視点が入る、という位置づけで期待値を持つこと | ||
| (PR #35で実際にレート制限を確認済み。詳細は`docs/roadmap.md`「CodeRabbitの導入」参照) | ||
| - Copilotの最終レビューは「プレミアムリクエストのquota上限に達したため実行できなかった」 | ||
| という形で失敗することがある(PR #35で発生)。この場合レビューコメントは投稿されるが | ||
| 中身のないもので、コードは実際にはレビューされていない。quotaを追加してから | ||
| `gh api repos/{owner}/{repo}/pulls/{number}/requested_reviewers -X POST | ||
| -f 'reviewers[]=copilot-pull-request-reviewer[bot]'` で再リクエストする | ||
| - Ready化後にCopilot/CodeRabbitの指摘で追加修正が発生した場合は、都度pushしてよい | ||
| (Ready後はpushのたびに再レビューが走る。ただしCodeRabbitは上記レート制限の対象) | ||
|
Comment on lines
+74
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 妥当なnitpick: このDraft先行フローの狙いは「Claude/Codex/CodeRabbitとの反復ではプレミアムリクエストを消費せず、Copilotの最終レビューだけ1回受ける」ことのはず(52-62行目)。しかしこの箇条書きは「Ready化後の追加修正は都度pushしてよい」としており、Ready後の再push1回ごとにCopilotのレビューが再度走ってプレミアムリクエストを消費する(すぐ上の行が明記している通り)。指摘が多く複数回の追加pushが必要になった場合、このPR自体がまさにその状態(Ready化後もレビュー往復が発生)であり、結局Copilotのクレジットを何度も消費してしまう可能性がある。「Ready後に指摘が複数回にわたりそうな場合はDraftに戻す」のような回避策や、そもそも許容している旨を一言添えておくと、この運用が解決しようとしている問題(Copilotのクレジット消費)を自ら再現してしまう抜けを塞げる。 |
||
| - シークレット未設定の間、Codexは自動でスキップされる(`docs/roadmap.md`「保留: 外部アカウント待ち」) | ||
| - 人間の承認レビューは必須にしていない(現状は開発者本人のみのため。GitHubは | ||
| PR作成者自身の承認をカウントしない)。マージの実行自体が「人間の確認」に当たる | ||
| (`docs/prd.md` 8.5) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.