feat(transport): import name-map plumbing via CLI + ManagementActor (M8 D3)

This commit is contained in:
Joseph Doherty
2026-06-18 07:08:33 -04:00
parent d974477e87
commit 565d53d0fe
5 changed files with 721 additions and 7 deletions
@@ -53,7 +53,43 @@ public sealed record PreviewBundleResult(
int AddCount,
int ModifiedCount,
int IdenticalCount,
int BlockerCount);
int BlockerCount,
// Additive (M8 D3): site/connection references the operator must resolve
// before import, carried verbatim from ImportPreview. Defaulted to empty so
// every existing positional caller keeps compiling.
IReadOnlyList<RequiredSiteMapping>? RequiredSiteMappings = null,
IReadOnlyList<RequiredConnectionMapping>? RequiredConnectionMappings = null)
{
/// <summary>Site references the operator must resolve before import (M8). Never null.</summary>
public IReadOnlyList<RequiredSiteMapping> RequiredSiteMappings { get; init; } =
RequiredSiteMappings ?? Array.Empty<RequiredSiteMapping>();
/// <summary>Connection references the operator must resolve before import (M8). Never null.</summary>
public IReadOnlyList<RequiredConnectionMapping> RequiredConnectionMappings { get; init; } =
RequiredConnectionMappings ?? Array.Empty<RequiredConnectionMapping>();
}
/// <summary>
/// One source-environment site → destination resolution carried on
/// <see cref="ImportBundleCommand"/> across the CLI ⇆ ManagementActor boundary.
/// A null/blank <paramref name="TargetSiteIdentifier"/> means CreateNew; a
/// present value means MapToExisting that target. Serializable via
/// System.Text.Json.
/// </summary>
public sealed record SiteMappingSpec(
string SourceSiteIdentifier,
string? TargetSiteIdentifier);
/// <summary>
/// One source-environment data-connection (scoped to a source site) →
/// destination resolution carried on <see cref="ImportBundleCommand"/>. A
/// null/blank <paramref name="TargetConnectionName"/> means CreateNew; a present
/// value means MapToExisting that target. Serializable via System.Text.Json.
/// </summary>
public sealed record ConnectionMappingSpec(
string SourceSiteIdentifier,
string SourceConnectionName,
string? TargetConnectionName);
/// <summary>
/// Loads, previews, and applies a bundle in a single call. The diff is built
@@ -66,8 +102,22 @@ public sealed record PreviewBundleResult(
/// Valid <see cref="DefaultConflictPolicy"/> values: <c>"skip"</c>,
/// <c>"overwrite"</c>, <c>"rename"</c>. Rename mints a unique suffix per row.
/// </para>
/// <para>
/// M8 (D3): <paramref name="SiteMappings"/> / <paramref name="ConnectionMappings"/>
/// supply explicit operator resolutions for the source-environment site/connection
/// references the bundle carries; the handler merges them with the preview's
/// auto-matches and the <paramref name="CreateMissingSites"/> /
/// <paramref name="CreateMissingConnections"/> flags into a
/// <see cref="BundleNameMap"/> passed to Apply. All four are defaulted so every
/// existing positional caller keeps compiling and central-config-only bundles
/// (no site/instance payload) carry an empty map.
/// </para>
/// </summary>
public sealed record ImportBundleCommand(
string Base64Bundle,
string? Passphrase,
string DefaultConflictPolicy);
string DefaultConflictPolicy,
IReadOnlyList<SiteMappingSpec>? SiteMappings = null,
IReadOnlyList<ConnectionMappingSpec>? ConnectionMappings = null,
bool CreateMissingSites = false,
bool CreateMissingConnections = false);