UNOMI-880 UNOMI-878 UNOMI-139: Karaf dev shell commands#763
Merged
Conversation
2419ae7 to
a7c5f92
Compare
7cb94e6 to
8fef941
Compare
a7c5f92 to
39595c8
Compare
8fef941 to
70b8c49
Compare
39595c8 to
3bc0172
Compare
70b8c49 to
7897291
Compare
3bc0172 to
219abb7
Compare
7897291 to
03481dd
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 31 changed files in this pull request and generated 10 comments.
Comments suppressed due to low confidence (1)
tools/shell-dev-commands/src/main/java/org/apache/unomi/shell/dev/commands/scheduler/SetExecutorNodeCommand.java:27
- This command claims it can change executor participation, but SchedulerService doesn’t expose any API to enable/disable executor mode (the setter is commented out). As written, passing an argument prints a success message without actually changing anything, which is misleading for operators and will diverge from the PR description.
a4d2d2d to
ad94a66
Compare
03481dd to
d9512ab
Compare
Add cache, scheduler, tenant/api-key, and json-schema CRUD dev shell commands with integration tests. Wire unomi-json-schema-shell-commands into Karaf feature and BOM.
d9512ab to
b5003e0
Compare
- ApiKeyCrudCommand: fix NPE on null apiKey return from generateApiKeyWithType; fix ClassCastException when validityPeriod is passed as a String - SchedulerServiceImpl.deleteTask: cancel any in-flight execution before removing the persistence record, preventing task resurrection on completion - PurgeTasksCommand: fix pagination offset advancing by full batchSize even when tasks are deleted, which caused records to be skipped - GraphQLListIT: fix flaky test by moving refreshPersistence(Profile.class) inside the keepTrying loop so each retry sees the latest ES state after the async cdp-list-update event is processed
…robustness improvements Add PollingUtils, a generic poll-until-predicate utility with full unit test coverage (13 cases: validation, success paths, exhaustion, null returns, supplier exceptions, and interruption handling). Fix ApiKeyCrudCommand.create() to guard setName/setDescription individually so that providing only one field does not silently null out the other. Simplify read() and SchemaCrudCommand.getItems() with stream pipelines. Add per-task try-catch in PurgeTasksCommand so a single deletion failure does not abort the purge loop. Add missing exception handling in CacheCommands.viewCacheEntry/removeCacheEntry and drop stale TODO comment. Move Elasticsearch eventual-consistency handling for API keys out of production code and into the integration test using waitForCondition, matching the pattern used by other CRUD tests. Add testCacheRemove IT, fix tautological assertions in cache and rule-statistics ITs, fix regex usage in SchedulerCommandsIT, and clean up stale Javadoc in ShellCommandsBaseIT. Minor Javadoc additions in SchedulerService and MultiTypeCacheService.
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.
Stacked PR (merge order)
UNOMI-904-v2-api-compatibility(#762)UNOMI-880-878-shell-dev-commandsMerge #762 (and its base #760) before this PR.
JIRA
Summary
Adds Karaf developer shell commands in
tools/shell-dev-commands/so operators and developers can manage caches, scheduled tasks, tenants, API keys, and JSON schemas from the console. This PR delivers the shell UX and integration tests; platform services (caching core,SchedulerService, tenant APIs) are on #760.UNOMI-880 — Cache management (
unomi:cache)CacheCommandsexposes tenant-aware cache operations aligned withMultiTypeCacheService:--stats,--reset,--type,--tenant--clear,--inspect,--watch,--view,--removeIT:
CacheCommandsITUNOMI-878 — Scheduler task shell
Commands on top of the cluster-aware
SchedulerServicefrom the platform PR:unomi:task-listunomi:task-showunomi:task-cancelunomi:task-retryunomi:task-purgeunomi:task-executorIT:
SchedulerCommandsIT(shell commands; platform scheduler REST coverage is separate)UNOMI-139 — Multi-tenant shell
TenantContextHelper— current tenant in the shell sessionunomi:tenant-set/unomi:tenant-get— session tenant contexttenants/*,apikeys/*)TenantCompleterfor tab completionIT:
TenantCommandsITJSON Schema shell
extensions/json-schema/shell-commands/withSchemaCrudCommandunomi-shell-dev-commandsfeature and BOM (unomi-json-schema-shell-commands)Other shell ITs
CrudCommandsIT— exercisesunomi:crudfrom #755 (UNOMI-879) in the dev shell contextRuleStatisticsCommandsIT,TailCommandsIT,OtherCommandsITShellCommandsBaseITAllITsregisters the seven shell IT classes for this phase.Packaging
extensions/json-schema/pom.xml— addsshell-commandsmodulekar/src/main/feature/feature.xml— bundles json-schema shell commands with dev shell featurekar/pom.xml,bom/artifacts/pom.xml— dependency pinsLegacy placeholder commands under
org.apache.unomi.shell.commands(ProfileRemove,RuleView,SessionView,RuleRemove) are removed; scheduler/tenant commands live underorg.apache.unomi.shell.dev.commands.Out of scope (other PRs)
SchedulerServiceimplementation, REST/cxs/tasks, consumer wiringunomi:crudunified CRUD shelltools/shell-commands/migration (unomi:migrate)TenantIT,SchedulerIT, …)Tests
AllITs(Pax Exam / Karaf, same harness as other integration tests)Licence