Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a9aa84af0f | |||
| dcbd9bab41 | |||
| 92d5d9c2d3 | |||
| 47d106e288 | |||
| a5624897e9 |
@@ -6,7 +6,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
|
|
||||||
env:
|
env:
|
||||||
VERSION: 3.0.7
|
VERSION: 3.0.9
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# ЧАСТЬ 1: Собираем образы и кладем в Gitea (чтобы делиться с ребятами)
|
# ЧАСТЬ 1: Собираем образы и кладем в Gitea (чтобы делиться с ребятами)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>3.0.7</Version>
|
<Version>3.0.9</Version>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<LangVersion>preview</LangVersion>
|
<LangVersion>preview</LangVersion>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
|
|||||||
+3
-3
@@ -49,7 +49,7 @@ services:
|
|||||||
crond -f
|
crond -f
|
||||||
|
|
||||||
bot:
|
bot:
|
||||||
image: git.codeanddice.ru/toutsu/gmrelay-bot:3.0.7
|
image: git.codeanddice.ru/toutsu/gmrelay-bot:3.0.9
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
@@ -67,7 +67,7 @@ services:
|
|||||||
retries: 3
|
retries: 3
|
||||||
|
|
||||||
discord:
|
discord:
|
||||||
image: git.codeanddice.ru/toutsu/gmrelay-discord-bot:3.0.7
|
image: git.codeanddice.ru/toutsu/gmrelay-discord-bot:3.0.9
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
@@ -84,7 +84,7 @@ services:
|
|||||||
retries: 3
|
retries: 3
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: git.codeanddice.ru/toutsu/gmrelay-web:3.0.7
|
image: git.codeanddice.ru/toutsu/gmrelay-web:3.0.9
|
||||||
restart: always
|
restart: always
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using GmRelay.DiscordBot.Rendering;
|
using GmRelay.DiscordBot.Rendering;
|
||||||
using NetCord;
|
using NetCord;
|
||||||
using NetCord.Rest;
|
using NetCord.Rest;
|
||||||
using NetCord.Services.ApplicationCommands;
|
using NetCord.Services.ApplicationCommands;
|
||||||
@@ -23,18 +23,32 @@ public class DiscordNewSessionCommand : ApplicationCommandModule<SlashCommandCon
|
|||||||
[SlashCommandParameter(Name = "seats", Description = "Maximum number of players")] long? seats = null,
|
[SlashCommandParameter(Name = "seats", Description = "Maximum number of players")] long? seats = null,
|
||||||
[SlashCommandParameter(Name = "link", Description = "Join link")] string? link = null)
|
[SlashCommandParameter(Name = "link", Description = "Join link")] string? link = null)
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation(
|
||||||
|
"newsession called by user {UserId} ({UserType}) in guild {GuildId}, channel {ChannelId}",
|
||||||
|
Context.User.Id,
|
||||||
|
Context.User.GetType().Name,
|
||||||
|
Context.Interaction.GuildId,
|
||||||
|
Context.Channel?.Id);
|
||||||
|
|
||||||
var guildId = Context.Interaction.GuildId
|
var guildId = Context.Interaction.GuildId
|
||||||
?? throw new InvalidOperationException("This command can only be used in a guild.");
|
?? throw new InvalidOperationException("This command can only be used in a guild.");
|
||||||
|
|
||||||
var member = Context.User as GuildInteractionUser
|
var member = Context.User as GuildInteractionUser;
|
||||||
?? throw new InvalidOperationException("Guild member data not available in interaction.");
|
if (member is null)
|
||||||
|
{
|
||||||
|
_logger.LogError("Context.User is not GuildInteractionUser. Actual type: {ActualType}", Context.User.GetType().Name);
|
||||||
|
throw new InvalidOperationException("Guild member data not available in interaction.");
|
||||||
|
}
|
||||||
|
|
||||||
var resolvedPermissions = (ulong)member.Permissions;
|
var resolvedPermissions = (ulong)member.Permissions;
|
||||||
|
_logger.LogInformation("Resolved permissions for user {UserId}: {Permissions}", Context.User.Id, resolvedPermissions);
|
||||||
|
|
||||||
ulong guildOwnerId = 0;
|
ulong guildOwnerId = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var guild = await Context.Client.Rest.GetGuildAsync(guildId);
|
var guild = await Context.Client.Rest.GetGuildAsync(guildId);
|
||||||
guildOwnerId = guild.OwnerId;
|
guildOwnerId = guild.OwnerId;
|
||||||
|
_logger.LogInformation("Guild owner id: {OwnerId}", guildOwnerId);
|
||||||
}
|
}
|
||||||
catch (RestException ex) when (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
|
catch (RestException ex) when (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||||
{
|
{
|
||||||
@@ -43,6 +57,10 @@ public class DiscordNewSessionCommand : ApplicationCommandModule<SlashCommandCon
|
|||||||
"Bot is not a REST member of guild {GuildId}; using resolved permissions from interaction payload",
|
"Bot is not a REST member of guild {GuildId}; using resolved permissions from interaction payload",
|
||||||
guildId);
|
guildId);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Unexpected error fetching guild {GuildId}", guildId);
|
||||||
|
}
|
||||||
|
|
||||||
var timeResult = DiscordNewSessionHandler.ParseTimeInput(time);
|
var timeResult = DiscordNewSessionHandler.ParseTimeInput(time);
|
||||||
if (!timeResult.IsSuccess)
|
if (!timeResult.IsSuccess)
|
||||||
@@ -52,11 +70,16 @@ public class DiscordNewSessionCommand : ApplicationCommandModule<SlashCommandCon
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Defer the response to avoid Discord 3-second interaction timeout
|
||||||
|
await Context.Interaction.SendResponseAsync(InteractionCallback.DeferredMessage());
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("Creating session for guild {GuildId}, user {UserId}", guildId, Context.User.Id);
|
||||||
|
|
||||||
var view = await _handler.HandleAsync(
|
var view = await _handler.HandleAsync(
|
||||||
guildId: guildId.ToString(),
|
guildId: guildId.ToString(),
|
||||||
channelId: Context.Channel.Id.ToString(),
|
channelId: Context.Channel!.Id.ToString(),
|
||||||
userId: Context.User.Id,
|
userId: Context.User.Id,
|
||||||
userDisplayName: Context.User.GlobalName ?? Context.User.Username,
|
userDisplayName: Context.User.GlobalName ?? Context.User.Username,
|
||||||
resolvedPermissions: resolvedPermissions,
|
resolvedPermissions: resolvedPermissions,
|
||||||
@@ -67,23 +90,36 @@ public class DiscordNewSessionCommand : ApplicationCommandModule<SlashCommandCon
|
|||||||
joinLink: link,
|
joinLink: link,
|
||||||
CancellationToken.None);
|
CancellationToken.None);
|
||||||
|
|
||||||
|
_logger.LogInformation("Session created successfully. Building render.");
|
||||||
|
|
||||||
var (embeds, actionRows) = DiscordSessionBatchRenderer.Render(view);
|
var (embeds, actionRows) = DiscordSessionBatchRenderer.Render(view);
|
||||||
await Context.Interaction.SendResponseAsync(
|
|
||||||
InteractionCallback.Message(new InteractionMessageProperties()
|
_logger.LogInformation("Sending success response.");
|
||||||
.WithContent(":white_check_mark: **Session created successfully!**")
|
|
||||||
.WithEmbeds(embeds)
|
await Context.Interaction.ModifyResponseAsync(message =>
|
||||||
.WithComponents(actionRows)));
|
{
|
||||||
|
message.Content = ":white_check_mark: **Session created successfully!**";
|
||||||
|
message.Embeds = embeds;
|
||||||
|
message.Components = actionRows;
|
||||||
|
});
|
||||||
|
|
||||||
|
_logger.LogInformation("Success response sent.");
|
||||||
}
|
}
|
||||||
catch (UnauthorizedAccessException ex)
|
catch (UnauthorizedAccessException ex)
|
||||||
{
|
{
|
||||||
await Context.Interaction.SendResponseAsync(
|
_logger.LogWarning(ex, "Unauthorized session creation attempt by user {UserId}", Context.User.Id);
|
||||||
InteractionCallback.Message($":no_entry: {ex.Message}"));
|
await Context.Interaction.ModifyResponseAsync(message =>
|
||||||
|
{
|
||||||
|
message.Content = $":no_entry: {ex.Message}";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Failed to create session for user {UserId} in guild {GuildId}", Context.User.Id, guildId);
|
_logger.LogError(ex, "Failed to create session for user {UserId} in guild {GuildId}", Context.User.Id, guildId);
|
||||||
await Context.Interaction.SendResponseAsync(
|
await Context.Interaction.ModifyResponseAsync(message =>
|
||||||
InteractionCallback.Message(":boom: An error occurred while creating the session."));
|
{
|
||||||
|
message.Content = ":boom: An error occurred while creating the session.";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,18 +23,31 @@ public class DiscordRescheduleCommand : ApplicationCommandModule<SlashCommandCon
|
|||||||
[SlashCommandParameter(Name = "option3", Description = "Third time option (optional)")] string? option3 = null,
|
[SlashCommandParameter(Name = "option3", Description = "Third time option (optional)")] string? option3 = null,
|
||||||
[SlashCommandParameter(Name = "deadline", Description = "Voting deadline (YYYY-MM-DD HH:mm)")] string deadline = "")
|
[SlashCommandParameter(Name = "deadline", Description = "Voting deadline (YYYY-MM-DD HH:mm)")] string deadline = "")
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation(
|
||||||
|
"reschedule called by user {UserId} ({UserType}) in guild {GuildId}",
|
||||||
|
Context.User.Id,
|
||||||
|
Context.User.GetType().Name,
|
||||||
|
Context.Interaction.GuildId);
|
||||||
|
|
||||||
var guildId = Context.Interaction.GuildId
|
var guildId = Context.Interaction.GuildId
|
||||||
?? throw new InvalidOperationException("This command can only be used in a guild.");
|
?? throw new InvalidOperationException("This command can only be used in a guild.");
|
||||||
|
|
||||||
var member = Context.User as GuildInteractionUser
|
var member = Context.User as GuildInteractionUser;
|
||||||
?? throw new InvalidOperationException("Guild member data not available in interaction.");
|
if (member is null)
|
||||||
|
{
|
||||||
|
_logger.LogError("Context.User is not GuildInteractionUser. Actual type: {ActualType}", Context.User.GetType().Name);
|
||||||
|
throw new InvalidOperationException("Guild member data not available in interaction.");
|
||||||
|
}
|
||||||
|
|
||||||
var resolvedPermissions = (ulong)member.Permissions;
|
var resolvedPermissions = (ulong)member.Permissions;
|
||||||
|
_logger.LogInformation("Resolved permissions for user {UserId}: {Permissions}", Context.User.Id, resolvedPermissions);
|
||||||
|
|
||||||
ulong guildOwnerId = 0;
|
ulong guildOwnerId = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var guild = await Context.Client.Rest.GetGuildAsync(guildId);
|
var guild = await Context.Client.Rest.GetGuildAsync(guildId);
|
||||||
guildOwnerId = guild.OwnerId;
|
guildOwnerId = guild.OwnerId;
|
||||||
|
_logger.LogInformation("Guild owner id: {OwnerId}", guildOwnerId);
|
||||||
}
|
}
|
||||||
catch (RestException ex) when (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
|
catch (RestException ex) when (ex.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||||
{
|
{
|
||||||
@@ -43,6 +56,10 @@ public class DiscordRescheduleCommand : ApplicationCommandModule<SlashCommandCon
|
|||||||
"Bot is not a REST member of guild {GuildId}; using resolved permissions from interaction payload",
|
"Bot is not a REST member of guild {GuildId}; using resolved permissions from interaction payload",
|
||||||
guildId);
|
guildId);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Unexpected error fetching guild {GuildId}", guildId);
|
||||||
|
}
|
||||||
|
|
||||||
if (!Guid.TryParse(sessionIdText, out var sessionId))
|
if (!Guid.TryParse(sessionIdText, out var sessionId))
|
||||||
{
|
{
|
||||||
@@ -83,11 +100,16 @@ public class DiscordRescheduleCommand : ApplicationCommandModule<SlashCommandCon
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Defer the response to avoid Discord 3-second interaction timeout
|
||||||
|
await Context.Interaction.SendResponseAsync(InteractionCallback.DeferredMessage());
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("Initiating reschedule for session {SessionId} in guild {GuildId}", sessionId, guildId);
|
||||||
|
|
||||||
var result = await _handler.HandleAsync(
|
var result = await _handler.HandleAsync(
|
||||||
guildId: guildId.ToString(),
|
guildId: guildId.ToString(),
|
||||||
channelId: Context.Channel.Id.ToString(),
|
channelId: Context.Channel!.Id.ToString(),
|
||||||
userId: Context.User.Id,
|
userId: Context.User.Id,
|
||||||
userDisplayName: Context.User.GlobalName ?? Context.User.Username,
|
userDisplayName: Context.User.GlobalName ?? Context.User.Username,
|
||||||
resolvedPermissions: resolvedPermissions,
|
resolvedPermissions: resolvedPermissions,
|
||||||
@@ -97,25 +119,36 @@ public class DiscordRescheduleCommand : ApplicationCommandModule<SlashCommandCon
|
|||||||
deadline: deadlineResult.Value,
|
deadline: deadlineResult.Value,
|
||||||
CancellationToken.None);
|
CancellationToken.None);
|
||||||
|
|
||||||
await Context.Interaction.SendResponseAsync(
|
_logger.LogInformation("Reschedule voting started for session {SessionId}, proposal {ProposalId}", sessionId, result.ProposalId);
|
||||||
InteractionCallback.Message(
|
|
||||||
$"🗳 Голосование за перенос запущено! Дедлайн: {deadlineResult.Value:yyyy-MM-dd HH:mm} UTC."));
|
await Context.Interaction.ModifyResponseAsync(message =>
|
||||||
|
{
|
||||||
|
message.Content = $"🗳 Голосование за перенос запущено! Дедлайн: {deadlineResult.Value:yyyy-MM-dd HH:mm} UTC.";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (UnauthorizedAccessException ex)
|
catch (UnauthorizedAccessException ex)
|
||||||
{
|
{
|
||||||
await Context.Interaction.SendResponseAsync(
|
_logger.LogWarning(ex, "Unauthorized reschedule attempt by user {UserId}", Context.User.Id);
|
||||||
InteractionCallback.Message($":no_entry: {ex.Message}"));
|
await Context.Interaction.ModifyResponseAsync(message =>
|
||||||
|
{
|
||||||
|
message.Content = $":no_entry: {ex.Message}";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException ex)
|
catch (InvalidOperationException ex)
|
||||||
{
|
{
|
||||||
await Context.Interaction.SendResponseAsync(
|
_logger.LogWarning(ex, "Invalid reschedule request by user {UserId}", Context.User.Id);
|
||||||
InteractionCallback.Message($":warning: {ex.Message}"));
|
await Context.Interaction.ModifyResponseAsync(message =>
|
||||||
|
{
|
||||||
|
message.Content = $":warning: {ex.Message}";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Failed to initiate reschedule for session {SessionId}", sessionId);
|
_logger.LogError(ex, "Failed to initiate reschedule for session {SessionId}", sessionId);
|
||||||
await Context.Interaction.SendResponseAsync(
|
await Context.Interaction.ModifyResponseAsync(message =>
|
||||||
InteractionCallback.Message(":boom: Ошибка при запуске голосования."));
|
{
|
||||||
|
message.Content = ":boom: Ошибка при запуске голосования.";
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,14 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<UserSecretsId>dotnet-GmRelay.DiscordBot-issue-26</UserSecretsId>
|
<UserSecretsId>dotnet-GmRelay.DiscordBot-issue-26</UserSecretsId>
|
||||||
|
<!-- DiscordBot uses vanilla Dapper in its own handlers; DAP005 requires AOT-enabled Dapper -->
|
||||||
|
<NoWarn>$(NoWarn);DAP005</NoWarn>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Aspire.Npgsql" Version="13.2.2" />
|
<PackageReference Include="Aspire.Npgsql" Version="13.2.2" />
|
||||||
<PackageReference Include="Dapper" Version="2.1.72" />
|
<PackageReference Include="Dapper" Version="2.1.72" />
|
||||||
|
<PackageReference Include="Dapper.AOT" Version="1.0.48" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.5" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.5" />
|
||||||
<PackageReference Include="NetCord.Hosting" Version="1.0.0-alpha.489" />
|
<PackageReference Include="NetCord.Hosting" Version="1.0.0-alpha.489" />
|
||||||
<PackageReference Include="NetCord.Hosting.Services" Version="1.0.0-alpha.489" />
|
<PackageReference Include="NetCord.Hosting.Services" Version="1.0.0-alpha.489" />
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ discordOptions.Validate();
|
|||||||
|
|
||||||
builder.Services.AddSingleton(discordOptions);
|
builder.Services.AddSingleton(discordOptions);
|
||||||
|
|
||||||
|
builder.Logging.AddConsole();
|
||||||
|
|
||||||
builder.Services.AddSingleton<NpgsqlDataSource>(sp =>
|
builder.Services.AddSingleton<NpgsqlDataSource>(sp =>
|
||||||
{
|
{
|
||||||
var config = sp.GetRequiredService<IConfiguration>();
|
var config = sp.GetRequiredService<IConfiguration>();
|
||||||
|
|||||||
@@ -28,6 +28,12 @@
|
|||||||
"resolved": "2.1.72",
|
"resolved": "2.1.72",
|
||||||
"contentHash": "ns4mGqQd9a/MhP8m6w556vVlZIa0/MfUu03zrxjZC/jlr1uVCsUac8bkdB+Fs98Llbd56rRSo1eZH5VVmeGZyw=="
|
"contentHash": "ns4mGqQd9a/MhP8m6w556vVlZIa0/MfUu03zrxjZC/jlr1uVCsUac8bkdB+Fs98Llbd56rRSo1eZH5VVmeGZyw=="
|
||||||
},
|
},
|
||||||
|
"Dapper.AOT": {
|
||||||
|
"type": "Direct",
|
||||||
|
"requested": "[1.0.48, )",
|
||||||
|
"resolved": "1.0.48",
|
||||||
|
"contentHash": "rsLM3yKr4g+YKKox9lhc8D+kz67P7Q9+xdyn1LmCsoYr1kYpJSm+Nt6slo5UrfUrcTiGJ57zUlyO8XUdV7G7iA=="
|
||||||
|
},
|
||||||
"Microsoft.Extensions.Hosting": {
|
"Microsoft.Extensions.Hosting": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[10.0.5, )",
|
"requested": "[10.0.5, )",
|
||||||
|
|||||||
@@ -73,7 +73,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="nav-version">v3.0.7</div>
|
<div class="nav-version">v3.0.9</div>
|
||||||
</div>
|
</div>
|
||||||
</Authorized>
|
</Authorized>
|
||||||
<NotAuthorized>
|
<NotAuthorized>
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ public sealed class DiscordNewSessionHandlerTests
|
|||||||
var source = File.ReadAllText(commandPath);
|
var source = File.ReadAllText(commandPath);
|
||||||
|
|
||||||
Assert.Contains("DiscordSessionBatchRenderer.Render", source, StringComparison.Ordinal);
|
Assert.Contains("DiscordSessionBatchRenderer.Render", source, StringComparison.Ordinal);
|
||||||
Assert.Contains("WithEmbeds", source, StringComparison.Ordinal);
|
Assert.Contains("message.Embeds = embeds", source, StringComparison.Ordinal);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DateTimeOffset FutureDateAt1930()
|
private static DateTimeOffset FutureDateAt1930()
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ public sealed class DiscordProjectStructureTests
|
|||||||
Assert.Contains("GmRelay.Shared.csproj", project);
|
Assert.Contains("GmRelay.Shared.csproj", project);
|
||||||
Assert.DoesNotContain("Telegram.Bot", project);
|
Assert.DoesNotContain("Telegram.Bot", project);
|
||||||
Assert.DoesNotContain("GmRelay.Bot.csproj", project);
|
Assert.DoesNotContain("GmRelay.Bot.csproj", project);
|
||||||
|
Assert.Contains("Dapper.AOT", project);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -61,7 +62,7 @@ public sealed class DiscordProjectStructureTests
|
|||||||
var prChecks = File.ReadAllText(Path.Combine(repoRoot, ".gitea", "workflows", "pr-checks.yml"));
|
var prChecks = File.ReadAllText(Path.Combine(repoRoot, ".gitea", "workflows", "pr-checks.yml"));
|
||||||
var deploy = File.ReadAllText(Path.Combine(repoRoot, ".gitea", "workflows", "deploy.yml"));
|
var deploy = File.ReadAllText(Path.Combine(repoRoot, ".gitea", "workflows", "deploy.yml"));
|
||||||
|
|
||||||
Assert.Contains("gmrelay-discord-bot:3.0.7", compose);
|
Assert.Contains("gmrelay-discord-bot:3.0.9", compose);
|
||||||
Assert.Contains("Discord__Token=${DISCORD_BOT_TOKEN:?Set DISCORD_BOT_TOKEN in .env}", compose);
|
Assert.Contains("Discord__Token=${DISCORD_BOT_TOKEN:?Set DISCORD_BOT_TOKEN in .env}", compose);
|
||||||
Assert.Contains("src/GmRelay.DiscordBot/Dockerfile", deploy);
|
Assert.Contains("src/GmRelay.DiscordBot/Dockerfile", deploy);
|
||||||
Assert.Contains("DISCORD_BOT_TOKEN", deploy);
|
Assert.Contains("DISCORD_BOT_TOKEN", deploy);
|
||||||
@@ -75,13 +76,13 @@ public sealed class DiscordProjectStructureTests
|
|||||||
{
|
{
|
||||||
var repoRoot = GetRepoRoot();
|
var repoRoot = GetRepoRoot();
|
||||||
|
|
||||||
Assert.Contains("<Version>3.0.7</Version>", File.ReadAllText(Path.Combine(repoRoot, "Directory.Build.props")));
|
Assert.Contains("<Version>3.0.9</Version>", File.ReadAllText(Path.Combine(repoRoot, "Directory.Build.props")));
|
||||||
Assert.Contains("VERSION: 3.0.7", File.ReadAllText(Path.Combine(repoRoot, ".gitea", "workflows", "deploy.yml")));
|
Assert.Contains("VERSION: 3.0.9", File.ReadAllText(Path.Combine(repoRoot, ".gitea", "workflows", "deploy.yml")));
|
||||||
Assert.Contains("gmrelay-bot:3.0.7", File.ReadAllText(Path.Combine(repoRoot, "compose.yaml")));
|
Assert.Contains("gmrelay-bot:3.0.9", File.ReadAllText(Path.Combine(repoRoot, "compose.yaml")));
|
||||||
Assert.Contains("gmrelay-web:3.0.7", File.ReadAllText(Path.Combine(repoRoot, "compose.yaml")));
|
Assert.Contains("gmrelay-web:3.0.9", File.ReadAllText(Path.Combine(repoRoot, "compose.yaml")));
|
||||||
Assert.Contains("gmrelay-discord-bot:3.0.7", File.ReadAllText(Path.Combine(repoRoot, "compose.yaml")));
|
Assert.Contains("gmrelay-discord-bot:3.0.9", File.ReadAllText(Path.Combine(repoRoot, "compose.yaml")));
|
||||||
Assert.Contains(
|
Assert.Contains(
|
||||||
"v3.0.7",
|
"v3.0.9",
|
||||||
File.ReadAllText(Path.Combine(repoRoot, "src", "GmRelay.Web", "Components", "Layout", "NavMenu.razor")));
|
File.ReadAllText(Path.Combine(repoRoot, "src", "GmRelay.Web", "Components", "Layout", "NavMenu.razor")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -392,8 +392,8 @@
|
|||||||
"Aspire.Npgsql": "[13.2.2, )",
|
"Aspire.Npgsql": "[13.2.2, )",
|
||||||
"Dapper": "[2.1.72, )",
|
"Dapper": "[2.1.72, )",
|
||||||
"Dapper.AOT": "[1.0.48, )",
|
"Dapper.AOT": "[1.0.48, )",
|
||||||
"GmRelay.ServiceDefaults": "[2.5.0, )",
|
"GmRelay.ServiceDefaults": "[3.0.9, )",
|
||||||
"GmRelay.Shared": "[2.5.0, )",
|
"GmRelay.Shared": "[3.0.9, )",
|
||||||
"Npgsql": "[10.0.2, )",
|
"Npgsql": "[10.0.2, )",
|
||||||
"Telegram.Bot": "[22.9.5.3, )",
|
"Telegram.Bot": "[22.9.5.3, )",
|
||||||
"dbup-postgresql": "[7.0.1, )"
|
"dbup-postgresql": "[7.0.1, )"
|
||||||
@@ -404,8 +404,9 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Aspire.Npgsql": "[13.2.2, )",
|
"Aspire.Npgsql": "[13.2.2, )",
|
||||||
"Dapper": "[2.1.72, )",
|
"Dapper": "[2.1.72, )",
|
||||||
"GmRelay.ServiceDefaults": "[2.5.0, )",
|
"Dapper.AOT": "[1.0.48, )",
|
||||||
"GmRelay.Shared": "[2.5.0, )",
|
"GmRelay.ServiceDefaults": "[3.0.9, )",
|
||||||
|
"GmRelay.Shared": "[3.0.9, )",
|
||||||
"NetCord.Hosting": "[1.0.0-alpha.489, )",
|
"NetCord.Hosting": "[1.0.0-alpha.489, )",
|
||||||
"NetCord.Hosting.Services": "[1.0.0-alpha.489, )",
|
"NetCord.Hosting.Services": "[1.0.0-alpha.489, )",
|
||||||
"NetCord.Services": "[1.0.0-alpha.489, )",
|
"NetCord.Services": "[1.0.0-alpha.489, )",
|
||||||
@@ -436,8 +437,8 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Aspire.Npgsql": "[13.2.2, )",
|
"Aspire.Npgsql": "[13.2.2, )",
|
||||||
"Dapper": "[2.1.72, )",
|
"Dapper": "[2.1.72, )",
|
||||||
"GmRelay.ServiceDefaults": "[2.5.0, )",
|
"GmRelay.ServiceDefaults": "[3.0.9, )",
|
||||||
"GmRelay.Shared": "[2.5.0, )",
|
"GmRelay.Shared": "[3.0.9, )",
|
||||||
"Npgsql": "[10.0.2, )",
|
"Npgsql": "[10.0.2, )",
|
||||||
"Telegram.Bot": "[22.9.6.1, )"
|
"Telegram.Bot": "[22.9.6.1, )"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user