#413: auto-assign dynamic-tenant abstraction returns resolved assignment (2.7.0)#414
Merged
jeremydmiller merged 1 commit intoJun 2, 2026
Conversation
…ignment (2.7.0) Upstream half split out from #409. Pooled/auto-assign tenancy models (Marten ShardedTenancy, conjoined managed partitions) have no caller-supplied connection value — the assignment strategy picks the database/partition. Per the issue's recommended option (1), the auto-assign overload now reports where the tenant landed so a store-agnostic tool (CritterWatch) can manage these models uniformly without sniffing the concrete tenancy type. - IDynamicTenantSource<T>.AddTenantAsync(string tenantId, CancellationToken) now returns Task<string> — the resolved database id (sharded pool) or partition suffix (managed partitions). Default still throws NotSupportedException, so the change stays additive for caller-supplies-value sources, which keep AddTenantAsync(tenantId, connectionValue). (Evolves the void-Task overload added in #409/PR #410.) - DynamicTenancyAdminExtensions: the auto-assign IServiceProvider/IHost entrypoint now returns Task<string?> — the resolved assignment from the provisioning source, or null when no dynamic source is registered (graceful no-op preserved). JasperFx-side only; ShardedTenancy/managed-partition conformance and the Wolverine MartenMessageDatabaseSource surfacing (scope items 2-5) are Marten/Wolverine repos (depend on marten#4598). CoreTests 447/447 on net9.0 and net10.0; solution builds clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jeremydmiller
added a commit
that referenced
this pull request
Jun 2, 2026
PRs #412 (#411) and #414 (#413) merged into their stacked PR bases rather than main, so main carried #409 (2.6.x) but was missing #411's removals and #413's Task<string> auto-assign change. This brings both onto main as a single consolidated 2.8.0 release (supersedes the interim 2.6.0/2.6.1/2.7.0 bumps). - #411: removed HttpChainDescriptor.Middleware/Postprocessors/ServiceDependencies, the MiddlewareStepDescriptor type, and graph-level HttpGraphUsage.MiddlewareTypes. - #413: IDynamicTenantSource<T>.AddTenantAsync(tenantId, CancellationToken) now returns Task<string> (resolved database id / partition suffix); admin extensions surface it. Version set to 2.8.0. CoreTests green on net9.0 and net10.0; solution builds clean. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Closes #413 (the upstream half split out from the now-closed #409). Brings pooled/auto-assign tenancy models under the uniform dynamic-tenant management surface so a store-agnostic tool (CritterWatch) can manage them the same way it manages master-table tenancy — without sniffing the concrete tenancy type.
Minor bump: 2.6.1 → 2.7.0.
The decision (scope item 1)
Auto-assign/pooled models have no caller-supplied connection value — the assignment strategy picks the database/partition. Per the issue's recommended option (1), the auto-assign overload now reports the resolved assignment:
IDynamicTenantSource<T>.AddTenantAsync(string tenantId, CancellationToken = default)now returnsTask<string>— the resolved database id (sharded pool) or partition suffix (managed partitions). Default still throwsNotSupportedException, so it stays additive; caller-supplies-value sources keepAddTenantAsync(tenantId, connectionValue). This evolves the void-Taskoverload introduced in Consistent dynamic-tenancy management surface: standardize on IDynamicTenantSource<T> + uniform admin entrypoint #409/PR #409: consistent dynamic-tenancy management surface (2.6.0) #410.DynamicTenancyAdminExtensions: the auto-assignIServiceProvider/IHostentrypoint now returnsTask<string?>— the resolved assignment from the provisioning source, ornullwhen none is registered (graceful no-op preserved).Out of scope (other repos)
Items 2–5 —
ShardedTenancyconformance (Cardinality => DynamicMultiple, registry-backedAllActive/Refresh,Disable/Removesemantics), managed-partition conformance, and WolverineMartenMessageDatabaseSourcesurfacing — live in Marten/Wolverine and depend on marten#4598.Verification
Task<string>return + resolved-id assertions).🤖 Generated with Claude Code