feat: add --skip-if-empty option to argos finalize#341
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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>
35c935a to
91cf2ff
Compare
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.
Description
Adds a
--skip-if-emptyoption toargos 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-emptyguarantees the commit always gets an Argos build: a real one when shards were uploaded, a skipped (immediately successful) one otherwise.Changes:
@argos-ci/core:finalize()acceptsskipIfEmptyandbuildName, and returns{ builds, skippedBuild }(skippedBuildisnullunless the fallback ran). Also addsapiBaseUrl/tokenparameters for parity withupload()/skip().@argos-ci/cli:finalizegains--skip-if-empty,--build-nameand--token.POST /builds/finalize+ unit tests covering both modes.Type of changes
enhancementChecklist
Optional checks:
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
unitbuild under Turborepo caching.🤖 Generated with Claude Code