Skip to content

UNOMI-139 UNOMI-880 UNOMI-878 UNOMI-884: Multi-tenant platform core#760

Open
sergehuber wants to merge 2 commits into
UNOMI-888-import-export-javadocfrom
UNOMI-139-platform
Open

UNOMI-139 UNOMI-880 UNOMI-878 UNOMI-884: Multi-tenant platform core#760
sergehuber wants to merge 2 commits into
UNOMI-888-import-export-javadocfrom
UNOMI-139-platform

Conversation

@sergehuber
Copy link
Copy Markdown
Contributor

@sergehuber sergehuber commented May 18, 2026

Stacked PR (merge order)

Role Branch
Base (merge into) UNOMI-888-import-export-javadoc
Head (this PR) UNOMI-139-platform

This PR is stacked: merge into UNOMI-888-import-export-javadoc first (PR #756, UNOMI-888), after that line is merged or rebased. Downstream PRs (UNOMI-904 V2 compat, dev shell, additional ITs, manual) will stack on UNOMI-139-platform.

For more information (each PR targets the branch below until the bottom merges): https://github.github.com/gh-stack/introduction/overview/


JIRA

Summary

Delivers the Unomi 3.1 platform core on top of UNOMI-888: multi-tenant execution, unified caching, cluster-aware scheduling, and V3 migration assets. Services, persistence, GraphQL, and REST are wired for V3 tenant resolution (API keys / roles).

Supersedes the platform scope of PR #757 (closed; monolith branch UNOMI-139-UNOMI-880-multitenancy). UNOMI-904 (V2 compatibility), dev shell commands, additional IT classes, and manual updates will follow in stacked PRs on this line.

UNOMI-139 Multi-tenancy

  • Tenant model and APIs (Tenant, TenantService, API keys, security/audit interfaces, quotas, lifecycle hooks) and tenantId on core types.
  • ExecutionContextManager and thread-local tenant context so services, persistence, and REST resolve the active tenant consistently.
  • Tenant-scoped persistence and definitions (Elasticsearch/OpenSearch), including system-tenant vs tenant-specific overrides.

UNOMI-880 Unified multi-tenant caching

  • MultiTypeCacheService / CacheableTypeConfig and AbstractMultiTypeCachingService for shared cache lifecycle, predefined item bundling, periodic refresh, and statistics.
  • Migrate DefinitionsServiceImpl and SegmentServiceImpl (and related paths) onto the unified cache; remove duplicated ad-hoc cache listeners where superseded.

UNOMI-878 Cluster-aware task scheduling

  • Replace legacy scheduler usage with SchedulerService (scheduled tasks, task executors, persistence-backed vs in-memory tasks, cluster coordination).
  • Integrate periodic work (cache refresh, cluster heartbeat, router scheduling, rule refresh paths) with the new scheduler.
  • Update dependents (e.g. Groovy actions service) to schedule work through the new API.

UNOMI-884 Migration to V3

  • Migration Groovy scripts and request bodies for 3.1.0 (tenant document IDs, system item ID fixes, tenant initialization, legacy queryBuilder updates).
  • Extended MigrationUtils and MigrationUtilsTest for the new steps aligned with multi-tenancy and index updates.

Tests

  • Platform integration tests updated (BaseIT, migration ITs, ScopeIT, and related suites).
  • Full integration test run verified locally with OpenSearch (./build.sh --integration-tests --use-opensearch).

Licence

Introduce the Unomi 3.1 platform core: tenant-scoped execution, unified
multi-type caching, cluster-aware scheduling, and 3.1.0 migration
tooling. REST layers use V3 tenant resolution and role-based auth.

UNOMI-139 — Multi-tenancy
- Tenant model and APIs (Tenant, TenantService, API keys, security and
  audit hooks, quotas, lifecycle listeners)
- ExecutionContextManager and tenant propagation across services,
  persistence (Elasticsearch/OpenSearch), GraphQL, and REST
- Tenant-scoped items and definitions (system tenant vs tenant overrides)

UNOMI-880 — Unified multi-tenant caching
- MultiTypeCacheService, CacheableTypeConfig, and shared cache lifecycle
  (refresh, statistics, predefined item bundling)
- Migrate DefinitionsService and SegmentService onto the unified cache;
  remove superseded ad-hoc cache listeners

UNOMI-878 — Cluster-aware task scheduling
- SchedulerService with persistent and in-memory tasks, TaskExecutor
  registration, and cluster-aware execution
- Integrate periodic work (cache refresh, cluster heartbeat, router
  jobs, rule refresh) via the new scheduler API

UNOMI-884 — Migration to V3
- 3.1.0 migration Groovy scripts and Elasticsearch request bodies
  (tenant document IDs, system item ID fixes, tenant initialization,
  legacy queryBuilder updates)
- MigrationUtils extensions and MigrationUtilsTest

Integration tests updated for platform behaviour (including migration
and ScopeIT). Verified locally with OpenSearch integration tests.
@sergehuber sergehuber changed the title UNOMI-139/880/878/884: Multi-tenant platform core UNOMI-139 UNOMI-880 UNOMI-878 UNOMI-884: Multi-tenant platform core May 18, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

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.

2 participants