From 5059d31c6968d63d8132e3e80104917b44d8a0ae Mon Sep 17 00:00:00 2001 From: Zaprit Date: Fri, 11 Jul 2025 10:21:50 +0100 Subject: [PATCH 1/7] Update dependencies of lighthouse --- .../ProjectLighthouse.Servers.Website.csproj | 2 +- ...rojectLighthouse.Tests.GameApiTests.csproj | 14 +++++------ ...rojectLighthouse.Tests.WebsiteTests.csproj | 18 +++++++------- .../ProjectLighthouse.Tests.csproj | 16 ++++++------- ProjectLighthouse/ProjectLighthouse.csproj | 24 +++++++++---------- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/ProjectLighthouse.Servers.Website/ProjectLighthouse.Servers.Website.csproj b/ProjectLighthouse.Servers.Website/ProjectLighthouse.Servers.Website.csproj index 7768663f5..853c52855 100644 --- a/ProjectLighthouse.Servers.Website/ProjectLighthouse.Servers.Website.csproj +++ b/ProjectLighthouse.Servers.Website/ProjectLighthouse.Servers.Website.csproj @@ -11,6 +11,6 @@ - + diff --git a/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj b/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj index ef7209198..60b475198 100644 --- a/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj +++ b/ProjectLighthouse.Tests.GameApiTests/ProjectLighthouse.Tests.GameApiTests.csproj @@ -8,19 +8,19 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj index c5b336f5d..2d78501d3 100644 --- a/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj +++ b/ProjectLighthouse.Tests.WebsiteTests/ProjectLighthouse.Tests.WebsiteTests.csproj @@ -8,21 +8,21 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj index 4c4199a93..158748235 100644 --- a/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj +++ b/ProjectLighthouse.Tests/ProjectLighthouse.Tests.csproj @@ -13,23 +13,23 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/ProjectLighthouse/ProjectLighthouse.csproj b/ProjectLighthouse/ProjectLighthouse.csproj index 6fff81a2a..e157904d9 100644 --- a/ProjectLighthouse/ProjectLighthouse.csproj +++ b/ProjectLighthouse/ProjectLighthouse.csproj @@ -10,26 +10,26 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - + + + From 3f15930d61f360d6349cd4ef7040ac88ae64ec0d Mon Sep 17 00:00:00 2001 From: Zaprit Date: Fri, 11 Jul 2025 10:38:20 +0100 Subject: [PATCH 2/7] Fix race condition in test --- .../Integration/AuthenticationTests.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ProjectLighthouse.Tests.WebsiteTests/Integration/AuthenticationTests.cs b/ProjectLighthouse.Tests.WebsiteTests/Integration/AuthenticationTests.cs index 1fa9feff9..ce6316a7b 100644 --- a/ProjectLighthouse.Tests.WebsiteTests/Integration/AuthenticationTests.cs +++ b/ProjectLighthouse.Tests.WebsiteTests/Integration/AuthenticationTests.cs @@ -26,7 +26,11 @@ public async Task ShouldLoginWithPassword() string password = CryptoHelper.Sha256Hash(CryptoHelper.GenerateRandomBytes(64).ToArray()); UserEntity user = await database.CreateUser($"unitTestUser{CryptoHelper.GenerateRandomInt32()}", CryptoHelper.BCryptHash(CryptoHelper.Sha256Hash(password))); - this.Driver.Navigate().GoToUrl(this.BaseAddress + "/login"); + // Sometimes not having this causes a race condition + // ReSharper disable once MethodHasAsyncOverload + database.SaveChanges(); + + await this.Driver.Navigate().GoToUrlAsync(this.BaseAddress + "/login"); this.Driver.FindElement(By.Id("text")).SendKeys(user.Username); this.Driver.FindElement(By.Id("password")).SendKeys(password); From 681fcbba734474695a9095b7b248ae8f1aea9839 Mon Sep 17 00:00:00 2001 From: Zaprit Date: Fri, 11 Jul 2025 10:40:41 +0100 Subject: [PATCH 3/7] Stop using async void in tests. --- ProjectLighthouse.Tests/Unit/ModerationTests.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ProjectLighthouse.Tests/Unit/ModerationTests.cs b/ProjectLighthouse.Tests/Unit/ModerationTests.cs index 32fc3d730..c574abf44 100644 --- a/ProjectLighthouse.Tests/Unit/ModerationTests.cs +++ b/ProjectLighthouse.Tests/Unit/ModerationTests.cs @@ -1,4 +1,5 @@ using System; +using System.Threading.Tasks; using LBPUnion.ProjectLighthouse.Administration.Maintenance.RepeatingTasks; using LBPUnion.ProjectLighthouse.Database; using LBPUnion.ProjectLighthouse.Tests.Helpers; @@ -12,7 +13,7 @@ namespace LBPUnion.ProjectLighthouse.Tests.Unit; public class ModerationTests { [Fact] - public async void DismissExpiredCases_ShouldDismissExpiredCase() + public async Task DismissExpiredCases_ShouldDismissExpiredCase() { await using DatabaseContext database = await MockHelper.GetTestDatabase(); @@ -35,7 +36,7 @@ public async void DismissExpiredCases_ShouldDismissExpiredCase() } [Fact] - public async void DismissExpiredCases_ShouldNotDismissActiveCase() + public async Task DismissExpiredCases_ShouldNotDismissActiveCase() { await using DatabaseContext database = await MockHelper.GetTestDatabase(); @@ -58,7 +59,7 @@ public async void DismissExpiredCases_ShouldNotDismissActiveCase() } [Fact] - public async void DismissExpiredCases_ShouldNotDismissAlreadyDismissedCase() + public async Task DismissExpiredCases_ShouldNotDismissAlreadyDismissedCase() { await using DatabaseContext database = await MockHelper.GetTestDatabase(); From d96091ae4c47c8e8fc2dc1e0fba5622e8131b848 Mon Sep 17 00:00:00 2001 From: Zaprit Date: Fri, 11 Jul 2025 10:50:09 +0100 Subject: [PATCH 4/7] Hopefully fix qodana issues --- .github/workflows/qodana_code_quality.yml | 2 +- qodana.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml index fdd4c7d54..b0e24745e 100644 --- a/.github/workflows/qodana_code_quality.yml +++ b/.github/workflows/qodana_code_quality.yml @@ -29,7 +29,7 @@ jobs: pr-mode: false env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_1488465344 }} - QODANA_ENDPOINT: 'https://qodana.cloud' + QODANA_ENDPOINT: 'https://api.qodana.cloud' - uses: github/codeql-action/upload-sarif@v3 with: sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json diff --git a/qodana.yaml b/qodana.yaml index 63159ecac..1f6441a6b 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -1,5 +1,5 @@ version: "1.0" -linter: jetbrains/qodana-dotnet:2024.1 +linter: jetbrains/qodana-dotnet:2024.3 profile: name: qodana.recommended include: From 9c717b4e45562519e48c441ab97ced6e895df0df Mon Sep 17 00:00:00 2001 From: Zaprit Date: Fri, 11 Jul 2025 11:00:11 +0100 Subject: [PATCH 5/7] Disable qodana PR-mode --- .github/workflows/qodana_code_quality.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/qodana_code_quality.yml b/.github/workflows/qodana_code_quality.yml index b0e24745e..0595c838a 100644 --- a/.github/workflows/qodana_code_quality.yml +++ b/.github/workflows/qodana_code_quality.yml @@ -25,8 +25,6 @@ jobs: fetch-depth: 0 # a full history is required for pull request analysis - name: 'Qodana Scan' uses: JetBrains/qodana-action@v2024.3 - with: - pr-mode: false env: QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_1488465344 }} QODANA_ENDPOINT: 'https://api.qodana.cloud' From 637127e984584994c279752b02d12f083943b6b7 Mon Sep 17 00:00:00 2001 From: Zaprit Date: Fri, 11 Jul 2025 11:09:09 +0100 Subject: [PATCH 6/7] Suppress license issue in qodana as not a problem --- qodana.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qodana.yaml b/qodana.yaml index 1f6441a6b..32cdadfa4 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -9,3 +9,5 @@ exclude: paths: - ProjectLighthouse.Localization - ProjectLighthouse/Migrations +dependencyIgnores: + - name: "SixLabors.ImageSharp" # We're open source, so we come under the Apache License \ No newline at end of file From f527ae4356988f1627afa829d849f0259486e18f Mon Sep 17 00:00:00 2001 From: Zaprit Date: Fri, 11 Jul 2025 11:14:06 +0100 Subject: [PATCH 7/7] Exclude svg files from qodana scans --- qodana.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qodana.yaml b/qodana.yaml index 32cdadfa4..c6439c0aa 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -9,5 +9,7 @@ exclude: paths: - ProjectLighthouse.Localization - ProjectLighthouse/Migrations + - ProjectLighthouse/StaticFiles/css/themes + - ProjectLighthouse/StaticFiles/safari-pinned-tab.svg dependencyIgnores: - name: "SixLabors.ImageSharp" # We're open source, so we come under the Apache License \ No newline at end of file