From d2adf910bd076ba2ebec974a44d09d7c6acb9988 Mon Sep 17 00:00:00 2001 From: Per Kops Date: Tue, 28 Apr 2026 12:28:59 +0200 Subject: [PATCH 1/2] fix: rewrite github.com blob image URLs to raw.githubusercontent.com - Markdown tags pointing at github.com/{owner}/{repo}/blob/... serve the HTML web view, not the image bytes, and silently fail to render - Rewrite them to raw.githubusercontent.com so embedded images in fetched markdown (e.g. atc-docs DevOps Playbook) load correctly --- src/AtcWeb/Components/MarkdownRepositoryContent.razor.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/AtcWeb/Components/MarkdownRepositoryContent.razor.cs b/src/AtcWeb/Components/MarkdownRepositoryContent.razor.cs index 3a5d470..48eb0af 100644 --- a/src/AtcWeb/Components/MarkdownRepositoryContent.razor.cs +++ b/src/AtcWeb/Components/MarkdownRepositoryContent.razor.cs @@ -153,6 +153,15 @@ private MarkupString SanitizeHtmlToMarkup(string html) RegexOptions.None, TimeSpan.FromSeconds(5)); + // Rewrite absolute github.com blob URLs in tags to raw.githubusercontent.com + // (github.com/.../blob/... serves the HTML web view, not the image bytes) + sanitizedHtml = Regex.Replace( + sanitizedHtml, + @" Date: Tue, 28 Apr 2026 12:50:53 +0200 Subject: [PATCH 2/2] test(domain): drop brittle issue-count assertions - Remove HaveCountGreaterThan(1) and NotBeEmpty() from the three GetIssues* tests; they coupled to live upstream issue counts and failed when the atc repo was down to 1 issue - Keep success and not-null checks so the tests still verify the client contract without depending on data shape --- .../AtcApiGitHubRepositoryClientTests.cs | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/test/AtcWeb.Domain.Tests/AtcApi/AtcApiGitHubRepositoryClientTests.cs b/test/AtcWeb.Domain.Tests/AtcApi/AtcApiGitHubRepositoryClientTests.cs index ff4a29b..50aeb5e 100644 --- a/test/AtcWeb.Domain.Tests/AtcApi/AtcApiGitHubRepositoryClientTests.cs +++ b/test/AtcWeb.Domain.Tests/AtcApi/AtcApiGitHubRepositoryClientTests.cs @@ -109,12 +109,7 @@ public async Task GetIssuesAllByRepositoryByName( // Assert Assert.True(isSuccessful); - - gitHubIssues - .Should() - .NotBeEmpty() - .And - .HaveCountGreaterThan(1); + gitHubIssues.Should().NotBeNull(); } [Theory, AutoNSubstituteData] @@ -133,12 +128,7 @@ public async Task GetIssuesOpenByRepositoryByName( // Assert Assert.True(isSuccessful); - - gitHubIssues - .Should() - .NotBeEmpty() - .And - .HaveCountGreaterThan(1); + gitHubIssues.Should().NotBeNull(); } [Theory, AutoNSubstituteData] @@ -157,11 +147,6 @@ public async Task GetIssuesClosedByRepositoryByName( // Assert Assert.True(isSuccessful); - - gitHubIssues - .Should() - .NotBeEmpty() - .And - .HaveCountGreaterThan(1); + gitHubIssues.Should().NotBeNull(); } } \ No newline at end of file