Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance #958

Merged
merged 3 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Clients/CirrusCiClient/CirrusCiClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="StrawberryShake.Server" Version="13.9.4" />
<PackageReference Include="StrawberryShake.Server" Version="13.9.6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Clients/CompatApiClient/CompatApiClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageReference Include="NLog" Version="5.3.2" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion Clients/GithubClient/GithubClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageReference Include="Octokit" Version="11.0.1" />
<PackageReference Include="Octokit" Version="12.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CompatApiClient\CompatApiClient.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion Clients/IrdLibraryClient/IrdLibraryClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ItemGroup>
<PackageReference Include="DiscUtils.OpticalDisk" Version="0.16.13" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.61" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Clients/PsnClient/PsnClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CompatApiClient\CompatApiClient.csproj" />
Expand Down
3 changes: 2 additions & 1 deletion CompatBot/Commands/Sudo.Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities;
using Microsoft.EntityFrameworkCore;
using NLog;

namespace CompatBot.Commands;

Expand Down Expand Up @@ -248,7 +249,7 @@ internal static void RestartNoSaving()
if (SandboxDetector.Detect() != SandboxType.Docker)
{
Config.Log.Info("Restarting...");
Config.Log.Factory.Flush();
LogManager.LogFactory.Flush();
using var self = new Process {StartInfo = RestartInfo};
self.Start();
Config.InMemorySettings["shutdown"] = "true";
Expand Down
3 changes: 2 additions & 1 deletion CompatBot/Commands/Sudo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using DSharpPlus.Entities;
using DSharpPlus.Interactivity.Extensions;
using Microsoft.EntityFrameworkCore;
using NLog;
using SharpCompress.Common;
using SharpCompress.Compressors;
using SharpCompress.Compressors.Deflate;
Expand Down Expand Up @@ -134,7 +135,7 @@ public async Task Log(CommandContext ctx, [Description("Specific date")]string d
{
try
{
Config.Log.Factory.Flush();
LogManager.LogFactory.Flush();
string[] logPaths = [Config.CurrentLogPath];
if (DateTime.TryParse(date, CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out var logDate))
{
Expand Down
12 changes: 6 additions & 6 deletions CompatBot/CompatBot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@
<PackageReference Include="DSharpPlus.CommandsNext" Version="4.4.6" />
<PackageReference Include="DSharpPlus.Interactivity" Version="4.4.6" />
<PackageReference Include="DSharpPlus.SlashCommands" Version="4.4.6" />
<PackageReference Include="Google.Apis.Drive.v3" Version="1.68.0.3416" />
<PackageReference Include="Google.Apis.Drive.v3" Version="1.68.0.3428" />
<PackageReference Include="ksemenenko.ColorThief" Version="1.1.1.4" />
<PackageReference Include="MathParser.org-mXparser" Version="6.0.0" />
<PackageReference Include="MegaApiClient" Version="1.10.4" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.22.0" />
<PackageReference Include="Microsoft.ApplicationInsights.PerfCounterCollector" Version="2.22.0" />
<PackageReference Include="Microsoft.Azure.CognitiveServices.Vision.ComputerVision" Version="7.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.5">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.6" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="19.225.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
<PackageReference Include="Nerdbank.Streams" Version="2.11.74" />
Expand All @@ -68,7 +68,7 @@
<PackageReference Include="NReco.Text.AhoCorasickDoubleArrayTrie" Version="1.1.1" />
<PackageReference Include="SharpCompress" Version="0.37.2" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.3" />
<PackageReference Include="System.Drawing.Common" Version="8.0.5" />
<PackageReference Include="System.Drawing.Common" Version="8.0.6" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Clients\CirrusCiClient\CirrusCiClient.csproj" />
Expand Down
2 changes: 2 additions & 0 deletions CompatBot/Database/DbImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,10 @@ private static async Task ImportAsync(BotDb dbContext, CancellationToken cancell
{
// __EFMigrationsHistory table will be already created by the failed migration attempt
#pragma warning disable EF1001 // Internal EF Core API usage.
#pragma warning disable EF1002 // Using raw sql
await db.ExecuteSqlRawAsync($"INSERT INTO `__EFMigrationsHistory`(`MigrationId`,`ProductVersion`) VALUES ({new InitialCreate().GetId()},'manual')", cancellationToken);
await db.ExecuteSqlRawAsync($"INSERT INTO `__EFMigrationsHistory`(`MigrationId`,`ProductVersion`) VALUES ({new Explanations().GetId()},'manual')", cancellationToken);
#pragma warning restore EF1002
#pragma warning restore EF1001 // Internal EF Core API usage.
// create constraints on moderator
await db.ExecuteSqlRawAsync(@"CREATE TABLE `temp_new_moderator` (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task FillPipeAsync(Stream sourceStream, PipeWriter writer, Cancella
while (rarReader.MoveToNextEntry())
{
if (!rarReader.Entry.IsDirectory
&& rarReader.Entry.Key.EndsWith(".log", StringComparison.InvariantCultureIgnoreCase)
&& rarReader.Entry.Key!.EndsWith(".log", StringComparison.InvariantCultureIgnoreCase)
&& !rarReader.Entry.Key.Contains("tty.log", StringComparison.InvariantCultureIgnoreCase))
{
LogSize = rarReader.Entry.Size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task FillPipeAsync(Stream sourceStream, PipeWriter writer, Cancella
using var zipReader = zipArchive.ExtractAllEntries();
while (zipReader.MoveToNextEntry())
if (!zipReader.Entry.IsDirectory
&& zipReader.Entry.Key.EndsWith(".log", StringComparison.InvariantCultureIgnoreCase)
&& zipReader.Entry.Key!.EndsWith(".log", StringComparison.InvariantCultureIgnoreCase)
&& !zipReader.Entry.Key.Contains("tty.log", StringComparison.InvariantCultureIgnoreCase))
{
LogSize = zipReader.Entry.Size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task FillPipeAsync(Stream sourceStream, PipeWriter writer, Cancella
while (zipReader.MoveToNextEntry())
{
if (!zipReader.Entry.IsDirectory
&& zipReader.Entry.Key.EndsWith(".log", StringComparison.InvariantCultureIgnoreCase)
&& zipReader.Entry.Key!.EndsWith(".log", StringComparison.InvariantCultureIgnoreCase)
&& !zipReader.Entry.Key.Contains("tty.log", StringComparison.InvariantCultureIgnoreCase))
{
LogSize = zipReader.Entry.Size;
Expand Down
2 changes: 1 addition & 1 deletion CompatBot/Utils/ColorGetter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static SixLabors.ImageSharp.Color GetDominentColor(SixLabors.ImageSharp.I
return defaultColor;

// TODO .net6 breaks this for linux
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
if (!OperatingSystem.IsWindowsVersionAtLeast(6, 1))
return defaultColor;

var analyzer = new ColorThief();
Expand Down
6 changes: 3 additions & 3 deletions CompatBot/Utils/Extensions/AzureDevOpsClientExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public static async Task<BuildInfo> GetArtifactsInfoAsync(this BuildHttpClient a
using var zipStream = ReaderFactory.Open(stream);
while (zipStream.MoveToNextEntry() && !cancellationToken.IsCancellationRequested)
{
if (zipStream.Entry.Key.EndsWith(".7z", StringComparison.InvariantCultureIgnoreCase))
if (zipStream.Entry.Key?.EndsWith(".7z", StringComparison.InvariantCultureIgnoreCase) is true)
{
result = result with {WindowsFilename = Path.GetFileName(zipStream.Entry.Key)};
break;
Expand Down Expand Up @@ -248,7 +248,7 @@ public static async Task<BuildInfo> GetArtifactsInfoAsync(this BuildHttpClient a
using var zipStream = ReaderFactory.Open(stream);
while (zipStream.MoveToNextEntry() && !cancellationToken.IsCancellationRequested)
{
if (zipStream.Entry.Key.EndsWith(".AppImage", StringComparison.InvariantCultureIgnoreCase))
if (zipStream.Entry.Key?.EndsWith(".AppImage", StringComparison.InvariantCultureIgnoreCase) is true)
{
result = result with {LinuxFilename = Path.GetFileName(zipStream.Entry.Key)};
break;
Expand All @@ -275,7 +275,7 @@ public static async Task<BuildInfo> GetArtifactsInfoAsync(this BuildHttpClient a
using var zipStream = ReaderFactory.Open(stream);
while (zipStream.MoveToNextEntry() && !cancellationToken.IsCancellationRequested)
{
if (zipStream.Entry.Key.EndsWith(".dmg", StringComparison.InvariantCultureIgnoreCase))
if (zipStream.Entry.Key?.EndsWith(".dmg", StringComparison.InvariantCultureIgnoreCase) is true)
{
result = result with { MacFilename = Path.GetFileName(zipStream.Entry.Key) };
break;
Expand Down
3 changes: 3 additions & 0 deletions CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,7 @@ select m
>= 20 and < 40 => driverVer.Major switch
{
// see https://en.wikipedia.org/wiki/Windows_Display_Driver_Model#WDDM_2.0
// and https://learn.microsoft.com/en-us/windows-hardware/drivers/display/windows-vista-display-driver-model-design-guide
20 => "10",
21 => "10 1607",
22 => "10 1703",
Expand All @@ -901,6 +902,7 @@ select m
29 => "10 21H1",
30 => "11 21H2",
31 => "11 22H2",
32 => "11 24H2",
_ => null,
},
_ => null,
Expand Down Expand Up @@ -964,6 +966,7 @@ select m
< 26052 => "11 Canary Build " + windowsVersion.Build, // 25k series
26100 => "11 24H2",
< 26120 => "11 Dev/Canary Build " + windowsVersion.Build, // dev/canary merge branch before 24H2
26120 => "11 24H2 Dev Build",
<27000 => "11 Canary Build " + windowsVersion.Build,
_ => "11 ??? Build " + windowsVersion.Build,
},
Expand Down
Loading