Repository navigation
feat(capture web): init/update-workflows --capture web, setup-skill upgrade path, docs - #117
Merged
Merged
Conversation
…pgrade path, docs `init --capture web` and `update-workflows --capture web` write .github/workflows/scry-capture-web.yml for a project on Storybook 10 with a Vite framework, the React renderer and Playwright. The project is checked before anything is written; one that does not qualify stops with the reason. With the option, deploy-storybook.yml runs with --no-analysis (still hosts Storybook and reports coverage, no second capture) and deploy-pr-preview.yml is unchanged. Without the option both files are byte-for-byte what they were. Also: README and docs/capture-web.md sections, the reference copy in templates/workflows, and a capture-web reference in the scry-setup skill with the upgrade path for an existing project. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
epinnock
marked this pull request as ready for review
November 15, 2026 09:45
…pgrade path) - The qualify check's child process gets no Scry, GitHub or npm credentials; --help, README, docs and the skill say the check loads project config. - --capture web stops outside the repository root and writes nothing. - Capture workflow only: pnpm from packageManager, else 10 (8 for an old lockfile); Corepack for Yarn 2+; setup-bun without a setup-node cache. The two deploy workflows are byte-identical. - init checks the project before the credentials. - Storybook's "failed to load preset" becomes a plain reason, raw error kept. - Skill: custom deploy workflow by hand, final-message checklist, story count sources, commit and config-file notes, more troubleshooting. - Docs: one flag spelling (--project-id / --api-key), version floor on the init example, Playwright resolution as the code does it, manual-run rule. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
What
scry-deployer capture web(build-free Storybook capture) could only be set up by hand. This adds the option that sets it up for any project that qualifies, the docs, and the setup-skill path.scry-deployer init --capture webandscry-deployer update-workflows --capture webwrite.github/workflows/scry-capture-web.yml.--config-dir <dir>(only with--capture web) for a Storybook config that is not in.storybook.lib/capture/web/detection (loadStorybookProject,loadVite) in a child process. A project that does not qualify gets the reason, exit 1, and no file written or changed.deploy-storybook.ymlanddeploy-pr-preview.ymlare byte-for-byte what they were (existing snapshots unchanged; a test compares the outputs).Release: no behaviour change
Gate note: the generated workflow installs
@scrymore/scry-deployer@^0.14.0from npm, and npm has 0.13.0 today. Nothing in this PR publishes or bumps a version. Until 0.14.0 is published, a workflow written by--capture webfails at its install step; the skill checks for the command first and leaves the project as it is when it is not there.Decision: what
--capture webdoes to the two existing workflows--capture webscry-capture-web.ymlcapture webthenuploadon a push to the default branch.deploy-storybook.yml--with-analysisbecomes--no-analysis. Still builds and hosts Storybook, still reports coverage and CI time. No second screenshot capture.deploy-pr-preview.ymlEvidence:
zipUrland no coverage report (upload service bundle route; the web-capture plan lists "coverage report for SCF builds" as not in v1). Removingdeploy-storybook.ymlwould lose the hosted Storybook and coverage, so it stays.--no-analysisis an existing mode (0.7.0: hosted, not indexed). Coverage does not depend on the screenshots (resolveAnalysisinbin/cli.js,lib/coverage.js).scry-capture-web.ymlheader says it does not replacedeploy-storybook.yml.capture webruns only on the default branch, so the PR workflow has to keep--with-analysis.Side effect to know about: each push creates two builds, the hosted one (not indexed) and the bundle (indexed).
Going back:
update-workflowswithout the option restores--with-analysis; if a generatedscry-capture-web.ymlis still there, the command warns that every push is captured twice and says to delete it.The generated workflow
ubuntu-24.04(not the floating label), Node 20,timeout-minutes: 30(measured: 1,734 stories took about 10 min to capture on a 2-core hosted runner, about 1.5 min to upload).$RUNNER_TEMP/scry, floor^0.14.0,--ignore-scripts, no--prefer-offline, never from git.playwright install --with-deps chromium).--max-dropped "${SCRY_MAX_DROPPED:-0}": default 0. A failed story is already retried once; a story missing from a bundle is missing from search; a red run uploads nothing, so search keeps the last complete build.SCRY_API_KEY(upload step only), variablesSCRY_API_URL,SCRY_PROJECT_ID, optionalSCRY_MAX_DROPPED.workflow_dispatch: a manual run on a non-default branch only validates the bundle (upload --dry-run).permissions: contents: read, packages: read;persist-credentials: false; the report is kept as an artifact for 7 days.Docs and skill
capture rnsection.docs/capture-web.md: "Set it up in CI".templates/workflows/: reference copyscry-capture-web.yml(generated) and README section.skills/scry-setup: newreferences/capture-web.md(qualify, check the deployer has the command, new setup, upgrade an existing project, how to go back, troubleshooting) and a routing bullet inSKILL.md. The "checked against" line now says which references were checked against what.Review round 1 (second commit)
--capture webloads the project's Storybook main file, presets and Vite config in a child process. That child now gets an environment withoutGITHUB_TOKEN,GH_TOKEN,GH_ENTERPRISE_TOKEN,GITHUB_ENTERPRISE_TOKEN,NPM_TOKEN,NODE_AUTH_TOKEN, npm auth settings, and everySCRY_*/STORYBOOK_DEPLOYER_*variable whose name contains KEY, TOKEN, SECRET or PASSWORD. Everything else passes through, because a project's config may read its own variables.--help, README, docs and the skill say: the check loads the project's Storybook and Vite config, as Storybook itself does; run it only in a repository you trust.--capture webcomparesgit rev-parse --show-toplevelwith the working directory before any project code is loaded. From a subfolder it stops, names the limit (the project must be at the repository root in this version) and writes nothing.pnpm/action-setup@v4. Whenpackage.jsonhas"packageManager": "pnpm@x", no version is written and the action installs that one (it stops when both are given and differ). Otherwise the version follows the lockfile format: 10 for a version 9 lockfile, 8 for an older one. Why 10 and not 9: pnpm 9 and 10 both read and write lockfile version 9, 10 is the current major, and it is the one the measured dashboard runs used. The two deploy workflows keepaction-setup@v2with version 8; their output is byte-identical (existing snapshots unchanged).packageManagergetscorepack enablebefore setup-node. Bun usessetup-bun@v2, has nocache:on setup-node (setup-node caches npm, yarn and pnpm only), and a project with onlybun.lockis treated as bun. Not changed, and worth a follow-up: the deploy workflows writecache: 'bun'for a bun project and detectbun.lockbonly.initchecks the project before the credentials. Safe: step 1 is a local check of the two flags.deploy-storybook.ymlkeeps^0.12.1with--capture web.--no-analysisis handled the same at 0.12.1 as here:git diffofbin/cli.jsandlib/config.jsfrom the 0.12.1 release commit (7db4821) to this branch has no line that touches the analysis option, and the option has existed since 0.7.0. So the hosting workflow needs no higher floor and its default output is not touched.mainandmaster, as the two existing templates do. Documented in the file header, the command's summary, README, docs and skill troubleshooting.--capturevalue is already an error on this branch (yargschoices). A deployer older than 0.14.0 ignores the option; README, docs and skill keep@^0.14.0in every command for that reason.Tests
test/templates.test.js;test/capture-web-onboarding.test.jscould not load.pnpm lint: 122 warnings (the limit), none new.test/fixtures/capture-web(Storybook 10.0.7, Vite 7.1.6, Playwright 1.55.0, Node 20.19.2):update-workflows --capture webwrote the three files; the workflow's capture command captured 13 of 15 and exited 1 on the fixture's always-failing story with the default--max-dropped 0;upload --dry-runvalidated the bundle.Not checked
🤖 Generated with Claude Code