Skip to content

fix: list failed preflight checks in CLI errors - #788

Merged
alongubkin merged 4 commits into
mainfrom
alon/alien-1106-cli-shows-validation-failed-with-n-errors-without-the-failed
Sep 30, 2026
Merged

alongubkin merged 4 commits into
mainfrom
alon/alien-1106-cli-shows-validation-failed-with-n-errors-without-the-failed

Conversation

@alongubkin

@alongubkin alongubkin commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Fixes ALIEN-1106.

Problem

When stack preflights fail, the text output said only:

Validation failed with 3 errors and 1 warnings

The failed checks themselves are in the ValidationFailed error's results, which the human error renderer never printed. Finding out what failed needed --json and walking the nested results[].errors arrays.

Fix

render_human_error (used for every CLI error in text mode) now finds the first error in the chain that carries preflight results, and prints each failed check's errors under Failed checks:, the same way it already prints Build output: for image build failures. JSON output is unchanged.

alien render flattened the preflight error to text, which dropped the results. It now keeps the preflight error as the source (the top-level message is unchanged), so render failures list the checks too.

The added section, from the test:

Failed checks:
  - Input 'apiKey' is not deployer-provided
  - A source-built sandbox must be Live

Tests

  • New render_human_error_lists_every_failed_preflight_check: a real alien_preflights ValidationFailed error with three check results (one passing), wrapped in a CLI error, renders both failed checks' messages in order.
  • New failed_render_preflights_list_the_failed_checks: the real AWS render preflights on a stack with a Frozen container list that check's message (fails with the old conversion).
  • cargo test -p alien-cli --lib -- render ui:: passes.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds preflight check details to CLI error messages.

The PR appears safe to merge, with only a non-blocking duplicate summary in human render errors.

Fix All in CodexFindings

  1. P2 Preflight summary appears twice ▶
Fix with agent prompt
### Issue 1
crates/alien-cli/src/commands/render.rs:449
When `alien render` fails a preflight, the top-level message includes the validation counts, and the retained preflight error prints those counts again under `Cause:`. This makes the human error harder to scan before the failed checks are listed.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR lists failed preflight checks in human CLI errors and retains structured preflight results for alien render.

  • The latest change restores validation counts in the render error’s top-level message.
  • Human render errors now repeat that count summary in the cause.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Render preflight failure] --> B[Configuration error with preflight source]
  B --> C[Human error: summary, cause, failed checks]
  B --> D[JSON error: top-level message and structured source]
Loading

Reviews (4) · Last reviewed commit: "fix: keep the preflight summary as rende..."

Comment thread crates/alien-cli/src/ui.rs
Comment thread crates/alien-cli/src/ui.rs Outdated
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai

Comment thread crates/alien-cli/src/commands/render.rs Outdated
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai

Comment thread crates/alien-cli/src/commands/render.rs
@alongubkin
alongubkin merged commit f6e7484 into main Sep 30, 2026
22 checks passed
@alongubkin
alongubkin deleted the alon/alien-1106-cli-shows-validation-failed-with-n-errors-without-the-failed branch September 30, 2026 15:55
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