Skip to content

fix: surface a failing bootstrap_command instead of implying success#34

Merged
anilcancakir merged 2 commits into
masterfrom
fix/surface-failing-bootstrap-exit-code
Jun 25, 2026
Merged

fix: surface a failing bootstrap_command instead of implying success#34
anilcancakir merged 2 commits into
masterfrom
fix/surface-failing-bootstrap-exit-code

Conversation

@anilcancakir

Copy link
Copy Markdown
Contributor

Summary

plugin:install discarded the bootstrap subprocess ProcessResult and only handled the notResolvable case, so a chained bootstrap_command that exited non-zero (stale fast-CLI bundle, unknown command, scaffold error) was reported to the operator as if it had completed.

A from-scratch install QA hit exactly this: the chained starter:install failed silently and the manifest post_install message still claimed the scaffold had succeeded, leaving lib/config/magic_starter.dart absent with no signal to the user.

Change

  • BootstrapCommandRunner.run now returns a BootstrapRunResult carrying the subprocess exitCode and captured stderr (previously it returned a bare BootstrapRunOutcome enum and threw the ProcessResult away).
  • plugin:install warns with the exit code + stderr and prints the manual bootstrap hint when the chained command exits non-zero. The success path stays quiet; a failure to resolve a dispatcher still falls back to the hint as before.

Tests

  • Runner: exit-code + stderr propagation on failure; succeeded true on zero exit.
  • plugin:install: a non-zero bootstrap exit warns (exited with code N + stderr) and hints, without failing the install.
  • dart test: 1185 tests green; dart analyze + dart format clean.

Author: Anılcan Çakır anilcan.cakir@gmail.com

plugin:install discarded the bootstrap subprocess ProcessResult and only
checked the notResolvable case, so a chained bootstrap_command that exited
non-zero (stale fast-CLI bundle, unknown command, scaffold error) was reported
to the operator as if it had completed. A from-scratch install QA hit this:
the chained starter:install failed silently and the manifest post_install
message still claimed the scaffold succeeded.

BootstrapCommandRunner.run now returns a BootstrapRunResult carrying the
subprocess exit code and captured stderr. plugin:install warns with the exit
code + stderr and prints the manual bootstrap hint when the chained command
exits non-zero; the success path stays quiet.

Tests: runner exit-code/stderr propagation + succeeded() on zero exit; a
non-zero bootstrap exit warns + hints without failing the install.
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes plugin:install reporting a chained bootstrap_command as if it succeeded even when the spawned dispatcher subprocess exits non-zero, by preserving and surfacing the subprocess result (exit code and stderr) to the operator.

Changes:

  • Introduce BootstrapRunResult to carry exitCode and captured stderr from BootstrapCommandRunner.run.
  • Update plugin:install to warn (exit code + stderr) and print the manual bootstrap hint when the chained command exits non-zero, while keeping install best-effort.
  • Add/adjust unit tests to cover exit-code/stderr propagation and the non-zero bootstrap warning path; update CHANGELOG.md.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/src/commands/helpers/bootstrap_command_runner.dart Adds BootstrapRunResult and returns subprocess exit code/stderr from run.
lib/src/commands/plugin_install_command.dart Warns and hints when the bootstrap subprocess exits non-zero.
test/commands/helpers/bootstrap_command_runner_test.dart Extends tests to assert exit code/stderr propagation and succeeded semantics.
test/commands/plugin_install_command_test.dart Adds coverage for non-zero bootstrap exit warning + hint behavior.
CHANGELOG.md Documents the fix under [Unreleased].

Comment thread lib/src/commands/helpers/bootstrap_command_runner.dart Outdated
… code

Addresses review feedback: new public types follow the final class
convention, and an assert invariant prevents constructing an invoked result
without an exit code (which could surface as 'exited with code null').
@anilcancakir
anilcancakir merged commit df9eabc into master Jun 25, 2026
2 checks passed
@anilcancakir
anilcancakir deleted the fix/surface-failing-bootstrap-exit-code branch June 25, 2026 12:48
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.

2 participants