Skip to content

A target that no selected project defines fails instead of exiting 0 - #295

Open
calvin-archastro wants to merge 1 commit into
mainfrom
factory/tsk_4JVLPI7PgIKDfuE3f8d4gt-a86e5c3c-039b-4820-ad35-
Open

calvin-archastro wants to merge 1 commit into
mainfrom
factory/tsk_4JVLPI7PgIKDfuE3f8d4gt-a86e5c3c-039b-4820-ad35-

Conversation

@calvin-archastro

@calvin-archastro calvin-archastro commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review on ArchCode

Epic: Aster bug bash fixes
Task: A target that no selected project defines fails instead of exiting 0

Problem and author intent

An external target that no selected project defined was treated as a full skip and exited 0. aster tset --all printed a “skipped (no target)” summary and stayed green, so a typo in CI could pass indefinitely. With no project selector, a word that no discovered project defined (for example aster nonexist) was reported as “No projects specified” instead of an unknown command. The streaming path returned before that empty-target policy, so a multi-project typo could fail for the wrong reason and --allow-empty would not apply.

The intent is to fail when every selected project omits the target, matching the expectation that a missing target is an error, while keeping a partial skip and an empty workspace successful. --allow-empty is the explicit opt-out. A bare word that no project defines should say it is an unknown command or target. aster run is left unchanged.

What changed

Before, every selected project could skip a missing target and the process still exited 0. After, a non-empty result set in which every result is skipped fails unless --allow-empty is set, with target '<name>' is not defined in any selected project. An empty result set, including an empty workspace, still exits 0. If at least one selected project defines the target, projects that omit it are still skipped and the run still succeeds.

RunArgs gains allow_empty, parsed from --allow-empty (default false). In select_projects, a non-empty target word that no discovered project defines returns unknown command or target '<word>'; run aster --help instead of the selector hint. If some project does define the word, the existing “No projects specified” error is unchanged, including aster test outside a project.

On the external-target path, streaming is not entered when the initial selection is non-empty and none of those projects define the target. That keeps the batch summary in control, so both the failure and --allow-empty apply to --stream as well. Usage text, CLI help, the README, and src/cli/skills.md document the flag and the skip-versus-fail rule.

Scope

  • src/main.rs: streaming guard and all-skipped failure
  • src/cli/run.rs: --allow-empty parsing and unknown-command error, plus test_parse_run_args_allow_empty
  • src/cli/commands.rs: help text
  • README.md, src/cli/skills.md: user docs
  • tests/integration.rs: typo_target_with_all_fails_when_no_project_defines_it

The frozen diff is 15 hunks, +184/−5, across those six paths, with no omitted hunks or paths. src/cli/output.rs is not modified. aster run is not modified.

Risk assessment

Medium. Invocations that previously exited 0 because the target was defined nowhere now fail. That break is intended for typos; workflows that rely on the old green exit need --allow-empty. Partial skips and empty workspaces keep exit 0. Batch and stream share the same policy so the flag is not ignored on the streaming path.

User impact

aster <missing-target> --all (and a selected project that does not define the target) now fails and names the target, unless --allow-empty is passed. A target defined by only some selected projects still runs, with the others skipped. A bare unknown word points at aster --help. An empty workspace running a target with --all still exits 0.

Testing

The patch adds tests/integration.rs::typo_target_with_all_fails_when_no_project_defines_it and the unit test test_parse_run_args_allow_empty in src/cli/run.rs. The integration test builds a temp workspace, runs the aster binary, and asserts: tset --all fails and names tset; nonexist fails with the unknown-command text; bare test still reports “No projects specified”; test --all succeeds with a partial skip; tset --all --allow-empty exits 0; tset //p --stream fails with the not-defined message; --allow-empty --stream exits 0; an empty workspace with tset --all exits 0. Those assertions are evidence of intended coverage, not proof the test passed.

Author-reported local checks are cargo test --test integration typo_target_with_all_fails_when_no_project_defines_it, cargo clippy --workspace --all-targets -- -D warnings, and cargo fmt --all --check. The task text says CI job test runs cargo test --locked --workspace --all-targets --all-features (which would include this integration test) and job quality runs fmt and clippy. Upstream checks format, lint, test, fix, reformat, verify-lint, verify-test, and commit all report succeeded with exit code 0, but the payload is truncated and the excerpts do not name this integration test, test_parse_run_args_allow_empty, or these CLI paths. Those pipeline outcomes are advisory and do not confirm this change’s tests executed.

Follow-ups and known issues

Empty-workspace success is intentional and is covered by the new integration test. aster run and selector parsing beyond the unknown-command message were left unchanged. No further follow-ups are evidenced in the frozen diff.

@calvin-archastro
calvin-archastro requested a review from a team October 31, 2026 21:59
@calvin-archastro

calvin-archastro commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

ArchDev is watching this pull request. State: watching (cycle 10 of 10 for head 227acb6).

when trigger decision result
2026-10-31T22:16:32.391Z merge conflict enqueue job_1d806dbd0798afcfc45aee66 published 3e98fb6
2026-10-31T22:34:53.230Z verify head enqueue job_b31eb01c00e6b02aa165ca14 no change
2026-10-31T23:10:32.668Z merge conflict enqueue job_7c2da2179ea4080b7b72b397 published 81686df
2026-10-31T23:29:19.610Z verify head enqueue job_a113fe102b473be6b932fd9e no change
2026-11-01T00:17:41.126Z merge conflict enqueue job_f293604c942b64a831046aa2 published 5aa879a
2026-11-01T00:35:55.303Z verify head enqueue job_e8d620d26de2cc29e7c62464 no change
2026-11-01T12:35:30.349Z merge conflict enqueue job_d949a03de9f8ab2f516cdacd published 8d3a4ad
2026-11-01T12:58:20.797Z verify head enqueue job_705a67884729afc952fcf898 no change
2026-11-01T16:42:47.779Z merge conflict enqueue job_928becb301a560502808edd1 failed Pipeline step finalize-conflict failed: command exited with code 1
2026-11-01T17:03:03.089Z verify head enqueue job_051c0af9498485638943e57c no change

Paused by the no-autofix label or a draft; never resolves reviewer threads. Jobs: job_1d806dbd0798afcfc45aee66, job_b31eb01c00e6b02aa165ca14, job_7c2da2179ea4080b7b72b397, job_a113fe102b473be6b932fd9e, job_f293604c942b64a831046aa2, job_e8d620d26de2cc29e7c62464, job_d949a03de9f8ab2f516cdacd, job_705a67884729afc952fcf898, job_928becb301a560502808edd1, job_051c0af9498485638943e57c.

@calvin-archastro
calvin-archastro force-pushed the factory/tsk_4JVLPI7PgIKDfuE3f8d4gt-a86e5c3c-039b-4820-ad35- branch 4 times, most recently from 5aa879a to 8d3a4ad Compare November 1, 2026 12:44
@calvin-archastro
calvin-archastro force-pushed the factory/tsk_4JVLPI7PgIKDfuE3f8d4gt-a86e5c3c-039b-4820-ad35- branch from 8d3a4ad to 227acb6 Compare November 1, 2026 16:51

This branch has not been deployed

No deployments
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.

1 participant