Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"plugins": [
{
"name": "visualci",
"version": "0.1.59",
"version": "0.1.61",
"description": "Visual regression and snapshot review for PDFs, screenshots, JSON, HTML and text: VisualCI's MCP server and its skills for each CI provider and test tool.",
"author": { "name": "DocSpring", "url": "https://visualci.com" },
"homepage": "https://visualci.com/docs/skills/",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "visualci",
"version": "0.1.59",
"version": "0.1.61",
"description": "Visual regression and snapshot review for PDFs, screenshots, JSON, HTML and text: VisualCI's MCP server and its skills for each CI provider and test tool.",
"author": { "name": "DocSpring", "url": "https://visualci.com" },
"homepage": "https://visualci.com/docs/skills/",
Expand Down
2 changes: 1 addition & 1 deletion .cursor-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "visualci",
"displayName": "VisualCI",
"version": "0.1.59",
"version": "0.1.61",
"description": "Visual regression and snapshot review for PDFs, screenshots, JSON, HTML and text: VisualCI's MCP server and its skills for each CI provider and test tool.",
"author": {
"name": "DocSpring"
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ jobs:
working-directory: frontend
- run: pnpm install --frozen-lockfile && pnpm build
working-directory: frontend
env:
GITHUB_TOKEN: ${{ github.token }} # the docs' CLI release (scripts/cli-version.mjs)
- uses: ./.github/actions/playwright
with:
save: ${{ github.ref == 'refs/heads/main' }}
Expand Down Expand Up @@ -437,6 +439,8 @@ jobs:
# The production site: with the Plausible snippets (analytics.ts) and, required, the WebAssembly.
- run: pnpm install --frozen-lockfile && VISUALCI_ANALYTICS=1 VISUALCI_REQUIRE_WASM=1 pnpm build
working-directory: frontend
env:
GITHUB_TOKEN: ${{ github.token }} # the docs' CLI release (scripts/cli-version.mjs)
# visualci.com's static site: assembled from the build and checked (every docs page has its Markdown copy, and
# llms.txt links each one), then deployed by the site job.
- run: VISUALCI_ANALYTICS=1 node scripts/site.mjs
Expand Down Expand Up @@ -539,7 +543,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- id: version
run: echo "renderer=$(cat docker/renderer.version)" >>"$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
run: |
echo "renderer=$(cat docker/renderer.version)" >>"$GITHUB_OUTPUT"
# The CLI release the app's add-to-CI snippets install (frontend/scripts/cli-version.mjs): a build arg, so a
# new release rebuilds the cached frontend layer
echo "cli=$(gh api repos/DocSpring/visualci/releases/latest --jq .tag_name)" >>"$GITHUB_OUTPUT"
- uses: actions/download-artifact@v4
with:
name: release-bins
Expand All @@ -564,6 +574,7 @@ jobs:
BUILD_SHA=${{ github.sha }}
RENDERER_VERSION=${{ steps.version.outputs.renderer }}
VISUALCI_ANALYTICS=1
VISUALCI_CLI_VERSION=${{ steps.version.outputs.cli }}
tags: ghcr.io/docspring/visualci-app:${{ github.sha }}
cache-from: ${{ env.S3_CACHE }},name=visualci-app
cache-to: ${{ env.PUSH == 'true' && format('{0},name=visualci-app,mode=max,ignore-error=true', env.S3_CACHE) || '' }}
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ design is in `docs/design.md`; read it before changing the architecture, and upd
`.claude-plugin/plugin.json` and `marketplace.json` when a skill changes.
- A change to the CLI (crates/visualci-cli or crates/visualci-core) bumps the workspace version in Cargo.toml and
Cargo.lock's visualci-* entries. CI's `cli-version` job fails without the bump; once CI passes on main, the release
workflow publishes it. The docs' `VISUALCI_VERSION=` lines pin a published release (`scripts/site.mjs` checks it
exists): move them to the new version in a commit after its release is out. The docs must never describe a CLI
nobody can download.
workflow publishes it. The docs never name a CLI version: they write `{{cli_version}}`
(`VISUALCI_VERSION={{cli_version}}`, `github-action@v{{cli_version}}`), which the site build fills in with the newest
published release (`frontend/scripts/cli-version.mjs`), so they never pin an old CLI or one nobody can download yet.
- Fixtures are test data only: synthetic values, or blank template PDFs someone has checked. Never commit a real
customer's document or data.
- Build Rust in CI or on a build machine (docspring-dev), not on small agent VMs. The server is app/ (Laravel Rust,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"result": {
"content": [
{
"text": "---\nname: visualci-jenkins\ndescription: \"Sets up VisualCI in a Jenkins pipeline (Jenkinsfile): the token as a credential, installing the CLI, creating the build, uploading snapshots and finalizing, including parallel stages. Use when the user wants visual or snapshot review in Jenkins, or a project has a Jenkinsfile and VisualCI. Not for other CI providers, or for writing the tests themselves.\"\nlicense: Apache-2.0\nmetadata:\n docs: https://visualci.com/docs/ci/jenkins.md\n---\n\n<!-- Generated from frontend/content/docs/ci/jenkins.md by frontend/scripts/skills.mjs. Edit the page. -->\n\n# Jenkins\n\nStore a project token as a **Secret text** credential, say `visualci-token`. The CLI reads the commit from `GIT_COMMIT`, the branch from `CHANGE_BRANCH`, `BRANCH_NAME` or `GIT_BRANCH`, and the pull request from `CHANGE_ID`.\n\n```groovy\npipeline {\n agent any\n environment {\n VISUALCI_TOKEN = credentials('visualci-token')\n }\n stages {\n stage('Test') {\n steps {\n sh 'curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR=\"$WORKSPACE/bin\" sh'\n sh '''\n export PATH=\"$WORKSPACE/bin:$PATH\"\n export VISUALCI_BUILD_ID=$(visualci build create)\n npm test -- -u # write snapshots instead of failing; see the snapshot guides\n visualci upload --from auto src tests\n visualci build finalize\n '''\n }\n }\n }\n}\n```\n\nEach `sh` step is its own shell, so keep the build's commands in one step, or pass `VISUALCI_BUILD_ID` on with `withEnv`.\n\n## Parallel stages\n\nCreate the build once, then give each parallel stage a shard number:\n\n```groovy\nstage('Start VisualCI') {\n steps {\n script {\n env.VISUALCI_BUILD_ID = sh(script: 'bin/visualci build create --shards 2', returnStdout: true).trim()\n }\n }\n}\nstage('Tests') {\n parallel {\n stage('Unit') { steps { sh 'npm run test:unit -- -u && bin/visualci upload --from auto src && bin/visualci build finalize --shard 0' } }\n stage('Browser') { steps { sh 'npm run test:e2e && bin/visualci upload screenshots && bin/visualci build finalize --shard 1' } }\n }\n}\n```\n\nSee [Other CI providers](https://visualci.com/docs/ci/other.md) for the environment variables and how shards work.\n\nThis skill is the page https://visualci.com/docs/ci/jenkins.md. All of VisualCI's documentation: https://visualci.com/llms.txt\n",
"text": "---\nname: visualci-jenkins\ndescription: \"Sets up VisualCI in a Jenkins pipeline (Jenkinsfile): the token as a credential, installing the CLI, creating the build, uploading snapshots and finalizing, including parallel stages. Use when the user wants visual or snapshot review in Jenkins, or a project has a Jenkinsfile and VisualCI. Not for other CI providers, or for writing the tests themselves.\"\nlicense: Apache-2.0\nmetadata:\n docs: https://visualci.com/docs/ci/jenkins.md\n---\n\n<!-- Generated from frontend/content/docs/ci/jenkins.md by frontend/scripts/skills.mjs. Edit the page. -->\n\n# Jenkins\n\nReplace x.y.z below with the newest release of the VisualCI CLI: https://github.com/DocSpring/visualci/releases/latest\n\nStore a project token as a **Secret text** credential, say `visualci-token`. The CLI reads the commit from `GIT_COMMIT`, the branch from `CHANGE_BRANCH`, `BRANCH_NAME` or `GIT_BRANCH`, and the pull request from `CHANGE_ID`.\n\n```groovy\npipeline {\n agent any\n environment {\n VISUALCI_TOKEN = credentials('visualci-token')\n }\n stages {\n stage('Test') {\n steps {\n sh 'curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=x.y.z VISUALCI_INSTALL_DIR=\"$WORKSPACE/bin\" sh'\n sh '''\n export PATH=\"$WORKSPACE/bin:$PATH\"\n export VISUALCI_BUILD_ID=$(visualci build create)\n npm test -- -u # write snapshots instead of failing; see the snapshot guides\n visualci upload --from auto src tests\n visualci build finalize\n '''\n }\n }\n }\n}\n```\n\nEach `sh` step is its own shell, so keep the build's commands in one step, or pass `VISUALCI_BUILD_ID` on with `withEnv`.\n\n## Parallel stages\n\nCreate the build once, then give each parallel stage a shard number:\n\n```groovy\nstage('Start VisualCI') {\n steps {\n script {\n env.VISUALCI_BUILD_ID = sh(script: 'bin/visualci build create --shards 2', returnStdout: true).trim()\n }\n }\n}\nstage('Tests') {\n parallel {\n stage('Unit') { steps { sh 'npm run test:unit -- -u && bin/visualci upload --from auto src && bin/visualci build finalize --shard 0' } }\n stage('Browser') { steps { sh 'npm run test:e2e && bin/visualci upload screenshots && bin/visualci build finalize --shard 1' } }\n }\n}\n```\n\nSee [Other CI providers](https://visualci.com/docs/ci/other.md) for the environment variables and how shards work.\n\nThis skill is the page https://visualci.com/docs/ci/jenkins.md. All of VisualCI's documentation: https://visualci.com/llms.txt\n",
"type": "text"
}
],
Expand Down
3 changes: 3 additions & 0 deletions docker/app.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ ARG VISUALCI_ANALYTICS=0
ENV VISUALCI_ANALYTICS=${VISUALCI_ANALYTICS}
# The site's Compare two PDFs page (and its WebAssembly) is served by the site's Worker, never by the app.
ENV VISUALCI_SKIP_WASM=1
# The CLI release the add-to-CI snippets install (frontend/scripts/cli-version.mjs); CI passes the newest release.
ARG VISUALCI_CLI_VERSION=
ENV VISUALCI_CLI_VERSION=${VISUALCI_CLI_VERSION}
RUN if [ -f pnpm-lock.yaml ]; then pnpm build; else npm run build; fi

# cargo-chef: the dependencies build in a layer of their own, rebuilt only when a Cargo.toml or Cargo.lock changes.
Expand Down
2 changes: 1 addition & 1 deletion frontend/content/docs/ci/bitbucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pipelines:
name: Test
image: node:24
script:
- curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR=/usr/local/bin sh
- curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR=/usr/local/bin sh
- export VISUALCI_BUILD_ID=$(visualci build create)
- npm test -- -u # write snapshots instead of failing; see the snapshot guides
- visualci upload --from auto src tests
Expand Down
2 changes: 1 addition & 1 deletion frontend/content/docs/ci/buildkite.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The CLI reads the commit from `BUILDKITE_COMMIT`, the branch from `BUILDKITE_BRA
steps:
- label: ":test_tube: Tests"
command: |
curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR="$$HOME/bin" sh
curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR="$$HOME/bin" sh
export PATH="$$HOME/bin:$$PATH"
export VISUALCI_BUILD_ID=$$(visualci build create)
npm test -- -u
Expand Down
2 changes: 1 addition & 1 deletion frontend/content/docs/ci/circleci.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- checkout
- run:
name: Install VisualCI
command: curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR="$HOME/bin" sh
command: curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR="$HOME/bin" sh
- run:
name: Start a VisualCI build
command: echo "export VISUALCI_BUILD_ID=$($HOME/bin/visualci build create)" >> "$BASH_ENV"
Expand Down
18 changes: 12 additions & 6 deletions frontend/content/docs/ci/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ skill_description: Sets up VisualCI in GitHub Actions, including Blacksmith and
Add `VISUALCI_TOKEN` (a project token) to the repository's Actions secrets. Then add VisualCI's action to the job that runs your tests, after them:

```yaml
on:
pull_request: # one build per pull request commit
push:
branches: [main] # and one per merge to main: the baselines
jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -17,7 +21,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0 # VisualCI finds the baseline through the commit's ancestors
- run: npm test -- -u # write snapshots instead of failing; see the snapshot guides
- uses: DocSpring/visualci/clients/github-action@v0.2.23
- uses: DocSpring/visualci/clients/github-action@v{{cli_version}}
if: always()
with:
token: ${{ secrets.VISUALCI_TOKEN }}
Expand All @@ -26,6 +30,8 @@ jobs:
screenshots --platform chromium-linux --threshold 0.1
```

Run it on `pull_request` and on pushes to your main branch only: with `push` on every branch too, each commit to a pull request runs twice and sends two builds.

The action installs the CLI, creates the build, uploads and finalizes it. `upload` takes one `visualci upload` per line, as its arguments (paths, `--from`, `--prefix`, `--platform`, `--format`); leave it out to send the `uploads` in [visualci.yml](/docs/reference/config/). Without a token the step fails, so a misnamed secret can't pass quietly. The token comes from `token`, or from `VISUALCI_TOKEN` in the workflow's or job's `env`. The exceptions are where GitHub passes no repository secrets: a fork's pull request and runs in a fork get none, and Dependabot's pull requests get only Dependabot secrets. The action skips those with a notice; [send a fork's from a second workflow](#pull-requests-from-forks), and add `VISUALCI_TOKEN` to the Dependabot secrets to review Dependabot's.

| Input | What it does |
Expand All @@ -50,7 +56,7 @@ Every job of a workflow run that uses the same `name` joins one build. Send from
browser: [chromium, webkit]
steps:
# ... checkout and tests ...
- uses: DocSpring/visualci/clients/github-action@v0.2.23
- uses: DocSpring/visualci/clients/github-action@v{{cli_version}}
with:
token: ${{ secrets.VISUALCI_TOKEN }}
finalize: false
Expand All @@ -62,7 +68,7 @@ Every job of a workflow run that uses the same `name` joins one build. Send from
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: DocSpring/visualci/clients/github-action@v0.2.23
- uses: DocSpring/visualci/clients/github-action@v{{cli_version}}
with:
token: ${{ secrets.VISUALCI_TOKEN }}
finalize-only: true
Expand Down Expand Up @@ -106,7 +112,7 @@ jobs:
- uses: actions/checkout@v4 # your default branch: the fork's commits are only fetched
with:
fetch-depth: 0
- uses: DocSpring/visualci/clients/github-action@v0.2.23
- uses: DocSpring/visualci/clients/github-action@v{{cli_version}}
with:
token: ${{ secrets.VISUALCI_TOKEN }}
artifact: visualci
Expand Down Expand Up @@ -174,7 +180,7 @@ jobs:
- 'templates/**'
- name: Install VisualCI
run: |
curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR="$RUNNER_TEMP" sh
curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR="$RUNNER_TEMP" sh
echo "$RUNNER_TEMP" >> "$GITHUB_PATH"
- name: Start a VisualCI build
# A skipped run sends nothing: --subset carries every snapshot forward.
Expand Down Expand Up @@ -218,7 +224,7 @@ jobs:
fetch-depth: 0
- name: Install VisualCI
run: |
curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR="$RUNNER_TEMP" sh
curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR="$RUNNER_TEMP" sh
echo "$RUNNER_TEMP" >> "$GITHUB_PATH"
- name: Start a VisualCI build
run: echo "VISUALCI_BUILD_ID=$(visualci build create)" >> "$GITHUB_ENV"
Expand Down
2 changes: 1 addition & 1 deletion frontend/content/docs/ci/gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ visual:
variables:
GIT_DEPTH: 0 # VisualCI finds the baseline through the commit's ancestors
script:
- curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR=/usr/local/bin sh
- curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR=/usr/local/bin sh
- export VISUALCI_BUILD_ID=$(visualci build create)
- npm test -- -u
- visualci upload --from auto src tests
Expand Down
2 changes: 1 addition & 1 deletion frontend/content/docs/ci/jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pipeline {
stages {
stage('Test') {
steps {
sh 'curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR="$WORKSPACE/bin" sh'
sh 'curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR="$WORKSPACE/bin" sh'
sh '''
export PATH="$WORKSPACE/bin:$PATH"
export VISUALCI_BUILD_ID=$(visualci build create)
Expand Down
2 changes: 1 addition & 1 deletion frontend/content/docs/ci/semaphore.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ blocks:
- name: Test
commands:
- checkout
- curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR="$HOME/bin" sh
- curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR="$HOME/bin" sh
- export PATH="$HOME/bin:$PATH"
- export VISUALCI_BUILD_ID=$(visualci build create)
- npm test -- -u # write snapshots instead of failing; see the snapshot guides
Expand Down
2 changes: 1 addition & 1 deletion frontend/content/docs/ci/teamcity.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The CLI doesn't read TeamCity's parameters by itself: pass them as environment v
Then a command-line step:

```sh
curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR="$PWD/bin" sh
curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR="$PWD/bin" sh
export PATH="$PWD/bin:$PATH"
export VISUALCI_BUILD_ID=$(visualci build create)
npm test -- -u # write snapshots instead of failing; see the snapshot guides
Expand Down
2 changes: 1 addition & 1 deletion frontend/content/docs/ci/travis.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ git:
depth: false
install:
- npm ci
- curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION=0.2.23 VISUALCI_INSTALL_DIR="$HOME/bin" sh
- curl -fsSL https://visualci.com/install.sh | VISUALCI_VERSION={{cli_version}} VISUALCI_INSTALL_DIR="$HOME/bin" sh
script:
- export PATH="$HOME/bin:$PATH"
- export VISUALCI_BUILD_ID=$(visualci build create)
Expand Down
2 changes: 1 addition & 1 deletion frontend/content/docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Install the CLI on Linux (x86_64 or arm64) or macOS:
curl -fsSL https://visualci.com/install.sh | sh
```

It installs to `/usr/local/bin`, or to `$VISUALCI_INSTALL_DIR`, and checks the download's SHA-256. In CI, pin the version with `VISUALCI_VERSION=0.2.23`, so a new release never changes a build by surprise. It downloads the latest [GitHub release](https://github.com/DocSpring/visualci/releases) for Linux (x86_64 and arm64) or macOS. Anywhere else with Rust, build it from source:
It installs to `/usr/local/bin`, or to `$VISUALCI_INSTALL_DIR`, and checks the download's SHA-256. In CI, pin the version with `VISUALCI_VERSION={{cli_version}}`, so a new release never changes a build by surprise. It downloads the latest [GitHub release](https://github.com/DocSpring/visualci/releases) for Linux (x86_64 and arm64) or macOS. Anywhere else with Rust, build it from source:

```sh
cargo install --git https://github.com/DocSpring/visualci visualci-cli
Expand Down
Loading
Loading