Skip to content

feat: auto-run manifest bootstrap_command on plugin:install (#4a)#32

Merged
anilcancakir merged 2 commits into
masterfrom
feat/plugin-install-bootstrap-autorun
Jun 25, 2026
Merged

feat: auto-run manifest bootstrap_command on plugin:install (#4a)#32
anilcancakir merged 2 commits into
masterfrom
feat/plugin-install-bootstrap-autorun

Conversation

@anilcancakir

Copy link
Copy Markdown
Contributor

What

A manifest bootstrap_command was hint-only. Run it automatically after a successful manifest install, via a fresh dispatcher subprocess (./bin/fsa <cmd> --non-interactive when present, else dart run <consumer>:artisan <cmd> --non-interactive).

  • Always forwards --non-interactive so a chained interactive install cannot hang.
  • Honors the --bootstrap-command override and the --no-bootstrap opt-out.
  • Falls back to the one-line hint when no dispatcher resolves.
  • New BootstrapCommandRunner uses an injectable process seam so unit tests assert the invocation without spawning a process.

Why

Generic plugin:install only injected the provider; the full plugin scaffold lives behind a bootstrap command the user had to run manually (#4). Built inside the existing _runManifestFlow (no fourth routing branch).

Verification

Failing-first tests (declared command spawns; --no-bootstrap suppresses; no command invokes nothing) plus override + hint fallback. dart test 1169 green, coverage 84.70% (gate 80%), dart analyze + format clean. Doc + skill + CHANGELOG synced. Blast radius: only plugins declaring bootstrap_command (today, magic_starter).

Addresses REPORT.md #4 (artisan side).

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...src/commands/helpers/bootstrap_command_runner.dart 87.50% 3 Missing ⚠️
lib/src/commands/plugin_install_command.dart 87.50% 2 Missing ⚠️

📢 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 upgrades the manifest-based plugin:install flow to automatically run a plugin’s declared bootstrap_command after a successful install by spawning a fresh dispatcher subprocess, ensuring newly-registered plugin commands are available immediately.

Changes:

  • Auto-runs bootstrap_command (or --bootstrap-command override) after manifest install registration, with --no-bootstrap opt-out and a hint fallback when no dispatcher resolves.
  • Adds BootstrapCommandRunner with an injectable process seam and new unit tests covering dispatcher resolution and command chaining behavior.
  • Syncs documentation, skills references, and CHANGELOG with the new behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lib/src/commands/plugin_install_command.dart Runs manifest bootstrap command post-registration via a subprocess runner; updates hint behavior.
lib/src/commands/helpers/bootstrap_command_runner.dart New helper to resolve ./bin/fsa vs dart run <consumer>:artisan and invoke the bootstrap command.
test/commands/plugin_install_command_test.dart Adds tests asserting auto-run behavior, opt-out, override precedence, and hint fallback.
test/commands/helpers/bootstrap_command_runner_test.dart New tests validating dispatcher resolution and --non-interactive forwarding without spawning processes.
doc/plugins/install-yaml.md Documents automatic bootstrap execution, dispatcher resolution order, and opt-out/override flags.
skills/fluttersdk-artisan/references/cli-commands.md Updates plugin:install signature and describes the new auto-run behavior.
CHANGELOG.md Adds an Unreleased entry describing the behavioral change and its dispatch rules.

Comment thread lib/src/commands/plugin_install_command.dart Outdated
Comment thread lib/src/commands/plugin_install_command.dart
Comment thread lib/src/commands/helpers/bootstrap_command_runner.dart
A manifest bootstrap_command was hint-only. Run it automatically after a
successful manifest install via a fresh dispatcher subprocess (./bin/fsa
when present, else dart run <consumer>:artisan), always forwarding
--non-interactive so a chained interactive install cannot hang. Honor the
--bootstrap-command override and --no-bootstrap opt-out; fall back to the
hint when no dispatcher resolves. The runner uses an injectable process
seam so unit tests assert the invocation without spawning a process.
Addresses review on #32: (1) wrap the post-install bootstrap auto-run in try/catch so a runner failure (dart missing, bin/fsa not executable) warns and falls back to the manual hint instead of crashing plugin:install; (2) correct the --no-bootstrap help text to 'Skip auto-running the plugin bootstrap command' (it skips the auto-run, not the hint); (3) guard _readConsumerName against FileSystemException, treating an unreadable pubspec as not-resolvable.
@anilcancakir anilcancakir force-pushed the feat/plugin-install-bootstrap-autorun branch from 503af37 to 6cef11f Compare June 25, 2026 10:47
@anilcancakir anilcancakir merged commit 4be4082 into master Jun 25, 2026
2 checks passed
@anilcancakir anilcancakir deleted the feat/plugin-install-bootstrap-autorun branch June 25, 2026 10:50
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