#409: consistent dynamic-tenancy management surface (2.6.0)#410
Merged
Conversation
Standardizes the runtime tenant-management surface on the existing JasperFx.MultiTenancy.IDynamicTenantSource<T> so a monitoring tool (CritterWatch) can add/disable/enable/remove tenants on any Critter Stack service without sniffing the concrete tenancy type. JasperFx-side of the issue (ShardedTenancy conformance and the Wolverine source live in marten/wolverine). - IDynamicTenantSource<T>: new auto-assign overload AddTenantAsync(string tenantId, CancellationToken = default), default-implemented to throw NotSupportedException. Covers the sharded/partitioned provisioning shape that has no caller-supplied connection value; sources that auto-assign (Marten ShardedTenancy, marten#4598) override it. The value-supplied AddTenantAsync(tenantId, connectionValue) is unchanged. - DynamicTenancyAdminExtensions: a uniform IServiceProvider/IHost admin entrypoint that resolves all registered IDynamicTenantSource<string> and dispatches add (value + auto-assign) / disable / enable / remove / all-disabled to each — a graceful no-op when none is registered (store-agnostic pattern). CritterWatch consumes only this. Additive and non-breaking. CoreTests: 447/447 on net9.0 and net10.0 (8 new); solution builds clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 2, 2026
jeremydmiller
added a commit
that referenced
this pull request
Jun 2, 2026
…ignment (2.7.0) (#414) 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>
This was referenced Jun 2, 2026
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 the JasperFx-side of #409 — standardize runtime tenant management on the existing
JasperFx.MultiTenancy.IDynamicTenantSource<T>so a monitoring tool (CritterWatch) can add/disable/enable/remove tenants on any Critter Stack service without sniffing the concrete tenancy type. Part of CritterWatch #209. Additive and non-breaking.Branches off the 2.5.0 release commit (
5f94c0c); this is a single commit and a minor bump to 2.6.0.Changes
IDynamicTenantSource<T>— new auto-assign overloadAddTenantAsync(string tenantId, CancellationToken = default), default-implemented to throwNotSupportedException. Resolves the issue's open question: it covers the sharded/partitioned provisioning shape that has no caller-supplied connection value; auto-assigning sources (MartenShardedTenancy, marten#4598) override it. The value-suppliedAddTenantAsync(tenantId, connectionValue)is unchanged.DynamicTenancyAdminExtensions— a uniformIServiceProvider/IHostadmin entrypoint that resolves every registeredIDynamicTenantSource<string>and dispatches add (value + auto-assign) / disable / enable / remove / all-disabled to each — a graceful no-op when none is registered (store-agnostic pattern). CritterWatch consumes only this.Out of scope here (other repos): proposal item 1 (
ShardedTenancyimplementing the interface, marten#4598) and item 3 (WolverineMartenMessageDatabaseSource).Verification
IHostoverloads).Publish
Version bumped to 2.6.0 in
Directory.Build.props. After merge, publish via the "JasperFx NuGet Manual Publish" workflow (workflow_dispatch→./build.sh NugetPush,NUGET_API_KEYsecret). Package set: JasperFx, JasperFx.Events, JasperFx.Events.SourceGenerator, JasperFx.SourceGenerator, JasperFx.Aspire (RuntimeCompiler versions independently, unchanged).🤖 Generated with Claude Code