Skip to content

Enable automatic plugin registration in middleware#930

Open
t1m0thyj wants to merge 19 commits intomainfrom
dev/fix-sample-plugin
Open

Enable automatic plugin registration in middleware#930
t1m0thyj wants to merge 19 commits intomainfrom
dev/fix-sample-plugin

Conversation

@t1m0thyj
Copy link
Copy Markdown
Member

@t1m0thyj t1m0thyj commented Apr 12, 2026

What It Does

Also fixes #929

How to Test

Run zowex server and execute an RPC plug-in command:
{"id":1,"jsonrpc":"2.0","method":"sample.hello","params":{"name":"doggo"}}

Review Checklist
I certify that I have:

Additional Comments

zFernand0 and others added 14 commits April 1, 2026 12:43
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj t1m0thyj requested review from traeok and zFernand0 April 12, 2026 02:57
@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Apr 12, 2026
@zowe-robot zowe-robot moved this from New Issues to Review/QA in Zowe CLI Squad Apr 12, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 12, 2026

Copy link
Copy Markdown
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

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

Thanks Timothy, changes look good but I have a couple requests around separation of concerns

Comment thread native/c/commands/server.cpp Outdated
Comment thread native/c/server/plugin_bridge.cpp Outdated
@dkelosky
Copy link
Copy Markdown
Collaborator

Can you share a little more about what this does exactly? I'm not clear what automatic registration means

Base automatically changed from zf/refactor-examples to main April 13, 2026 18:25
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
@t1m0thyj
Copy link
Copy Markdown
Member Author

Can you share a little more about what this does exactly? I'm not clear what automatic registration means

Currently for commands that are added to core zowex, there is a separate process involved to register commands with the middleware that involves generating interfaces to provide schema validation at runtime.

The automatic registration is something unique to plug-ins since we don't have a way for them to directly register commands with the middleware. it allows plug-in APIs to be called via the middleware, but doesn't provide schema validation.

I think long-term it'd be ideal to refactor our middleware command registration, to eliminate tech debt:

  1. so that we don't have to register core commands in 2 places
  2. so that plug-ins can take advantage of schema validation

Created #937 to track these as future enhancements 😋

@t1m0thyj t1m0thyj requested a review from traeok April 14, 2026 13:59
Comment thread native/c/commands/server.cpp Outdated
Comment thread native/c/extend/plugin.cpp Outdated
Comment thread native/c/server/plugin_bridge.cpp Outdated
Comment thread native/c/extend/plugin.cpp
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Copy link
Copy Markdown
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

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

Thanks Timothy, LGTM

void register_commands_with_server(CommandDispatcher &dispatcher)
{
const std::set<parser::command_ptr> &server_commands = pm.get_server_commands();
const auto &server_commands = core::get_plugin_manager()->get_server_commands();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(nit) since core::get_plugin_manager returns a pointer, security scanning tools could flag it as possible use of an invalid pointer. That said, its always valid when this function is called, so I'm not requesting changes - but a sanity check for nullptr would avoid any false positive detections.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Review/QA

Development

Successfully merging this pull request may close these issues.

TD: Plug-in Manager fails with a S0C4 because of a NULL output_stream

5 participants