Feature/ab#34137 tenant creation updates - #2863
Draft
AndreGAot wants to merge 5 commits into
Draft
Conversation
… modal, Metabase post-creation step Onboarding "Create Tenant" modal: - Reorders field mapping so Name and the new Display Name field come first, then Ministry, Division, Branch, Program Area, Features, Program Managers. - Adds Display Name and Division as mappable fields (stored on the tenant's ExtraProperties / passed through to TenantCreateDto). - Fixes the Jaro-Winkler auto-detection matching a "ProgramManagerEmail"-style field to the Name canonical instead of a literal "Name" field, via an exact-match short-circuit before fuzzy scoring. New Tenant modal (Tenants/CreateModal): - Rebuilt to match the Edit Configuration modal's tabbed layout (Details, Program Managers, Features, Metabase) instead of a single flat form. - Details tab now actually renders Division/Branch/Description/CAS Client Code (previously present on the model but never shown) plus Display Name. - Program Managers search now uses the same field-selector UX as Edit. - Features tab lets you pick features to enable at creation time, reusing the existing FeatureKeys -> TenantCreatedEventHandler mechanism. - New Metabase tab manages the group's member emails, backed by ABP Settings (Global default list + per-tenant snapshot, with an "add for this tenant only" vs "save as default" option). Tenants list: adds a Display Name column. Post-tenant-creation pipeline (new): - IPostTenantCreationStep (Unity.SharedKernel) - pluggable, ordered, per-step ContinueOnError. - PostTenantCreationSequenceJob - a self-chaining ABP background job that runs steps in order, entirely via the job queue (durable/retryable per step), stopping on failure only where ContinueOnError is false. - MetabaseTenantRegistrationStep - first step. Registers the new tenant with Metabase (database connection over its readonly Postgres role, a permissions group with its configured members, and a collection), automating what manual_deploy_new_metabase_tenant.ps1 used to do by hand. Resolves the Metabase endpoint via the existing DynamicUrls mechanism (new METABASE_API_BASE key) and the API key via new TenantCreation: Steps:Metabase:ApiKey config. - IResilientHttpRequest gains an optional extraHeaders parameter (needed for Metabase's x-api-key auth), backward compatible with all existing call sites. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates tenant provisioning with richer metadata, onboarding mappings, feature selection, and automated Metabase registration.
Changes:
- Adds display name/division mapping and expanded tenant-creation interfaces.
- Introduces queued post-creation steps and Metabase provisioning.
- Adds configuration, localization, settings, and automated tests.
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 9 comments.
Show a summary per file
All paths are under applications/Unity.GrantManager/.
| File | Description |
|---|---|
test/.../MetabaseTenantRegistrationStepTests.cs |
Tests Metabase registration behavior. |
test/.../PostTenantCreationSequenceJobTests.cs |
Tests post-creation sequencing. |
src/Unity.GrantManager.Web/appsettings.json |
Adds Metabase configuration. |
src/Unity.GrantManager.Web/appsettings.Development.json |
Adds development Metabase settings. |
src/Unity.GrantManager.Domain/Integrations/DynamicUrlDataSeeder.cs |
Seeds the Metabase endpoint. |
src/Unity.GrantManager.Domain.Shared/Localization/GrantManager/en.json |
Adds tenant UI labels. |
src/Unity.GrantManager.Domain.Shared/Integrations/DynamicUrlKeyNames.cs |
Defines the Metabase endpoint key. |
src/Unity.GrantManager.Application/Tenants/PostCreation/Steps/MetabaseTenantRegistrationStep.cs |
Implements Metabase provisioning. |
src/Unity.GrantManager.Application/Tenants/PostCreation/PostTenantCreationStepArgs.cs |
Defines sequence job arguments. |
src/Unity.GrantManager.Application/Tenants/PostCreation/PostTenantCreationSequenceJob.cs |
Runs post-creation steps. |
src/Unity.GrantManager.Application/Integrations/Metabase/MetabaseOptions.cs |
Defines Metabase options. |
src/Unity.GrantManager.Application/Integrations/Metabase/MetabaseApiClient.cs |
Implements Metabase API calls. |
src/Unity.GrantManager.Application/Integrations/Metabase/IMetabaseApiClient.cs |
Defines the Metabase client contract. |
src/Unity.GrantManager.Application/Handlers/TenantCreatedEventHandler.cs |
Starts post-creation processing. |
src/Unity.GrantManager.Application/GrantManagerApplicationModule.cs |
Registers Metabase services. |
modules/Unity.TenantManagement/test/.../OnboardingRequestAppServiceTests.cs |
Tests Metabase onboarding inputs. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Web/UnityTenantManagementWebMapperlyProfile.cs |
Maps new creation fields. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Web/Pages/TenantManagement/Tenants/Index.js |
Adds display names and creation UI behavior. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml.cs |
Handles creation metadata and defaults. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Web/Pages/TenantManagement/Tenants/CreateModal.cshtml |
Redesigns the creation modal. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Web/Pages/TenantManagement/Onboarding/Index.js |
Adds mappings and Metabase controls. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Web/Pages/TenantManagement/Onboarding/CreateTenantModal.cshtml.cs |
Loads default Metabase users. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Web/Pages/TenantManagement/Onboarding/CreateTenantModal.cshtml |
Adds onboarding tabs and fields. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.HttpApi/OnboardingRequestController.cs |
Exposes new mapping parameters. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application/UnityTenantManagementMapperlyProfile.cs |
Maps tenant display names. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application/TenantAppService.cs |
Persists new tenant metadata. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application/OnboardingRequestAppService.cs |
Processes mappings and Metabase defaults. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application/Onboarding/OnboardingColumnConfigSettings.cs |
Adds mapping-setting keys. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application/Onboarding/OnboardingColumnConfigSettingDefinitionProvider.cs |
Registers new mapping settings. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application/Metabase/MetabaseSettingDefinitionProvider.cs |
Registers Metabase email settings. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application.Contracts/TenantDto.cs |
Adds tenant display name. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application.Contracts/TenantCreateOrUpdateDtoBase.cs |
Adds display name input. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application.Contracts/TenantCreateDto.cs |
Adds Metabase email input. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application.Contracts/OnboardingRequestDto.cs |
Adds display name and division. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application.Contracts/OnboardingColumnConfigDto.cs |
Extends mapping and creation contracts. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application.Contracts/Metabase/MetabaseSettings.cs |
Defines the email setting key. |
modules/Unity.TenantManagement/src/Unity.TenantManagement.Application.Contracts/IOnboardingRequestAppService.cs |
Extends validation parameters. |
modules/Unity.SharedKernel/PostTenantCreation/IPostTenantCreationStep.cs |
Defines extensible post-creation steps. |
modules/Unity.SharedKernel/Http/ResilientHttpRequest.cs |
Supports additional HTTP headers. |
modules/Unity.SharedKernel/Http/IResilientHttpRequest.cs |
Extends the HTTP abstraction. |
Suppressed comments (1)
applications/Unity.GrantManager/src/Unity.GrantManager.Application/Integrations/Metabase/MetabaseApiClient.cs:92
- The collection permissions graph has the same stale-revision race as the database graph: simultaneous tenant jobs can read one revision and then conflict or overwrite one another. Add a bounded retry that refetches the graph and reapplies this collection change after a revision conflict, or serialize these updates.
await PutAsync("/api/collection/graph",
new { groups, revision = graph.Value<int>("revision") }, cancellationToken);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
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.



No description provided.