Command extension plugins - #702
Open
jkloetzke wants to merge 10 commits into
Open
Conversation
Let plugins register additional top-level "bob <name>" commands. These commands cannot replace build-in commands, though. Bob will handle standard options like -D, -c and sandbox modes.. The plugin get's the parsed package graph together with the remaining options. Since plugin command names can only be discovered by parsing layers and loading plugins, "bob <unknown-name>" now carries that additional parsing cost before reporting the error. Also, any config.yaml parsing error will be visible before an unknown command can be rejected. Likewise, "bob -h" itself does not display any plugin defined commands because it's help text is generated before any recipes are parsed.
The Bob error classes are used by plugins since a long time. Make them part of the official plugin API and add some documentation.
The first phase loads configuration files and plugins. The second phase actually parses the recipes, classes and aliases. No change in functionality.
This does not read recipes, which is what usually takes a noticeable time already. This is intended to be used for help about plugin provided commands.
Add the -a/--all option to "bob help". With that, also plugin provided commands are shown.
The manual validation of the plugin manifest data is error prone. Refactor to use the schema module for that. This should better catch any type deviations. The new approach will also now catch any typos. Previously, this would have gone unnoticed. Strictly speaking, this is a breaking change. Let's keep our fingers crossed that no plugins are out there that have data in their manifest that was ignored by Bob so far.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #702 +/- ##
==========================================
- Coverage 89.23% 89.19% -0.04%
==========================================
Files 50 50
Lines 16450 16430 -20
==========================================
- Hits 14679 14655 -24
- Misses 1771 1775 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Add the possibility for plugins to define new Bob commands. They will get the parsed package graph. Compared to project generators, they are not intended to build anything but to work on the package graph directly.