Skip to content

Command extension plugins - #702

Open
jkloetzke wants to merge 10 commits into
BobBuildTool:masterfrom
jkloetzke:cmd-plugins
Open

Command extension plugins#702
jkloetzke wants to merge 10 commits into
BobBuildTool:masterfrom
jkloetzke:cmd-plugins

Conversation

@jkloetzke

Copy link
Copy Markdown
Member

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.

jkloetzke added 10 commits July 20, 2026 22:28
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

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.96774% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.19%. Comparing base (7b00892) to head (4b6c3fd).

Files with missing lines Patch % Lines
pym/bob/cmds/help.py 0.00% 21 Missing ⚠️
pym/bob/input.py 81.35% 11 Missing ⚠️
pym/bob/scripts.py 82.60% 4 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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