Skip to content

feat: add --skip-if-empty option to argos finalize#341

Merged
gregberge merged 2 commits into
mainfrom
feat/finalize-skip-if-empty
Jul 10, 2026
Merged

feat: add --skip-if-empty option to argos finalize#341
gregberge merged 2 commits into
mainfrom
feat/finalize-skip-if-empty

Conversation

@gregberge

Copy link
Copy Markdown
Member

Description

Adds a --skip-if-empty option to argos finalize: when no parallel build matches the nonce, it creates a skipped build instead of doing nothing.

This covers pipelines where every upload step is conditional — typically monorepos where a task cache (Turborepo, Nx) decides which test suites actually run. On a run where all Argos-enabled suites are cache hits, nothing is uploaded, and a required Argos status check would stay missing on the commit. finalize --skip-if-empty guarantees the commit always gets an Argos build: a real one when shards were uploaded, a skipped (immediately successful) one otherwise.

argos finalize --skip-if-empty --build-name unit

Changes:

  • @argos-ci/core: finalize() accepts skipIfEmpty and buildName, and returns { builds, skippedBuild } (skippedBuild is null unless the fallback ran). Also adds apiBaseUrl/token parameters for parity with upload()/skip().
  • @argos-ci/cli: finalize gains --skip-if-empty, --build-name and --token.
  • Mock handler for POST /builds/finalize + unit tests covering both modes.

Type of changes

enhancement

Checklist

  • I have read the CONTRIBUTING doc
  • The commits message follows the Conventional Commits' policy
  • Lint and unit tests pass locally
  • I have added tests if needed

Optional checks:

  • My changes requires a change to the documentation
  • I have updated the documentation accordingly

Further comments

Docs PR in the docs repo documents the new flag (CLI reference + a new "Cached CI pipelines (Turborepo, Nx)" guide). First consumer: GitBook's monorepo, which aggregates vitest prompt-snapshot suites into a single unit build under Turborepo caching.

🤖 Generated with Claude Code

@gregberge gregberge added the enhancement New feature or request label Jul 10, 2026
@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
argos-js-sdk-reference Ready Ready Preview, Comment Jul 10, 2026 8:23pm

Request Review

gregberge and others added 2 commits July 10, 2026 22:23
When every upload step of a pipeline is conditional (e.g. skipped by a
task cache such as Turborepo or Nx), a run may produce no parallel shard
at all: finalize then has nothing to close and a required Argos status
check stays missing on the commit.

With --skip-if-empty, finalize creates a skipped build when no parallel
build matches the nonce, so the commit still gets a successful Argos
status. The skipped build is named with --build-name / ARGOS_BUILD_NAME.

Also exposes --token on the finalize command and apiBaseUrl/token on the
core finalize() parameters, for parity with upload/skip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The files were accidentally formatted with a different style than the
repository's prettier config. The 'throws without a nonce' test also
failed on GitHub Actions, where a parallel nonce is automatically
derived from the run: CI detection is now neutralized in the test setup
so the suite behaves the same everywhere.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gregberge gregberge force-pushed the feat/finalize-skip-if-empty branch from 35c935a to 91cf2ff Compare July 10, 2026 20:23
@gregberge gregberge merged commit b0c00eb into main Jul 10, 2026
70 checks passed
@gregberge gregberge deleted the feat/finalize-skip-if-empty branch July 10, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant