Repository navigation
fix(steps): expose shell and atmos outputs to later steps - #2785
Conversation
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
Maintainer action requested: please approve the first-time-contributor workflow runs and add the |
📝 WalkthroughWalkthroughChangesShell and atmos steps now capture stdout and stderr, store trimmed command results with metadata and declared outputs, and expose them to later steps. Local, container, workflow, and custom-command paths include coverage for masking, retries, output suppression, and terminal sessions. Step output capture
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant CommandStep
participant runCommandStep
participant ShellOrAtmos
participant StepResultStore
participant LaterStep
CommandStep->>runCommandStep: execute named step
runCommandStep->>ShellOrAtmos: provide capture writers
ShellOrAtmos-->>runCommandStep: stdout and stderr
runCommandStep->>StepResultStore: store value and metadata
LaterStep->>StepResultStore: resolve .steps.<name>
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/runner/step/command_result.go`:
- Around line 13-33: Update ExecuteAndStoreCommandResult and its callers in
workflow_utils.go to distinguish errors returned by run from failures in
vars.SetWithOutputs/output-template evaluation, using a sentinel or wrapped
error type as appropriate. Ensure retry handling re-executes the command only
for command failures and does not invoke run again after a successful command
whose result post-processing fails.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8cd09c37-8f74-4622-be46-921701714d6e
📒 Files selected for processing (15)
cmd/cmd_utils.gocmd/custom_command_integration_test.gocmd/custom_command_step_output_test.gocmd/testing_main_test.godocs/fixes/2026-07-22-shell-atmos-step-output-capture.mdinternal/exec/workflow_step_output_capture_test.gointernal/exec/workflow_utils.gointernal/exec/workflow_utils_test.gopkg/runner/step/command_result.gopkg/runner/step/command_result_test.gopkg/workflow/container.gopkg/workflow/container_helpers_test.gopkg/workflow/container_test.gowebsite/docs/cli/configuration/commands/command/steps.mdxwebsite/docs/workflows/workflows/workflow/steps/outputs.mdx
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2785 +/- ##
==========================================
+ Coverage 81.69% 81.73% +0.04%
==========================================
Files 1778 1779 +1
Lines 170743 170835 +92
==========================================
+ Hits 139481 139638 +157
+ Misses 23528 23467 -61
+ Partials 7734 7730 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Evaluate declared outputs once after successful shell and atmos execution so template errors cannot rerun completed commands.
|
CodeRabbit (@coderabbitai) review |
✅ Action performedReview finished.
|
|
Maintainer action requested: please approve the workflow runs for current head |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
cmd/custom_command_step_output_test.go (1)
115-229: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMasking/suppression tests only cover
shell, unlike the sibling tests in this file.
TestCustomCommandShellMasksLiveAndStoredOutputandTestCustomCommandShellOutputNoneCapturesWithoutStreaminghardcodeType: "shell", while the legacy-output test above and the retry test below both loop over[]string{"shell", "atmos"}. Given the PR objective to preserve masked live streaming and suppression across both step types, extending these two tests to the same loop would close a coverage gap for theatmospath with minimal new code (the pattern already exists in this file).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cmd/custom_command_step_output_test.go` around lines 115 - 229, Extend TestCustomCommandShellMasksLiveAndStoredOutput and TestCustomCommandShellOutputNoneCapturesWithoutStreaming to iterate over both step types, []string{"shell", "atmos"}, following the existing loop pattern in the neighboring tests. Apply the selected type to each relevant task and keep the current masking, suppression, capture, and assertions unchanged for both paths.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/runner/step/command_result_test.go`:
- Around line 18-20: In the subtest containing ApplyMaskingConfig and
Masker().RegisterValue, register a t.Cleanup callback that uses the package’s
established masking reset/restore helper to restore the prior global iolib
state. Keep the existing masking setup and secret registration unchanged.
---
Nitpick comments:
In `@cmd/custom_command_step_output_test.go`:
- Around line 115-229: Extend TestCustomCommandShellMasksLiveAndStoredOutput and
TestCustomCommandShellOutputNoneCapturesWithoutStreaming to iterate over both
step types, []string{"shell", "atmos"}, following the existing loop pattern in
the neighboring tests. Apply the selected type to each relevant task and keep
the current masking, suppression, capture, and assertions unchanged for both
paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a1a28fdd-2d56-4065-b403-f2f324663734
📒 Files selected for processing (9)
cmd/cmd_utils.gocmd/custom_command_integration_test.gocmd/custom_command_step_output_test.godocs/fixes/2026-07-22-shell-atmos-step-output-capture.mdinternal/exec/workflow_step_output_capture_test.gointernal/exec/workflow_utils.gopkg/runner/step/command_result.gopkg/runner/step/command_result_test.gowebsite/docs/workflows/workflows/workflow/steps/outputs.mdx
🚧 Files skipped from review as they are similar to previous changes (6)
- docs/fixes/2026-07-22-shell-atmos-step-output-capture.md
- website/docs/workflows/workflows/workflow/steps/outputs.mdx
- cmd/cmd_utils.go
- internal/exec/workflow_step_output_capture_test.go
- cmd/custom_command_integration_test.go
- internal/exec/workflow_utils.go
Suppress live custom-command atmos streams while retaining captured results, extend masking and suppression coverage to both command step types, and reset masking state after tests.
|
CodeRabbit (@coderabbitai) review |
|
Maintainer action requested: please approve the workflow runs for current head |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@cmd/custom_command_step_output_test.go`:
- Around line 236-244: Strengthen the assertions around captureStdoutStderr in
the customCmd.Run test to verify both "produced" and "warning" are absent from
both stdout and stderr. Keep the existing result-file assertion unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 223e840f-d8b9-450a-97a9-be1c4f8e0dc3
📒 Files selected for processing (4)
cmd/cmd_utils.gocmd/custom_command_step_output_test.godocs/fixes/2026-07-22-shell-atmos-step-output-capture.mdpkg/runner/step/command_result_test.go
🚧 Files skipped from review as they are similar to previous changes (3)
- docs/fixes/2026-07-22-shell-atmos-step-output-capture.md
- pkg/runner/step/command_result_test.go
- cmd/cmd_utils.go
|
Maintainer action requested: please approve workflow runs for current head |
|
CodeRabbit (@coderabbitai) review |
✅ Action performedReview finished.
|
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
These changes were released in v1.223.1-rc.4. |
what
shellandatmossteps in customcommands and workflows.
.value, masked stdout/stderr/exit-code metadata, and declaredoutputs through
.steps.<name>.retry envelope.
overrides.
shellandatmosoutput: none, terminal sessions, process cleanup, and failurepropagation.
guidance.
terminal sessions, output-template failures, and container execution.
why
shellandatmosexecution bypassedStepExecutorresult storage.map has no entry for key "<name>", evenafter the producer completed successfully.
child-process cleanup issues while satisfying the documented step-output
contract.
cannot expose registered secrets.
repeating a successful, potentially non-idempotent command.
validation
shell/atmoscommand-step PRDs../cmd,./internal/exec,./pkg/runner/step, and./pkg/workflow.output: nonebehavior for custom-commandshellandatmossteps.go build ./....upstream/main.unrelated AWS/XDG assertions and an acceptance-test timeout caused the overall
local run to remain nonzero.
references
shell/atmossteps don't populate.steps.<name>(documented step outputs contract broken) #2781shellandatmosstep-type PRDSummary by CodeRabbit
shellandatmosis now consistent across local and container execution, including retries and named declared outputs (value, stdout, stderr, exit code).output: nonenow suppresses streamed output while preserving stored results for downstream steps.