Repository navigation
ci: 品質ゲートを reusable workflow に分け、入口をトリガーごとにする - #34
Merged
Merged
Conversation
ci.yml は品質ゲート・Preview・本番デプロイを 1 つに抱え、イベントによる if の分岐と、式で切り替える cancel-in-progress を持っていた。 - quality.yml(workflow_call): 元の ci ジョブをそのまま移す。concurrency は呼び出し元に任せる - pull-request.yml: quality → preview。PR ごとに cancel-in-progress - main.yml: quality → deploy。cancel-in-progress しない preview と deploy は呼び出し元に直接書くので、environment の secret と デプロイ先の制限の効き方は変わらない。同じ run の中で artifact を渡し、 ゲートを通ったビルドだけを配信する点も変わらない。 必須チェックの名前は「Quality / Lint, build, and quality gates」になる。 Refs #31
kryota-dev
commented
Oct 14, 2026
kryota-dev
left a comment
Owner
Author
There was a problem hiding this comment.
Multi-Review 統合レビュー結果
総合評価
| カテゴリ | general(Codex, xhigh) | security(subagent) |
|---|---|---|
| MUST | 0 | 0 |
| SHOULD | 0 | 2 |
| NITS | 0 | 3 |
| GOOD | 5 | 7 |
specialist は立てていない(変更は YAML・Markdown・JSONC だけで、条件に当たるものが無い)。
セキュリティ
- 総合リスクレベル: Low / 悪用できる新しい経路: 0 件
- ジョブの中身は旧
ci.ymlから機械的に移されている。違いはneeds、ifのイベント判定の削除、ジョブ id(ci→gates)、コメントだけ。permissions・secret の届き先・fork の除外・artifact の受け渡しは旧版と同じ - SHOULD の 2 件は、どちらもマージする瞬間の運用手順の話で、悪用経路ではない
[SHOULD]
.github/workflows/main.yml:12(security): concurrency のグループがci-refs/heads/mainからmainに変わる。この PR のマージで起きる push の時点で、旧CIの run が main で走っていると、2 つのwrangler deployが直列化されない。古いほうが後に終わると、古い版が本番に残る。起きうるのは移行の 1 回だけ。対策: マージの前に、main で走っているCIの run が無いことを確かめるdocs/deployment.md:37-39(security。訂正して採用): ruleset の必須チェックを、「旧名を外す」と「新名を足す」の 2 回に分けて変え、外すほうを先にすると、必須チェックが無い時間ができる。訂正: 元の指摘は「新名を足してから旧名を外す」順を勧めていた。しかし、ruleset の更新 API で必須チェックの一覧を 1 回で置き換えれば、その時間はそもそもできない。ソースの指定(GitHub Actions の app)も引き継ぐ。新名のチェックは、この PR ですでに通っている
[NITS]
.github/workflows/main.yml:12(security): グループ名mainは、リポジトリ全体で共有される名前としては汎用的すぎる。production-deployなどの、用途の分かる名前がよい.github/workflows/main.yml(security): deploy からブランチのifを外したが、トリガーはpush: branches: [main]だけで、workflow_dispatchも無い。productionenvironment も main からしか使えないので、今は悪用できない。将来トリガーを足すときに見直せばよいdocs/deployment.md:39(security・既存): 同じリポジトリのブランチから、Quality / Lint, build, and quality gatesという名前で成功するだけの workflow を足せば、必須チェックを満たせる。これは旧名でも同じで、移行で増えたリスクではない。共同作業者を増やすときは、CODEOWNERS で.github/の変更をレビュー必須にすることを検討する
[GOOD]
.github/workflows/quality.yml: steps は旧版と一致し、artifact の名前・対象・保持期間と、失敗時のレポートの収集も保たれている(general / security)pull-request.yml:17・main.yml:18: quality の呼び出しにsecretsもsecrets: inheritも無いので、品質ゲート(install スクリプトが動くジョブ)には secret が届かない。permissions もcontents: readのまま(security)pull-request.yml:23:pull_requestだけをトリガーにしたので、イベント判定を外しても意味は変わらない。fork の除外は残っている(general / security)- concurrency: PR は run 全体を取り消し、main は取り消さないという範囲が保たれている。Preview の作成と削除の共有グループも変わらない。
quality.ymlに concurrency を書かないのは、公式の注意書きどおり(general / security) - 文書と実装は一致し、追跡ファイルに
ci.ymlへの参照は残っていない(general / security) - spec との整合: AC-001〜005・007 は実装済み。AC-006(ruleset)は、マージ直前の作業として計画どおり残っている(general / security)
事実検証で棄却した指摘
なし(ruleset の切り替え順の指摘は、訂正して採用した)。
既存指摘との重複
既存のレビューと行コメントは無い(github-actions の Preview URL のコメントだけ)。除外は 0 件。
グループはリポジトリ全体で共有されるので、main ではなく production-deploy にする。ruleset の必須チェックは、一覧を 1 回の更新で 置き換えないと、必須チェックが無い時間ができることを文書に書く。 Refs #31
Owner
Author
|
review body にだけある指摘への対応です。
|
This branch was successfully deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
概要
ci.ymlが抱えていた品質ゲート・Preview・本番デプロイを、品質ゲートの reusable workflow(quality.yml)と、トリガーごとの入口(pull-request.yml/main.yml)に分ける。イベントによるifの分岐と、式で切り替えるcancel-in-progressが無くなる。設計は #29 の方針どおり。意図と範囲は #31 の起票時に合意したので、着手前の確認は省いた。
closes #31
closes #29
変更内容
quality.yml(workflow_call): 元のciジョブをそのまま移した(ジョブ名Lint, build, and quality gatesも同じ)。concurrency は書かない(呼び出し元と同じグループにすると、呼び出し元を取り消してしまう)pull-request.yml: quality →preview。PR 番号ごとのグループでcancel-in-progress: truemain.yml: quality →deploy。cancel-in-progress: falsepreviewとdeployは、ifのイベント判定とneeds以外は元と同じ。environment は呼び出し元のジョブに付いたままなので、secret とデプロイ先の制限の効き方は変わらないci.ymlを消したpreview-cleanup.yml・wrangler.jsoncのコメントと、AGENTS.md・docs/deployment.md を新しい構成に合わせた。docs/deployment.md には必須チェックの項を足した必須チェックの切り替え(マージの直前)
reusable workflow のジョブのチェック名は「呼び出し元のジョブ名 / 呼ばれた側のジョブ名」になる。この PR では旧名の
Lint, build, and quality gatesが報告されないので、ruleset を切り替えるまでマージできない。新しい名前が報告されるのを確かめてから、マージの直前に ruleset「main protection」の必須チェックを置き換える。確認したこと
pnpm lint/pnpm format:checkが通る(ローカル)ifのイベント判定とneeds)以外は元と同じ(YAML を読み込んで比較)Quality / Lint, build, and quality gatesの名前で報告され、通る手動の a11y チェック(画面に影響する変更のとき)
画面に影響しないので該当しない(ワークフローと文書だけの変更)。
関連