Skip to content

Show the run id and the pipeline's other runs in pipeline status, and honour --output json (#1014) - #1025

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1014
Oct 17, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1014

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1014

Stacked on #1016 (fix/1013), which is stacked on #1012 (fix/989) and the pipeline stack #988 → #980 → #972 → #957 → #942 → #931. The diff here is only the top commit.

What

spawn pipeline status now prints the run id that spawn pipeline collect --run takes, and lists the pipeline's other runs:

Pipeline: demo
ID: pl-1
Run: 20261015t120000z-cccccccc
Status: RUNNING
Created: ...
Updated: ...
Other runs: 20261014t120000z-bbbbbbbb 20261013t120000z-aaaaaaaa
  collect one with: spawn pipeline collect pl-1 --run <run-id>
  • Listing the runs is cheap. It is a single delimited ListObjectsV2 per 1000 runs, of the common prefixes under <s3_prefix>/runs/ in s3_bucket. That is the same listing collect already used for its no-outputs hint, now exported as pipeline.ListRunIDs (pkg/pipeline is not on the public surface).
  • The "Other runs" line is capped at the newest 10, followed by "(and N older; --output json lists all)". It is shown newest first.
  • Legacy records (pre-pipeline: re-launching a definition overwrites the in-flight record, and stale markers under the same s3_prefix decide the new run #943, no run id) show Run: - (launched before run ids; collect it without --run).
  • A listing error (for example no s3:ListBucket on the bucket) does not fail status. It prints a warning on stderr and shows the rest.

JSON: status used to ignore --output json entirely and always print text. It now prints the stored record, as pipeline list --output json does, plus two fields:

  • run_id is always present. It is "" on a legacy record; the record itself omits it when empty.
  • runs holds every run id found, oldest first. It is [] when there are none, and null with runs_error set when the runs could not be listed.

status --help and docs-gen/pipeline.md describe this, and examples/pipelines/README.md now says where to find run ids.

Tests

cmd/pipeline_status_test.go covers:

  • the text header, the other-runs line (order, cap, absent when only the current run exists), legacy records, and listing errors;
  • the JSON shape (run_id, runs, runs_error, the record's own fields);
  • statusRunIDs/ListRunIDs against a two-page fake S3: the bucket, the pfx/runs/ prefix, the / delimiter, every page, and [] not nil for an empty listing.

I checked each assertion against a revert that compiles. There were eight reverts (drop the Run line; drop the other-runs block; skip JSON; drop the run_id override; nil empty listing; keep runs on error; oldest-first order; cap that keeps the oldest). Each one made at least one test fail, and none of them failed to build.

make check: everything passes except the known Docker-only TestGenerateWrapper_ChownFixesCrossUIDStickyUnlink_Docker (no Docker here). make check-nested: all 9 modules clean. make check-docs: clean. Semgrep --config=auto on the changed files: 0 findings.

Not covered

runStatusPipeline's own wiring (DynamoDB get → S3 list → writePipelineStatus with getOutputFormat() == "json") is not exercised: that would need AWS, and no AWS resources were used. This PR is CLI-only, so no Lambda redeploy is needed.

@codecov

codecov Bot commented Oct 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.47368% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/pipeline.go 88.88% 5 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit 8fb835d into main Oct 17, 2026
8 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1014 branch October 17, 2026 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spawn pipeline status does not print the run id, which collect --run takes

1 participant