feat(visual): Lot 4 — download baselines + route visual/* uploads - #9
Merged
Conversation
Add the visual input (default true) controlling the visual regression round-trip with the API.
New src/visual/prepare.ts: - GET /ci/visual/baselines?branch=... with X-Api-Token - 404/501 -> warn + no-op (rollout tolerance) - other non-2xx -> throw - restore/save GHA cache keyed on visual-baseline-<projectId>-<manifest_sha256> - cache miss -> download each baseline PNG to <name>--<tag>.png, non-fatal per-file errors Wired into main.ts before runComposer(); failures are caught and logged as a warning so a broken/rolling-out visual API never brick the run. Adds @actions/cache as a dependency.
Extend the upload glob to include screens/actual/*.png and screens/diff/*.png, and rename them to visual/actual/<file> and visual/diff/<file> in the multipart form (screens/errors/* keeps its existing screens/<file> naming). Also fixes a pre-existing test regression: the endpoint URL expectation in api.test.ts still had the trailing slash that was dropped from src in 14b7c23, so that test was failing on main before this change.
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.
Summary
Lot 4 of visual regression MVP2 (spec: design doc). Closes the client-side round-trip: the action now downloads baselines from the API before the run and uploads actual/diff after.
Test plan
🤖 Generated with Claude Code