Repository navigation
Show pipeline structure in alias announcements - #2092
Merged
Merged
Conversation
Aliases now print a structured summary of their pipeline (e.g., `Running alias deploy: install; build, lint`) instead of the bare `Running alias deploy`. The hook and alias formatters now share a `format_pipeline_summary_from_names` helper that takes per-step names plus label closures — hooks pass `source:` prefixes and unnamed-count fallbacks, aliases pass plain names and skip unnamed. Concurrent execution stays separate between alias (`thread::scope` + blocking `execute_shell_command`) and the background pipeline runner (raw `Child` handles + log-file redirect). Bridging the two would require either making the streaming executor non-blocking or running background commands in threads they don't need. A module-level doc comment in `alias.rs` explains the divergence. Adds `WORKTRUNK_TEST_SERIAL_CONCURRENT=1` (mirroring the `RAYON_NUM_THREADS=1` pattern in `step_prune` tests), honored by both alias and background concurrent paths, so the new integration test for the announcement can use meaningful `echo INSTALL/BUILD/LINT` commands and still produce a deterministic snapshot. Co-Authored-By: Claude <[email protected]>
worktrunk-bot
left a comment
Collaborator
There was a problem hiding this comment.
The shared format_pipeline_summary_from_names refactor is clean — walking through it against the five hook tests (_named, _unnamed, _mixed_named_unnamed, _single_unnamed, _concurrent_then_concurrent) confirms the extracted helper is behaviorally equivalent for the hook side, and the new alias unit tests cover the zero-fallback variant. Nice doc comment explaining the alias vs. run_pipeline concurrency divergence.
One scope observation on run_pipeline.rs — posted inline. It's the source of the codecov/patch failure and is arguably the kind of "design for hypothetical future requirements" the CLAUDE.md guidance warns against.
Two new tests in post_start_commands.rs exercise the serial branch added to run_concurrent_group: - test_post_start_concurrent_serial_force: two named commands append to the same file; deterministic FIRST\nSECOND ordering proves they ran one at a time. - test_post_start_concurrent_serial_bails_on_failure: first command fails; second's marker file must not appear, exercising the bail-on-failure path inside the serial branch. Closes the codecov/patch gap on PR #2092. Co-Authored-By: Claude <[email protected]>
worktrunk-bot
approved these changes
Apr 11, 2026
Resolves conflicts with #2095 (refactor: unify lazy template expansion and concurrent-group waits) which independently: - Added `wait_first_error` and `expand_shell_template` helpers in command_executor.rs - Refactored AliasExecCtx::run and the alias concurrent block - Refactored run_concurrent_group to use the new helpers Resolution: - alias.rs: combine my serial-test branch with main's `wait_first_error` scaffolding (the non-serial path now delegates to it) - run_pipeline.rs: my serial branch sits inside the per-command loop; the concurrent path uses the merged helpers (`step_context`, `expand_shell_template`, `wait_first_error`) Co-Authored-By: Claude <[email protected]>
worktrunk-bot
approved these changes
Apr 11, 2026
max-sixty
added a commit
that referenced
this pull request
Apr 12, 2026
One-line doc comment on `format_pipeline_summary_from_names` noting that unnamed commands within a `Concurrent` step aren't reachable from config today — TOML named tables always produce all-named commands. The unnamed-flush logic only fires across step boundaries in practice. Follow-up to #2092. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
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.
Summary
Two follow-ups to the recently-merged unify-hook-alias work (#2089):
Pipeline announcement. Aliases now print a structured summary of their pipeline (e.g.,
Running alias deploy: install; build, lint) instead of the bareRunning alias deploy. Hook and alias formatters share a newformat_pipeline_summary_from_nameshelper that takes per-step names plus label closures — hooks passsource:prefixes with unnamed-count fallbacks, aliases pass plain names and skip unnamed (no natural fallback label likeuser/project).Concurrent execution stays separate. I considered unifying
AliasExecCtx::run(usesthread::scopebecauseexecute_shell_commandis a blocking streaming call) withrun_concurrent_groupinrun_pipeline.rs(uses rawChildhandles + log-file redirection). The leaf primitives diverge — one needs threads because the streaming executor blocks, the other uses processes directly — and bridging them requires either making the streaming executor non-blocking (entangled with signal forwarding, ANSI reset,Cmdtracing) or threading background commands that don't need it. A module-level doc comment inalias.rsexplains the divergence so the next person doesn't repeat the analysis.Test escape hatch. Adds
WORKTRUNK_TEST_SERIAL_CONCURRENT=1honored by both concurrent paths, mirroring theRAYON_NUM_THREADS=1pattern instep_prunetests. Lets snapshot tests use meaningful command output (e.g.,echo INSTALL/BUILD/LINT) and still produce a deterministic ordering.Test plan
format_alias_announcement(single unnamed, all-unnamed pipeline, concurrent named, pipeline named, mixed named/unnamed)test_alias_pipeline_announcementexercising the alias pathpost_start_commands.rs(test_post_start_concurrent_serial_force,test_post_start_concurrent_serial_bails_on_failure) exercising the background pipeline runner's serial branch — happy path (deterministic append ordering) and failure path (bail-on-first, second never runs)wt hook pre-merge --yes(3030 tests, all green)🤖 Generated with Claude Code