Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace StellaOps.Concelier.Merge.Services;
|
|
|
|
/// <summary>
|
|
/// Canonical conflict detail used to materialize structured payloads for persistence and explainers.
|
|
/// </summary>
|
|
public sealed record ConflictDetailPayload(
|
|
string Type,
|
|
string Reason,
|
|
IReadOnlyList<string> PrimarySources,
|
|
int PrimaryRank,
|
|
IReadOnlyList<string> SuppressedSources,
|
|
int SuppressedRank,
|
|
string? PrimaryValue,
|
|
string? SuppressedValue)
|
|
{
|
|
public static ConflictDetailPayload FromDetail(MergeConflictDetail detail)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(detail);
|
|
|
|
return new ConflictDetailPayload(
|
|
detail.ConflictType,
|
|
detail.Reason,
|
|
detail.PrimarySources,
|
|
detail.PrimaryRank,
|
|
detail.SuppressedSources,
|
|
detail.SuppressedRank,
|
|
detail.PrimaryValue,
|
|
detail.SuppressedValue);
|
|
}
|
|
|
|
public MergeConflictExplainerPayload ToExplainer() =>
|
|
new(
|
|
Type,
|
|
Reason,
|
|
PrimarySources,
|
|
PrimaryRank,
|
|
SuppressedSources,
|
|
SuppressedRank,
|
|
PrimaryValue,
|
|
SuppressedValue);
|
|
}
|