From c0e73eece92e94ebecddb9ca67b922de6d829bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96hlund?= Date: Tue, 22 Apr 2025 12:34:26 +0200 Subject: [PATCH 1/2] # This is a combination of 3 commits. # This is the 1st commit message: Only require endpoint name to be present to consider an endpoint detected # This is the commit message #2: Isolate changes # This is the commit message #3: More rollbacks Only require endpoint name to be available when detecting receiving endpoint details Fix merge --- .../When_ingesting_failed_message_with_missing_headers.cs | 5 ----- src/ServiceControl/Operations/EndpointDetailsParser.cs | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_ingesting_failed_message_with_missing_headers.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_ingesting_failed_message_with_missing_headers.cs index d79b88333c..e718a4dc81 100644 --- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_ingesting_failed_message_with_missing_headers.cs +++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_ingesting_failed_message_with_missing_headers.cs @@ -45,10 +45,6 @@ public async Task Should_include_headers_required_by_ServicePulse() { c.AddMinimalRequiredHeaders(); - // This is needed for ServiceControl to be able to detect both endpoint (via failed q header) and host via the processing machine header - // Missing endpoint or host will cause a null ref in ServicePulse - c.Headers[Headers.ProcessingMachine] = "MyMachine"; - c.Headers[FaultsHeaderKeys.ExceptionType] = "SomeExceptionType"; c.Headers[FaultsHeaderKeys.Message] = "Some message"; }) @@ -63,7 +59,6 @@ public async Task Should_include_headers_required_by_ServicePulse() // ServicePulse assumes that the receiving endpoint name is present Assert.That(failure.ReceivingEndpoint, Is.Not.Null); Assert.That(failure.ReceivingEndpoint.Name, Is.EqualTo(context.EndpointNameOfReceivingEndpoint)); - Assert.That(failure.ReceivingEndpoint.Host, Is.EqualTo("MyMachine")); // ServicePulse needs both an exception type and description to render the UI in a resonable way Assert.That(failure.Exception.ExceptionType, Is.EqualTo("SomeExceptionType")); diff --git a/src/ServiceControl/Operations/EndpointDetailsParser.cs b/src/ServiceControl/Operations/EndpointDetailsParser.cs index c2edcef186..921949dc6d 100644 --- a/src/ServiceControl/Operations/EndpointDetailsParser.cs +++ b/src/ServiceControl/Operations/EndpointDetailsParser.cs @@ -80,8 +80,8 @@ public static EndpointDetails ReceivingEndpoint(IReadOnlyDictionary Date: Fri, 25 Apr 2025 11:21:12 +0200 Subject: [PATCH 2/2] Fix test --- .../When_ingesting_failed_message_with_missing_headers.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_ingesting_failed_message_with_missing_headers.cs b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_ingesting_failed_message_with_missing_headers.cs index e718a4dc81..3d052c1398 100644 --- a/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_ingesting_failed_message_with_missing_headers.cs +++ b/src/ServiceControl.AcceptanceTests/Recoverability/MessageFailures/When_ingesting_failed_message_with_missing_headers.cs @@ -34,8 +34,8 @@ public async Task Should_be_ingested_when_minimal_required_headers_is_present() //No failure time will result in utc now being used Assert.That(failure.TimeOfFailure, Is.GreaterThan(testStartTime)); - // Both host and endpoint name is currently needed so this will be null since no host can be detected from the failed q header - Assert.That(failure.ReceivingEndpoint, Is.Null); + Assert.That(failure.ReceivingEndpoint, Is.Not.Null); + Assert.That(failure.ReceivingEndpoint.Name, Is.EqualTo(context.EndpointNameOfReceivingEndpoint)); } [Test] @@ -56,10 +56,6 @@ public async Task Should_include_headers_required_by_ServicePulse() Assert.That(failure, Is.Not.Null); - // ServicePulse assumes that the receiving endpoint name is present - Assert.That(failure.ReceivingEndpoint, Is.Not.Null); - Assert.That(failure.ReceivingEndpoint.Name, Is.EqualTo(context.EndpointNameOfReceivingEndpoint)); - // ServicePulse needs both an exception type and description to render the UI in a resonable way Assert.That(failure.Exception.ExceptionType, Is.EqualTo("SomeExceptionType")); Assert.That(failure.Exception.Message, Is.EqualTo("Some message"));