feat: auto-run manifest bootstrap_command on plugin:install (#4a)#32
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
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-commandoverride) after manifest install registration, with--no-bootstrapopt-out and a hint fallback when no dispatcher resolves. - Adds
BootstrapCommandRunnerwith 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. |
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.
503af37 to
6cef11f
Compare
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.
What
A manifest
bootstrap_commandwas hint-only. Run it automatically after a successful manifest install, via a fresh dispatcher subprocess (./bin/fsa <cmd> --non-interactivewhen present, elsedart run <consumer>:artisan <cmd> --non-interactive).--non-interactiveso a chained interactive install cannot hang.--bootstrap-commandoverride and the--no-bootstrapopt-out.BootstrapCommandRunneruses an injectable process seam so unit tests assert the invocation without spawning a process.Why
Generic
plugin:installonly 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-bootstrapsuppresses; no command invokes nothing) plus override + hint fallback.dart test1169 green, coverage 84.70% (gate 80%),dart analyze+ format clean. Doc + skill + CHANGELOG synced. Blast radius: only plugins declaringbootstrap_command(today, magic_starter).Addresses REPORT.md #4 (artisan side).