Skip to content

[WIP] Fix multitenancy support and tenant ID handling#7221

Closed
Copilot wants to merge 23 commits intorelease/3.6.0from
copilot/sub-pr-7217
Closed

[WIP] Fix multitenancy support and tenant ID handling#7221
Copilot wants to merge 23 commits intorelease/3.6.0from
copilot/sub-pr-7217

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

Thanks for the feedback on #7217. I've created this new PR, which merges into #7217, to address your comment. I will work on the changes and keep this PR's description up to date as I make progress.

Original PR: #7217
Triggering review: #7217 (comment)

@copilot open a new pull request to apply changes based on this feedback


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

sfmskywalker and others added 23 commits January 27, 2026 14:30
- Activate multitenancy in `Program.cs`.
- Introduce `NormalizeTenantId` method for consistent tenant ID usage.
- Update tenant-related classes and features to support normalization logic.
- Standardized the tenant ID for the default tenant to use an empty string (`""`) instead of `null`.
- Documented the rationale and migration considerations in ADR 0007.
- Updated ADR table of contents and graph for new entry.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…modes, and default tenant ID

- Introduced ADR 0005: Token-centric flowchart execution model for improved loop and join handling.
- Added ADR 0006: Tenant Deleted event for distinct handling of tenant removal.
- Documented ADR 0007: Explicit merge modes for flowchart joins, improving reliability and configurability.
- Included ADR 0008: Standardization of empty string as the default tenant ID for consistency and clarity.
…invoker

- Added comprehensive unit tests for tenant ID normalization to ensure consistent handling of null, empty, and valid IDs.
- Introduced tests for the multitenancy pipeline invoker covering various tenant resolution scenarios.
- Updated solution to include new unit testing projects for `Elsa.Tenants` and `Elsa.Common`.
- Refactor test parameterization to verify `HasExceptions` property more explicitly.
- Simplify exception creation logic in helper methods.
- Improve test assertions by combining act and assert phases where applicable.
- Introduced a configuration-based tenant provider to streamline tenant initialization and customization.
- Added tenant ID handling filters to ensure tenant ID is applied and filtered automatically.
- Deprecated the `CommonPersistenceFeature` in favor of modular persistence feature extension.
- Added `TenantId` to unique constraints on `Triggers` table across all EFCore providers.
- Adjusted index names to reflect the updated constraints.
- Updated trigger configuration to ensure uniqueness includes `TenantId`.
- Introduced `ITenantAccessor` to support tenant-specific filtering of workflow definitions.
- Updated logic to skip workflows not matching the current tenant.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… multitenancy

- Added `TenantId` to unique constraints on the `Triggers` table and updated index names.
- Included logic to drop outdated indexes without `TenantId` during migration.
- Adjusted tests to account for `TenantId` in workflow identity and indexing scenarios.
- Added `SelectiveMockLockProvider` to allow targeted lock mocking without affecting unrelated background operations.
- Updated test services to use `SelectiveMockLockProvider` in place of `TestDistributedLockProvider`.
- Refactored `DistributedLockResilienceTests` to support selective mocking for deterministic and reliable assertions.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI requested a review from sfmskywalker January 29, 2026 08:36
Copilot stopped work on behalf of sfmskywalker due to an error January 29, 2026 08:36
Base automatically changed from bug/tenant-id to release/3.6.0 January 30, 2026 18:54
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