Skip to content

Split Admin CLI into modules per technology#3947

Open
dimas-b wants to merge 4 commits intoapache:mainfrom
dimas-b:admin-refactor
Open

Split Admin CLI into modules per technology#3947
dimas-b wants to merge 4 commits intoapache:mainfrom
dimas-b:admin-refactor

Conversation

@dimas-b
Copy link
Contributor

@dimas-b dimas-b commented Mar 6, 2026

  • Introduce polairs-admin-base for shared commands

  • Move NoSQL commands to polaris-persistence-nosql-admin

  • Make NoSQL commands optional with build property: ExcludeNoSqlPersistence as proposed in Add build-time flags to produce Admin CLI without NoSQL dependencies #3867

  • Move JDBC-specific dependencies for admin commands to polaris-relational-jdbc-admin

  • CDI-based Sub-command discovery is handled by AdminCliConfiguration

  • Add dedicated admin test modules per persistence technology (JDBC / NoSQL)

  • Move default quarkus properties to runtime-admin-defaults to allow downstream projects to not include them.

  • Downstream builds are advised to depend on individual command modules (noted above) and have local application.properties, but not depend on runtime-admin, which serves as the Admin CLI distribution assembly module for Apache Polaris releases.

Closes #3867

This change also addresses most of concerns from #3855.

Checklist

  • 🛡️ Don't disclose security issues! (contact security@apache.org)
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

@github-project-automation github-project-automation bot moved this to PRs In Progress in Basic Kanban Board Mar 6, 2026
@dimas-b dimas-b force-pushed the admin-refactor branch 2 times, most recently from 93accb2 to c0d59ce Compare March 6, 2026 20:10
@dimas-b dimas-b requested review from clambertus and flyrain and removed request for clambertus March 12, 2026 13:54
* Quarkus will find CLI commands only if they are `@Default`, so `@ApplicationScoped` cannot be
* applied to them... hence the workaround with this placeholder just to hold the
* `@ApplicationScoped` annotation.
*/
Copy link
Member

Choose a reason for hiding this comment

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

I understand the workaround. I just wonder if it's actually required ?

Copy link
Contributor Author

@dimas-b dimas-b Mar 16, 2026

Choose a reason for hiding this comment

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

Yes. Quarkus does not "see" custom qualifiers (like @AdminSubCommand). Since persistence/nosql/admin/cmd does not have any standard "bean-defining" annotations, Quarkus will not consider it when looking for @AdminSubCommand implementations.

I guess this is an interplay of some not-so-standard Quarkus approach to implementing CLI (note that Quarkus considered only @Default beans for CLI commands) and me wanting to leverage @AdminSubCommand to allow pluggable CLI modules.

public abstract class BaseNoSqlCommand extends BaseCommand {
@Inject protected Backend backend;

public BaseNoSqlCommand() {
Copy link
Member

Choose a reason for hiding this comment

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

nit: Do we really need this constructor ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thx - leftover... removing

@AdminSubCommand
@Default
public class NoSqlCommand extends BaseNoSqlCommand {
@Inject protected Backend backend;
Copy link
Member

Choose a reason for hiding this comment

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

backend is already defined in BaseNoSqlCommand. Do we really need to override it there ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably not... It was there before, I just did not notice 😅 Thx for the pointer - removing.

dimas-b added 2 commits March 16, 2026 08:52
* Introduce `polairs-admin-base` for shared commands

* Move NoSQL commands to `polaris-persistence-nosql-admin`

* Make NoSQL commands optional with build property: `ExcludeNoSqlPersistence` as proposed in apache#3867

* Move JDBC-specific dependencies for admin commands to `polaris-relational-jdbc-admin`

* CDI-based Sub-command discovery is handled by `AdminCliConfiguration`

* Add dedicated admin test modules per persistence technology (JDBC / NoSQL)

* Move default quarkus properties to `runtime-admin-defaults` to allow downstream projects to _not_ include them.

* Downstream builds are advised to depend on individual command modules
  (noted above) and have local `application.properties`, but not depend
  on `runtime-admin`, which serves as the Admin CLI distribution assembly
  module for Apache Polaris releases.

Closes apache#3867

This change also addresses most of concerns from apache#3855.
@dimas-b
Copy link
Contributor Author

dimas-b commented Mar 16, 2026

Note: I rebased to include new tests from #3352

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.

Add build-time flags to produce Admin CLI without NoSQL dependencies

2 participants