Skip to content
GitHubBlueskydev.toRSS
Releases

Pipelines for CI, outputs that must exist

A pipeline is a vx run saved under a name, one per CI job. A failure skips only its dependants, a declared output nobody wrote fails the task, watch reruns only what an edit reaches, and git merges the locks as text.

vx 0.0.661: Pipelines for CI, outputs that must exist

A CI job is one line: vx pipeline pr. The pipeline names its tasks and flags in .vx/workspace.ts, so a laptop runs what CI runs.

A failed task skips only the tasks that depend on it. A task that declares an output and never writes it fails.

This release has breaking changes: read Breaking changes first.

In this release

One ci task per project cannot serve several CI jobs that each run different tasks. A pipeline is a vx run saved under a name: its tasks in every project, and each vx run flag as a key.

.vx/workspace.ts
import { defineWorkspace } from '@vzn/vx/config'
export default defineWorkspace({
pipelines: {
pr: { tasks: ['lint', 'build'], affected: true, failFast: true },
main: { tasks: ['lint', 'build'] },
},
})

Here one commit edits packages/app, and pr runs that project alone:

Terminal window
$ vx pipeline pr --affected=HEAD~1
Tasks status cache ±usual time cpu mem outputs blocks worker task
success miss −8ms 11ms 22% 2.0MB 0B 0 local packages/app#lint
success miss −8ms 11ms 36% 2.1MB 47B 0 local packages/app#build

A flag typed on the command line beats the pipeline’s key. A pipeline’s env block is set for vx and its plugins, and no task sees it.

See CI.

--continue=never let running tasks finish, and --continue=always ran tasks whose dependencies had failed.

Now a failed task skips the tasks that depend on it, and every other task runs. A dev server stays up when an unrelated task fails.

--fail-fast stops the run at the first failure and kills the tasks still running. They end aborted, save nothing and start no retry.

Terminal window
vx run test --all --fail-fast

See Running tasks.

A typo in an output glob, or a build that wrote somewhere else, used to warn and cache an empty entry. A later hit restored nothing.

Every glob in outputs.files and outputs.workspaceFiles must now match a file once the command exits 0. Here build declares types/** and never writes it:

Terminal window
$ vx run build --filter packages/lib
Warnings
[vx] packages/lib#build: outputs matched no files (types/**) — the command exited 0 but never wrote it, so the task fails and nothing is cached: write it, or fix the pattern
Tasks status cache ±usual time cpu mem outputs blocks worker task
failed miss −4ms 15ms 38% 2.0MB — 0 local packages/lib#build
┌─ packages/lib#build > failed (exited 0, no file matched types/**)
packages/lib $ mkdir -p dist && cp src/index.ts dist/index.js

The task fails and nothing is saved. A failed task’s $ line names its directory, so the paths in its output have a start.

vx init names each Turbo output that matches no file yet, because Turbo cached what was present and vx requires all of them.

See Caching.

vx watch ran every uncached task and every failed task on each cycle, whatever the edit. A task now keeps its last result while its key holds and no changed path lies in its project.

  • An edit to the app no longer reruns the uncached generator it builds on.
  • A stop also ends a daemon that left its task’s process group with setsid. A task that ends on its own leaves its daemons, so a shared one (sccache) keeps serving.
  • A kept server is named as still running, and the changed count holds only changed files.

See Watch.

The lock’s merge driver ran before the other branch’s configs reached the disk, so it could not lock again.

It is gone, and git merges .vx/projects.lock as text. A clash leaves markers, and vx names the fix:

Terminal window
$ vx run lint --all
✗ vx run .vx/projects.lock holds a git merge conflict: run `vx lock`, which writes it anew from the configs

See Lock.

  • vx run --force replaces the local entry its key held, so a forced run repairs a doubted entry.
  • A committed file under a task’s own outputs is keyed by what git holds, so a build that rewrites it each run still hits.
  • A restored tree lands only where nothing stands.
  • @vzn/vx-cache turns the remote off for the run when no server listens, and a download past cache.artifactCeiling is a miss.
  • A sandboxed task cannot read browser profiles or age keys under home.
  • Variables named like GPG_PASSPHRASE, SMTP_PASS and MYSQL_PWD are masked in output.
  • Args after -- reach one task in one project; a run that would forward them to several is refused.
  • A --filter that matches nothing refuses, even beside one that matches.
  • On CI, task output logs default to errors only; --output-logs or VX_RUN_OUTPUT_LOGS sets it.
  • A piped run prints the Tasks header once, and vx last --format json failed rows carry dir.
  • The task grid and Summary fit a narrow terminal.
  • vx why cuts each hash to 12 characters on a narrow terminal.
  • A task that exits 127 names the #! interpreter it could not find.
  • bunx @vzn/vx-migrate carries run settings into the workspace file and declares the lockfile plugin over an untouched vx init file.
  • Two starters to copy: examples/vite and examples/next.
  • With @vzn/vx-dte, a server that crashed on a worker fails the task that needed it, dte() reads VX_DTE_RELAY when the run starts, and a task that filled its worker runs on a bigger one next time.
  • --continue, run.continue, VX_RUN_CONTINUE and the pipeline key continue → --fail-fast, run.failFast, VX_RUN_FAIL_FAST, failFast. RunOptions.continueMode → failFast.
  • A declared output that matches no files fails the task; it was a warning.
  • .vx/projects.lock.jsonl → .vx/projects.lock, at version 9, and .vx/dependencies.lock is version 6: run vx lock once.
  • vx lock --merge is removed.
  • vx lock --check --format json problems are { code, message } objects, not strings.
  • vx run --dry=json → vx run --dry --format json; --dry=pretty → --dry; the pipeline key dry: 'json' → dry: true, format: 'json'.
  • Cache.kept() and the stampWritten hooks are removed.
  • The index schema is v58: the local index resets once, so the run history starts empty.

See Upgrading.

Terminal window
vx upgrade
Turborepo, Nx and other product names are trademarks of their owners. vx is not affiliated with or endorsed by them.