Skip to content

Commit

Permalink
Merge pull request #946 from 13xforever/vnext
Browse files Browse the repository at this point in the history
Upgrade to .NET 8.0
  • Loading branch information
clienthax authored Nov 15, 2023
2 parents 07c654c + 5a8f73a commit f4d42ab
Show file tree
Hide file tree
Showing 22 changed files with 96 additions and 91 deletions.
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"isRoot": true,
"tools": {
"strawberryshake.tools": {
"version": "13.4.0",
"version": "13.7.0",
"commands": [
"dotnet-graphql"
]
},
"dotnet-ef": {
"version": "7.0.9",
"version": "8.0.0",
"commands": [
"dotnet-ef"
]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Update dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.0.x'
dotnet-version: '8.0.x'

- name: Checkout repository
uses: actions/checkout@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: update dotnet core sdk
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: dotnet restore (first try)
run: dotnet restore --ignore-failed-sources
- name: dotnet restore (second try)
Expand All @@ -35,7 +35,7 @@ jobs:
- name: update dotnet core sdk
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: dotnet restore (first try)
run: dotnet restore --ignore-failed-sources
- name: dotnet restore (second try)
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- name: update dotnet core sdk
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: dotnet restore (first try)
run: dotnet restore --ignore-failed-sources
- name: dotnet restore (second try)
Expand Down
10 changes: 5 additions & 5 deletions Clients/CirrusCiClient/CirrusCiClient.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<EmitCompilerGeneratedFiles>false</EmitCompilerGeneratedFiles>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\CompatApiClient\CompatApiClient.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="StrawberryShake.Server" Version="13.5.1" />
<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.7.0" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions Clients/CompatApiClient/CompatApiClient.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand All @@ -14,10 +14,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<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="2.3.2" />
<PackageReference Include="NLog" Version="5.2.4" />
<PackageReference Include="NLog" Version="5.2.5" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions Clients/GithubClient/GithubClient.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<PackageReference Include="Octokit" Version="7.1.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageReference Include="Octokit" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CompatApiClient\CompatApiClient.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions Clients/IrdLibraryClient/IrdLibraryClient.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Crc32.NET" Version="1.2.0" />
<PackageReference Include="DiscUtils.OpticalDisk" Version="0.16.13" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.53" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.54" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.3.2" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Clients/MediafireClient/MediafireClient.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Clients/OneDriveClient/OneDriveClient.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Clients/PsnClient/PsnClient.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
Expand All @@ -10,8 +10,8 @@
<EmbeddedResource Include="certificates\*.cer" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.9" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="7.0.0" />
<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="2.3.2" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Clients/YandexDiskClient/YandexDiskClient.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
Expand Down
59 changes: 32 additions & 27 deletions CompatBot/Commands/Pr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CirrusCiClient;
using CompatApiClient.Utils;
using CompatBot.Commands.Attributes;
using CompatBot.Utils;
Expand All @@ -12,7 +11,8 @@
using DSharpPlus.CommandsNext;
using DSharpPlus.CommandsNext.Attributes;
using DSharpPlus.Entities;
using TaskStatus = CirrusCiClient.Generated.TaskStatus;
using Microsoft.TeamFoundation.Build.WebApi;
using BuildStatus = Microsoft.TeamFoundation.Build.WebApi.BuildStatus;

namespace CompatBot.Commands;

Expand Down Expand Up @@ -134,13 +134,13 @@ public static async Task LinkPrBuild(DiscordClient client, DiscordMessage messag
string? macDownloadText = null;
string? buildTime = null;

if (prInfo.Head?.Sha is string commit)
if (azureClient != null && prInfo.Head?.Sha is string commit)
try
{
windowsDownloadText = "⏳ Pending...";
linuxDownloadText = "⏳ Pending...";
macDownloadText = "⏳ Pending...";
var latestBuild = await CirrusCi.GetPrBuildInfoAsync(commit, prInfo.MergedAt?.DateTime, pr, Config.Cts.Token).ConfigureAwait(false);
var latestBuild = await azureClient.GetPrBuildInfoAsync(commit, prInfo.MergedAt?.DateTime, pr, Config.Cts.Token).ConfigureAwait(false);
if (latestBuild == null)
{
if (state == "Open")
Expand All @@ -155,20 +155,23 @@ public static async Task LinkPrBuild(DiscordClient client, DiscordMessage messag
{
bool shouldHaveArtifacts = false;

if ((latestBuild.WindowsBuild?.Status is TaskStatus.Completed
|| latestBuild.LinuxBuild?.Status is TaskStatus.Completed
|| latestBuild.MacBuild?.Status is TaskStatus.Completed)
&& latestBuild.FinishTime.HasValue)
if (latestBuild is
{
Status: BuildStatus.Completed,
Result: BuildResult.Succeeded or BuildResult.PartiallySucceeded,
FinishTime: not null
})
{
buildTime = $"Built on {latestBuild.FinishTime:u} ({(DateTime.UtcNow - latestBuild.FinishTime.Value).AsTimeDeltaDescription()} ago)";
shouldHaveArtifacts = true;
}

// Check for subtask errors (win/lin/mac)
if (latestBuild.WindowsBuild?.Status is TaskStatus.Aborted or TaskStatus.Failed or TaskStatus.Skipped)
if (latestBuild.Result is BuildResult.Failed or BuildResult.Canceled)
{
windowsDownloadText = $"{latestBuild.WindowsBuild?.Status}";
windowsDownloadText = $"{latestBuild.Result}";
}
/*
if (latestBuild.LinuxBuild?.Status is TaskStatus.Aborted or TaskStatus.Failed or TaskStatus.Skipped)
{
linuxDownloadText = $"❌ {latestBuild.LinuxBuild?.Status}";
Expand All @@ -177,17 +180,20 @@ public static async Task LinkPrBuild(DiscordClient client, DiscordMessage messag
{
macDownloadText = $"❌ {latestBuild.MacBuild?.Status}";
}
*/

// Check estimated time for pending builds
if (latestBuild.WindowsBuild?.Status is TaskStatus.Executing
|| latestBuild.LinuxBuild?.Status is TaskStatus.Executing
|| latestBuild.MacBuild?.Status is TaskStatus.Executing)
if (latestBuild is { Status: BuildStatus.InProgress, StartTime: not null })
{
var estimatedCompletionTime = latestBuild.StartTime + (await CirrusCi.GetPipelineDurationAsync(Config.Cts.Token).ConfigureAwait(false)).Mean;
var estimatedCompletionTime = latestBuild.StartTime.Value + (await azureClient.GetPipelineDurationAsync(Config.Cts.Token).ConfigureAwait(false)).Mean;
var estimatedTime = TimeSpan.FromMinutes(1);
if (estimatedCompletionTime > DateTime.UtcNow)
estimatedTime = estimatedCompletionTime - DateTime.UtcNow;
windowsDownloadText = $"⏳ Pending in {estimatedTime.AsTimeDeltaDescription()}...";
linuxDownloadText = windowsDownloadText;
macDownloadText = windowsDownloadText;

/*
if (latestBuild.WindowsBuild?.Status is TaskStatus.Executing)
{
windowsDownloadText = $"⏳ Pending in {estimatedTime.AsTimeDeltaDescription()}...";
Expand All @@ -200,43 +206,44 @@ public static async Task LinkPrBuild(DiscordClient client, DiscordMessage messag
{
macDownloadText = $"⏳ Pending in {estimatedTime.AsTimeDeltaDescription()}...";
}
*/
}

// windows build
var name = latestBuild.WindowsBuild?.Filename ?? "Windows PR Build";
var name = latestBuild.WindowsFilename ?? "Windows PR Build";
name = name.Replace("rpcs3-", "").Replace("_win64", "");
if (!string.IsNullOrEmpty(latestBuild.WindowsBuild?.DownloadLink))
windowsDownloadText = $"[⏬ {name}]({latestBuild.WindowsBuild?.DownloadLink})";
if (!string.IsNullOrEmpty(latestBuild.WindowsBuildDownloadLink))
windowsDownloadText = $"[⏬ {name}]({latestBuild.WindowsBuildDownloadLink})";
else if (shouldHaveArtifacts)
{
if (latestBuild.FinishTime.HasValue && (DateTime.UtcNow - latestBuild.FinishTime.Value).TotalDays > 30)
windowsDownloadText = "No longer available";
}

// linux build
name = latestBuild.LinuxBuild?.Filename ?? "Linux PR Build";
name = latestBuild.LinuxFilename ?? "Linux PR Build";
name = name.Replace("rpcs3-", "").Replace("_linux64", "");
if (!string.IsNullOrEmpty(latestBuild.LinuxBuild?.DownloadLink))
linuxDownloadText = $"[⏬ {name}]({latestBuild.LinuxBuild?.DownloadLink})";
if (!string.IsNullOrEmpty(latestBuild.LinuxBuildDownloadLink))
linuxDownloadText = $"[⏬ {name}]({latestBuild.LinuxBuildDownloadLink})";
else if (shouldHaveArtifacts)
{
if (latestBuild.FinishTime.HasValue && (DateTime.UtcNow - latestBuild.FinishTime.Value).TotalDays > 30)
linuxDownloadText = "No longer available";
}

// mac build
name = latestBuild.MacBuild?.Filename ?? "Mac PR Build";
name = latestBuild.MacFilename ?? "Mac PR Build";
name = name.Replace("rpcs3-", "").Replace("_macos", "");
if (!string.IsNullOrEmpty(latestBuild.MacBuild?.DownloadLink))
macDownloadText = $"[⏬ {name}]({latestBuild.MacBuild?.DownloadLink})";
if (!string.IsNullOrEmpty(latestBuild.MacBuildDownloadLink))
macDownloadText = $"[⏬ {name}]({latestBuild.MacBuildDownloadLink})";
else if (shouldHaveArtifacts)
{
if (latestBuild.FinishTime.HasValue && (DateTime.UtcNow - latestBuild.FinishTime.Value).TotalDays > 30)
macDownloadText = "No longer available";
}

// Neatify PR's with missing builders
if (latestBuild.WindowsBuild?.Status is null)
/*if (latestBuild.WindowsBuild?.Status is null)
{
windowsDownloadText = null;
}
Expand All @@ -247,9 +254,7 @@ public static async Task LinkPrBuild(DiscordClient client, DiscordMessage messag
if (latestBuild.MacBuild?.Status is null)
{
macDownloadText = null;
}


}*/
}
}
catch (Exception e)
Expand Down
2 changes: 1 addition & 1 deletion CompatBot/Commands/Sudo.Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ await ctx.Channel.SendMessageAsync(ctx.Channel.IsPrivate
).ConfigureAwait(false);
Config.Log.Info($"Shutting down by request from {ctx.User.Username}#{ctx.User.Discriminator}");
Config.InMemorySettings["shutdown"] = "true";
Config.Cts.Cancel();
await Config.Cts.CancelAsync().ConfigureAwait(false);
}

[Command("status")]
Expand Down
36 changes: 18 additions & 18 deletions CompatBot/CompatBot.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<TieredCompilation>true</TieredCompilation>
<RootNamespace>CompatBot</RootNamespace>
<UserSecretsId>c2e6548b-b215-4a18-a010-958ef294b310</UserSecretsId>
Expand Down Expand Up @@ -39,36 +39,36 @@
<AdditionalFiles Include="..\win32_error_codes*.txt" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="DSharpPlus" Version="4.4.2" />
<PackageReference Include="DSharpPlus.CommandsNext" Version="4.4.2" />
<PackageReference Include="DSharpPlus.Interactivity" Version="4.4.2" />
<PackageReference Include="DSharpPlus.SlashCommands" Version="4.4.2" />
<PackageReference Include="Google.Apis.Drive.v3" Version="1.62.0.3155" />
<PackageReference Include="DSharpPlus" Version="4.4.3" />
<PackageReference Include="DSharpPlus.CommandsNext" Version="4.4.3" />
<PackageReference Include="DSharpPlus.Interactivity" Version="4.4.3" />
<PackageReference Include="DSharpPlus.SlashCommands" Version="4.4.3" />
<PackageReference Include="Google.Apis.Drive.v3" Version="1.63.0.3155" />
<PackageReference Include="ksemenenko.ColorThief" Version="1.1.1.4" />
<PackageReference Include="MathParser.org-mXparser" Version="5.2.1" />
<PackageReference Include="MegaApiClient" Version="1.10.3" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.21.0" />
<PackageReference Include="Microsoft.ApplicationInsights.PerfCounterCollector" Version="2.21.0" />
<PackageReference Include="Microsoft.Azure.CognitiveServices.Vision.ComputerVision" Version="7.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.11">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.11" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.0" />
<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="2.3.2" />
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="16.205.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageReference Include="Nerdbank.Streams" Version="2.10.69" />
<PackageReference Include="NLog" Version="5.2.4" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.4" />
<PackageReference Include="Nerdbank.Streams" Version="2.10.72" />
<PackageReference Include="NLog" Version="5.2.5" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.5" />
<PackageReference Include="NReco.Text.AhoCorasickDoubleArrayTrie" Version="1.1.1" />
<PackageReference Include="SharpCompress" Version="0.34.0" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.0.0" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
<PackageReference Include="SharpCompress" Version="0.34.1" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.0.1" />
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Clients\CirrusCiClient\CirrusCiClient.csproj" />
Expand Down
Loading

0 comments on commit f4d42ab

Please sign in to comment.