From 46a3d82fa6bc7cb3a424bf5cdd2736da92db6151 Mon Sep 17 00:00:00 2001 From: iammukeshm Date: Sun, 24 May 2026 04:47:43 +0530 Subject: [PATCH 1/2] fix(tests): make BuildingBlocks dependency checks cross-platform ProjectReference Include paths are authored with Windows separators (..\Core\Core.csproj). Path.GetFileNameWithoutExtension only treats "\" as a separator on Windows, so on Linux CI it returned the full path minus extension (..\Core\Core) instead of the bare name (Core). This caused BuildingBlocks_Should_Follow_Layered_Dependencies to report 12 false-positive violations on Linux (passed locally on Windows), and silently disabled the module-reference enforcement in BuildingBlocks_Projects_Should_Not_Reference_Modules_Directly. Normalize "\" to "/" before extracting the project name so both checks work on every platform. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../BuildingBlocksIndependenceTests.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Tests/Architecture.Tests/BuildingBlocksIndependenceTests.cs b/src/Tests/Architecture.Tests/BuildingBlocksIndependenceTests.cs index cfd47c04ce..dc82ee334a 100644 --- a/src/Tests/Architecture.Tests/BuildingBlocksIndependenceTests.cs +++ b/src/Tests/Architecture.Tests/BuildingBlocksIndependenceTests.cs @@ -95,7 +95,7 @@ public void BuildingBlocks_Projects_Should_Not_Reference_Modules_Directly() foreach (string include in references) { - string referencedName = Path.GetFileNameWithoutExtension(include); + string referencedName = GetReferencedProjectName(include); // Check if it references a Modules project if (referencedName.StartsWith("Modules.", StringComparison.OrdinalIgnoreCase)) @@ -224,7 +224,7 @@ private static void CheckBuildingBlockDependencies( var projectReferences = document .Descendants("ProjectReference") .Select(x => (string?)x.Attribute("Include") ?? string.Empty) - .Select(p => Path.GetFileNameWithoutExtension(p)) + .Select(GetReferencedProjectName) .Where(p => !string.IsNullOrEmpty(p)) .ToArray(); @@ -236,4 +236,11 @@ private static void CheckBuildingBlockDependencies( } } } + + // ProjectReference Include paths are authored with Windows separators (e.g. ..\Core\Core.csproj). + // Path.GetFileNameWithoutExtension only treats '\' as a separator on Windows, so on Linux CI it + // returns the whole path minus the extension. Normalize to '/' first to get the bare project name + // on every platform. + private static string GetReferencedProjectName(string includePath) => + Path.GetFileNameWithoutExtension(includePath.Replace('\\', '/')); } \ No newline at end of file From 8d98981c85d353d5af9b4eecd2077e5176a872e2 Mon Sep 17 00:00:00 2001 From: iammukeshm Date: Sun, 24 May 2026 04:48:42 +0530 Subject: [PATCH 2/2] fix(webhooks): require http(s) scheme for subscription URL Uri.TryCreate(UriKind.Absolute) accepts a leading-/ path as an implicit file:// URI on Unix (but not Windows), so "/relative/path" passed validation on the Linux CI runner while the test passed locally on Windows. A webhook target must be an HTTP(S) endpoint regardless of platform, so assert the scheme explicitly. Fixes the Linux-only failure of Create_Should_Fail_When_Url_Relative. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../CreateWebhookSubscriptionCommandValidator.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Modules/Webhooks/Modules.Webhooks/Features/v1/CreateWebhookSubscription/CreateWebhookSubscriptionCommandValidator.cs b/src/Modules/Webhooks/Modules.Webhooks/Features/v1/CreateWebhookSubscription/CreateWebhookSubscriptionCommandValidator.cs index fce3fa0b77..1922aa8d1a 100644 --- a/src/Modules/Webhooks/Modules.Webhooks/Features/v1/CreateWebhookSubscription/CreateWebhookSubscriptionCommandValidator.cs +++ b/src/Modules/Webhooks/Modules.Webhooks/Features/v1/CreateWebhookSubscription/CreateWebhookSubscriptionCommandValidator.cs @@ -7,7 +7,9 @@ public sealed class CreateWebhookSubscriptionCommandValidator : AbstractValidato { public CreateWebhookSubscriptionCommandValidator() { - RuleFor(x => x.Url).NotEmpty().Must(url => Uri.TryCreate(url, UriKind.Absolute, out _)) + RuleFor(x => x.Url).NotEmpty() + .Must(url => Uri.TryCreate(url, UriKind.Absolute, out var uri) + && (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps)) .WithMessage("A valid absolute URL is required."); RuleFor(x => x.Events).NotEmpty().WithMessage("At least one event type is required."); }