feat(vrt): select Argos screenshots from baseline diff - #455
Open
sousuke0422 wants to merge 6 commits into
Open
Conversation
Assisted-by: multi-agent-shogun-aki-tweak
Resolve Argos eligible baselines before capture, classify FULL/PARTIAL/NONE through a provider-neutral graph selector, fail closed on uncertain coverage, and gate uploads on exact execution evidence. Part of #449 Assisted-by: multi-agent-shogun-aki-tweak
Coverage Report for apps/frontend
File CoverageNo changed files found. |
📦 Frontend bundle diagnostics
Chunk changes
|
Deploying koyori with
|
| Latest commit: |
1cf2e7f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7ce1fd07.koyori.pages.dev |
| Branch Preview URL: | https://feat-449-argos-vrt-selector.koyori.pages.dev |
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.
背景
Argos は全 story を毎 build 撮影するため、月次のスクリーンショット枠を使い切った。
Chromatic の TurboSnap に相当する変更 story の自動検出が Argos には無い。
この PR は、変更のあった story だけを選んで撮影する仕組みを入れる。
議論の経緯は #449 にある。
何を入れたか
変更ファイルから影響を受ける story を算出する selector を追加した。
Storybook の index.json と、build 時に生成される preview-stats.json の依存グラフを突き合わせる方式である。
Chromatic の TurboSnap と同じ考え方に沿っている。
判定は FULL、PARTIAL、NONE の3値とした。
グラフの生成に失敗した場合、seed が解決できない場合、到達数を安全に算出できない場合は FULL へ倒す。
判断がつかないときに撮影を省くのではなく、全て撮る側へ倒れるため、見落としたまま緑になることはない。
依存更新の PR も selector を通す。
到達が 0 件であれば撮影しないが、その根拠を manifest に残す。
到達が 1 件でもあれば撮影し、VRT の結果を automerge の判断材料として残す。
構成
selector の中核はプロバイダに依存しない module として実装した。
Argos への出力は薄いアダプタに分離してある。
将来 self-host の VRT へ移す場合も、中核はそのまま再利用できる。
baseline の解決
Argos が実際に比較した baseline commit は、公開 GraphQL の baseBuild と baseScreenshotBucket.commit から取得できる。
build 44 と build 43 の実データで確認した。
subset build が baseline 候補から除外される仕様であることも確認している。
この確証が取れるまで PARTIAL は無効にしていた。
baseline を推測で仮定すると比較対象がずれ、撮らなかった story の回帰が無音で通るためである。
検証
selector と adapter の contract テストが 9 件通る。
skip は 0 件である。
frontend の unit スイートは exit 0 で、skip は無い。
lint は frontend 3 ファイルと scripts 5 ファイルで warning 0、error 0 である。
build-storybook で 4467 module の依存グラフを生成し、story を 117 件へ正規化した。
docs entry は対象から除外される。
password-input を seed としたとき 16 story へ到達し、期待した集合と一致した。
撮影対象が 0 件になる経路も実際に動かし、manifest の記録と gate の通過を確認した。
今回のスコープ外
main への push は従来どおり全 story を撮影する。
PR 側の selector が取り落としたものを拾う最終防線として残した。
このため月次の消費は依然として枠を超える見込みである。
枠そのものの解消は別途扱う。
この PR は TurboSnap と同等の機能を入れるところまでを目的とする。
Part of #449
Assisted-by: multi-agent-shogun-aki-tweak