save progress

This commit is contained in:
StellaOps Bot
2026-01-02 21:06:27 +02:00
parent f46bde5575
commit 3f197814c5
441 changed files with 21545 additions and 4306 deletions

View File

@@ -122,9 +122,16 @@ internal static class SuseCsafParser
continue;
}
productId = productId.Trim();
if (!productLookup.TryGetValue(productId, out var product))
{
continue;
if (!TryCreateProductFromId(productId, out product))
{
continue;
}
productLookup[productId] = product;
}
if (!packageBuilders.TryGetValue(productId, out var builder))
@@ -273,8 +280,9 @@ internal static class SuseCsafParser
if (!string.IsNullOrWhiteSpace(productId))
{
productId = productId.Trim();
var productName = productElement.TryGetProperty("name", out var productNameElement)
? productNameElement.GetString()
? productNameElement.GetString()?.Trim()
: productId;
var (platformName, packageSegment) = SplitProductId(productId!, nextPlatform);
@@ -323,6 +331,31 @@ internal static class SuseCsafParser
return (platformNormalized, packageNormalized);
}
private static bool TryCreateProductFromId(string productId, out SuseProduct product)
{
product = null!;
if (string.IsNullOrWhiteSpace(productId))
{
return false;
}
var (platform, packageSegment) = SplitProductId(productId.Trim(), null);
if (string.IsNullOrWhiteSpace(packageSegment))
{
return false;
}
if (!Nevra.TryParse(packageSegment.Trim(), out var nevra))
{
return false;
}
var platformName = string.IsNullOrWhiteSpace(platform) ? "SUSE" : platform.Trim();
product = new SuseProduct(productId.Trim(), platformName, nevra!, nevra!.Architecture);
return true;
}
private static string FormatNevraVersion(Nevra nevra)
{
var epochSegment = nevra.HasExplicitEpoch || nevra.Epoch > 0 ? $"{nevra.Epoch}:" : string.Empty;

View File

@@ -182,14 +182,16 @@ internal static class SuseMapper
private static IReadOnlyList<AffectedPackageStatus> BuildStatuses(SusePackageStateDto package, AdvisoryProvenance provenance)
{
if (string.IsNullOrWhiteSpace(package.Status))
if (!AffectedPackageStatusCatalog.TryNormalize(package.Status, out var normalized))
{
return Array.Empty<AffectedPackageStatus>();
normalized = string.IsNullOrWhiteSpace(package.FixedVersion)
? AffectedPackageStatusCatalog.UnderInvestigation
: AffectedPackageStatusCatalog.Fixed;
}
return new[]
{
new AffectedPackageStatus(package.Status, provenance)
new AffectedPackageStatus(normalized, provenance)
};
}

View File

@@ -8,3 +8,4 @@ Source of truth: `docs/implplan/SPRINT_20251229_049_BE_csproj_audit_maint_tests.
| AUDIT-0169-M | DONE | Maintainability audit for StellaOps.Concelier.Connector.Distro.Suse. |
| AUDIT-0169-T | DONE | Test coverage audit for StellaOps.Concelier.Connector.Distro.Suse. |
| AUDIT-0169-A | TODO | Pending approval for changes. |
| CICD-VAL-SMOKE-001 | DOING | Smoke validation: trim CSAF product IDs to preserve package mapping. |