stabilize tests

This commit is contained in:
master
2026-02-01 21:37:40 +02:00
parent 55744f6a39
commit 5d5e80b2e4
6435 changed files with 33984 additions and 13802 deletions

View File

@@ -1,6 +1,7 @@
using StellaOps.Signals.Scm.Models;
using System.Globalization;
using System.Text.Json;
using StellaOps.Signals.Scm.Models;
namespace StellaOps.Signals.Scm.Webhooks;
@@ -24,6 +25,12 @@ public sealed class GitHubEventMapper : IScmEventMapper
_ => (ScmEventType.Unknown, (Func<JsonElement, (ScmEventType, string?, string?)>?)null)
};
// Unsupported event types return null
if (extractor is null)
{
return null;
}
var repository = ExtractRepository(payload);
if (repository is null && scmEventType != ScmEventType.Unknown)
{
@@ -35,18 +42,10 @@ public sealed class GitHubEventMapper : IScmEventMapper
FullName = "unknown"
};
string? commitSha = null;
string? refName = null;
if (extractor is not null)
var (extractedType, commitSha, refName) = extractor(payload);
if (extractedType != ScmEventType.Unknown)
{
var (extractedType, sha, @ref) = extractor(payload);
if (extractedType != ScmEventType.Unknown)
{
scmEventType = extractedType;
}
commitSha = sha;
refName = @ref;
scmEventType = extractedType;
}
return new NormalizedScmEvent