mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 21:16:52 +01:00
Merge pull request #2131 from Drulikar/tm_spam_reduction
TM Comment Consolidation in Github/Gitlab
This commit is contained in:
@@ -21,6 +21,8 @@ artifacts/
|
||||
/src/Tgstation.Server.Host/wwwroot
|
||||
/src/Tgstation.Server.Host/--applicationName
|
||||
/src/Tgstation.Server.Host/ClientApp
|
||||
/src/Tgstation.Server.Host.Utils.GitLab.GraphQL/node_modules
|
||||
/src/Tgstation.Server.Host.Utils.GitLab.GraphQL/schema.graphql
|
||||
/tools/Tgstation.Server.ReleaseNotes/release_notes.md
|
||||
launchSettings.json
|
||||
release_notes.md
|
||||
@@ -29,3 +31,4 @@ changelog.yml
|
||||
*.sqlite3
|
||||
packaging/
|
||||
yarn-error.log*
|
||||
.graphqlrc.json
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"schema": "schema.graphql",
|
||||
"documents": "**/*.graphql",
|
||||
"extensions": {
|
||||
"strawberryShake": {
|
||||
"name": "GraphQLClient",
|
||||
"url": "../../artifacts/gitlab-api.graphql",
|
||||
"namespace": "Tgstation.Server.Host.Utils.GitLab.GraphQL",
|
||||
"records": {
|
||||
"inputs": false,
|
||||
"entities": false
|
||||
},
|
||||
"transportProfiles": [
|
||||
{
|
||||
"default": "Http",
|
||||
"subscription": "Http"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
mutation CreateNote($id: NoteableID!, $body: String!) {
|
||||
createNote(input: { noteableId: $id, body: $body }) {
|
||||
note {
|
||||
id
|
||||
body
|
||||
discussion {
|
||||
id
|
||||
}
|
||||
}
|
||||
errors
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
mutation ModifyNote($id: NoteID!, $body: String!) {
|
||||
updateNote(input: { id: $id, body: $body }) {
|
||||
note {
|
||||
id
|
||||
body
|
||||
}
|
||||
errors
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
query GetCurrentUser {
|
||||
currentUser
|
||||
{
|
||||
username
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
query GetMergeRequest($project: ID!, $number: String!) {
|
||||
project(fullPath: $project) {
|
||||
mergeRequest(iid: $number) {
|
||||
author { username }
|
||||
description
|
||||
title
|
||||
diffHeadSha
|
||||
mergeCommitSha
|
||||
webUrl
|
||||
iid
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
query GetMergeRequestNotes($project: ID!, $number: String!) {
|
||||
project(fullPath: $project) {
|
||||
mergeRequest(iid: $number) {
|
||||
iid
|
||||
id
|
||||
notes {
|
||||
nodes {
|
||||
author { username }
|
||||
body
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
query GetMergeRequests($project: ID!, $numbers: [String!]!) {
|
||||
project(fullPath: $project) {
|
||||
mergeRequests(iids: $numbers) {
|
||||
nodes {
|
||||
state
|
||||
diffHeadSha
|
||||
mergeCommitSha
|
||||
closedAt
|
||||
iid
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Tgstation.Server.Host.Utils.GitLab.GraphQL
|
||||
{
|
||||
/// <inheritdoc />
|
||||
sealed class GraphQLGitLabClient : IGraphQLGitLabClient
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public IGraphQLClient GraphQL { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="ServiceProvider"/> containing the <see cref="GraphQL"/> client.
|
||||
/// </summary>
|
||||
readonly ServiceProvider serviceProvider;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GraphQLGitLabClient"/> class.
|
||||
/// </summary>
|
||||
/// <param name="serviceProvider">The value of <see cref="serviceProvider"/>.</param>
|
||||
public GraphQLGitLabClient(ServiceProvider serviceProvider)
|
||||
{
|
||||
this.serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
|
||||
GraphQL = serviceProvider.GetService<IGraphQLClient>() ?? throw new ArgumentException($"Expected an {nameof(IGraphQLClient)} service in the provider!", nameof(serviceProvider));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public ValueTask DisposeAsync()
|
||||
=> serviceProvider.DisposeAsync();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Tgstation.Server.Host.Utils.GitLab.GraphQL
|
||||
{
|
||||
/// <summary>
|
||||
/// Factory for creating <see cref="IGraphQLGitLabClient"/>s.
|
||||
/// </summary>
|
||||
public sealed class GraphQLGitLabClientFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets up a <see cref="IGraphQLGitLabClient"/>.
|
||||
/// </summary>
|
||||
/// <param name="bearerToken">The token to use for authentication, if any.</param>
|
||||
/// <returns>A <see cref="ValueTask{TResult}"/> resulting in a new <see cref="IGraphQLGitLabClient"/>.</returns>
|
||||
public static async ValueTask<IGraphQLGitLabClient> CreateClient(string? bearerToken = null)
|
||||
{
|
||||
var serviceCollection = new ServiceCollection();
|
||||
|
||||
var clientBuilder = serviceCollection
|
||||
.AddGraphQLClient();
|
||||
var graphQLEndpoint = new Uri("https://gitlab.com/api/graphql");
|
||||
|
||||
clientBuilder.ConfigureHttpClient(
|
||||
client =>
|
||||
{
|
||||
client.BaseAddress = new Uri("https://gitlab.com/api/graphql");
|
||||
if (bearerToken != null)
|
||||
{
|
||||
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", bearerToken);
|
||||
}
|
||||
});
|
||||
|
||||
var serviceProvider = serviceCollection.BuildServiceProvider();
|
||||
try
|
||||
{
|
||||
return new GraphQLGitLabClient(serviceProvider);
|
||||
}
|
||||
catch
|
||||
{
|
||||
await serviceProvider.DisposeAsync();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
|
||||
namespace Tgstation.Server.Host.Utils.GitLab.GraphQL
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper for using a GitLab <see cref="IGraphQLClient"/>.
|
||||
/// </summary>
|
||||
public interface IGraphQLGitLabClient : IAsyncDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the underlying <see cref="IGraphQLClient"/>.
|
||||
/// </summary>
|
||||
IGraphQLClient GraphQL { get; }
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="../../build/SrcCommon.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>$(TgsFrameworkVersion)</TargetFrameworks>
|
||||
<Version>$(TgsCoreVersion)</Version>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="InstallApollo" Inputs="package.json;yarn.lock" Outputs="node_modules/.bin/apollo">
|
||||
<Message Text="Installing Apollo..." Importance="high" />
|
||||
<Exec Command="yarn install --immutable --ignore-engines" />
|
||||
</Target>
|
||||
|
||||
<Target Name="GetApi" DependsOnTargets="InstallApollo" Inputs="node_modules/.bin/apollo" Outputs="../../artifacts/gitlab-api.graphql">
|
||||
<Message Text="Fetching GitLab GraphQL API schema..." Importance="high" />
|
||||
<MakeDir Directories="../../artifacts" />
|
||||
<Exec Command="node_modules/.bin/apollo client:download-schema --endpoint=https://gitlab.com/api/graphql ../../artifacts/gitlab-api.graphql" />
|
||||
</Target>
|
||||
|
||||
<!-- https://github.com/ChilliCream/graphql-platform/blob/c0c8df525ca0f47bf3b3b409a8b22cbe37f7a9c0/src/StrawberryShake/MetaPackages/Common/MSBuild/StrawberryShake.targets#L20 -->
|
||||
<Target Name="ImportGraphQLApiSchema" DependsOnTargets="GetApi" BeforeTargets="_GraphQLCodeGenerationRoot" Inputs="../../artifacts/gitlab-api.graphql" Outputs="schema.graphql">
|
||||
<Copy SkipUnchangedFiles="true" SourceFiles="../../artifacts/gitlab-api.graphql" DestinationFiles="schema.graphql" />
|
||||
<WriteLinesToFile File="schema.graphql" Lines="$([System.IO.File]::ReadAllText('schema.graphql').Replace('\', ''))" Overwrite="true" Encoding="UTF-8" />
|
||||
</Target>
|
||||
|
||||
<Target Name="FixWarningsInGeneratedSchema" AfterTargets="GenerateGraphQLCode">
|
||||
<PropertyGroup>
|
||||
<InputFile>$(IntermediateOutputPath)berry/GraphQLClient.Client.cs</InputFile>
|
||||
<OutputFile>$(IntermediateOutputPath)berry/GraphQLClient.Client.cs</OutputFile>
|
||||
</PropertyGroup>
|
||||
<WriteLinesToFile File="$(OutputFile)" Lines="$([System.IO.File]::ReadAllText($(InputFile)).Replace('/ <auto-generated/>','/ <auto-generated />%0d%0a#pragma warning disable'))" Overwrite="true" Encoding="Unicode" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="StrawberryShake.Server" Version="15.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="GQL\Queries\" />
|
||||
<Folder Include="GQL\Mutations\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"apollo": "^2.34.0"
|
||||
},
|
||||
"packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+27
-1
@@ -18,6 +18,11 @@ namespace Tgstation.Server.Host.Components.Deployment.Remote
|
||||
/// </summary>
|
||||
abstract class BaseRemoteDeploymentManager : IRemoteDeploymentManager
|
||||
{
|
||||
/// <summary>
|
||||
/// The header comment that begins every deployment message comment/note.
|
||||
/// </summary>
|
||||
public const string DeploymentMsgHeaderStart = "<!-- tgs_test_merge_comment -->";
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="Api.Models.Instance"/> for the <see cref="BaseRemoteDeploymentManager"/>.
|
||||
/// </summary>
|
||||
@@ -125,7 +130,12 @@ namespace Tgstation.Server.Host.Components.Deployment.Remote
|
||||
repositorySettings,
|
||||
repoOwner,
|
||||
repoName,
|
||||
"#### Test Merge Removed",
|
||||
FormatTestMergeRemoval(
|
||||
repositorySettings,
|
||||
compileJob,
|
||||
removedTestMerge,
|
||||
repoOwner,
|
||||
repoName),
|
||||
removedTestMerge.Number,
|
||||
cancellationToken);
|
||||
tasks.Add(removeCommentTask);
|
||||
@@ -245,6 +255,22 @@ namespace Tgstation.Server.Host.Components.Deployment.Remote
|
||||
string remoteRepositoryName,
|
||||
bool updated);
|
||||
|
||||
/// <summary>
|
||||
/// Formats a comment for a given <paramref name="testMerge"/> removal.
|
||||
/// </summary>
|
||||
/// <param name="repositorySettings">The <see cref="RepositorySettings"/> to use.</param>
|
||||
/// <param name="compileJob">The test merge's <see cref="CompileJob"/>.</param>
|
||||
/// <param name="testMerge">The <see cref="TestMerge"/>.</param>
|
||||
/// <param name="remoteRepositoryOwner">The <see cref="Api.Models.Internal.IGitRemoteInformation.RemoteRepositoryOwner"/>.</param>
|
||||
/// <param name="remoteRepositoryName">The <see cref="Api.Models.Internal.IGitRemoteInformation.RemoteRepositoryName"/>.</param>
|
||||
/// <returns>A formatted <see cref="string"/> for posting a informative comment about the <paramref name="testMerge"/> removal.</returns>
|
||||
protected abstract string FormatTestMergeRemoval(
|
||||
RepositorySettings repositorySettings,
|
||||
CompileJob compileJob,
|
||||
TestMerge testMerge,
|
||||
string remoteRepositoryOwner,
|
||||
string remoteRepositoryName);
|
||||
|
||||
/// <summary>
|
||||
/// Create a comment of a given <paramref name="testMergeNumber"/>'s source.
|
||||
/// </summary>
|
||||
|
||||
+38
-15
@@ -282,7 +282,17 @@ namespace Tgstation.Server.Host.Components.Deployment.Remote
|
||||
|
||||
try
|
||||
{
|
||||
await gitHubService.CommentOnIssue(remoteRepositoryOwner, remoteRepositoryName, comment, testMergeNumber, cancellationToken);
|
||||
string header = String.Format(CultureInfo.InvariantCulture, "{1}{0}## Test merge deployment history:{0}{0}", Environment.NewLine, DeploymentMsgHeaderStart);
|
||||
|
||||
var existingComment = await gitHubService.GetExistingCommentOnIssue(remoteRepositoryOwner, remoteRepositoryName, DeploymentMsgHeaderStart, testMergeNumber, cancellationToken);
|
||||
if (existingComment != null)
|
||||
{
|
||||
await gitHubService.AppendCommentOnIssue(remoteRepositoryOwner, remoteRepositoryName, comment, existingComment, cancellationToken);
|
||||
}
|
||||
else
|
||||
{
|
||||
await gitHubService.CommentOnIssue(remoteRepositoryOwner, remoteRepositoryName, header + comment, testMergeNumber, cancellationToken);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) when (ex is not OperationCanceledException)
|
||||
{
|
||||
@@ -299,30 +309,43 @@ namespace Tgstation.Server.Host.Components.Deployment.Remote
|
||||
string remoteRepositoryName,
|
||||
bool updated) => String.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"#### Test Merge {4}{0}{0}<details><summary>Details</summary>{0}{0}##### Server Instance{0}{5}{1}{0}{0}##### Revision{0}Origin: {6}{0}Pull Request: {2}{0}Server: {7}{3}{8}{0}</details>",
|
||||
Environment.NewLine,
|
||||
"<details><summary>Test Merge {4} @ {8}:</summary>{0}{0}##### Server Instance{0}{5}{1}{0}{0}##### Revision{0}Origin: {6}{0}Pull Request: {2}{0}Server: {7}{3}{0}</details>{0}",
|
||||
Environment.NewLine, // 0
|
||||
repositorySettings.ShowTestMergeCommitters!.Value
|
||||
? String.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0}{0}##### Merged By{0}{1}",
|
||||
Environment.NewLine,
|
||||
testMerge.MergedBy!.Name)
|
||||
: String.Empty,
|
||||
testMerge.TargetCommitSha,
|
||||
testMerge.Comment != null
|
||||
? String.Format(
|
||||
: String.Empty, // 1
|
||||
testMerge.TargetCommitSha, // 2
|
||||
String.IsNullOrEmpty(testMerge.Comment)
|
||||
? String.Empty
|
||||
: String.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0}{0}##### Comment{0}{1}",
|
||||
Environment.NewLine,
|
||||
testMerge.Comment)
|
||||
: String.Empty,
|
||||
updated ? "Updated" : "Deployed",
|
||||
Metadata.Name,
|
||||
compileJob.RevisionInformation.OriginCommitSha,
|
||||
compileJob.RevisionInformation.CommitSha,
|
||||
testMerge.Comment), // 3
|
||||
updated ? "Updated" : "Deployed", // 4
|
||||
compileJob.GitHubDeploymentId.HasValue
|
||||
? $"{Environment.NewLine}[GitHub Deployments](https://github.com/{remoteRepositoryOwner}/{remoteRepositoryName}/deployments/activity_log?environment=TGS%3A+{Metadata.Name!.Replace(" ", "+", StringComparison.Ordinal)})"
|
||||
: String.Empty);
|
||||
? $"{Environment.NewLine}[{Metadata.Name}](https://github.com/{remoteRepositoryOwner}/{remoteRepositoryName}/deployments/activity_log?environment=TGS%3A+{Metadata.Name!.Replace(" ", "+", StringComparison.Ordinal)})"
|
||||
: Metadata.Name, // 5
|
||||
compileJob.RevisionInformation.OriginCommitSha, // 6
|
||||
compileJob.RevisionInformation.CommitSha, // 7
|
||||
compileJob.Job.StartedAt); // 8
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override string FormatTestMergeRemoval(
|
||||
RepositorySettings repositorySettings,
|
||||
CompileJob compileJob,
|
||||
TestMerge testMerge,
|
||||
string remoteRepositoryOwner,
|
||||
string remoteRepositoryName) => String.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"<details><summary>Test Merge Removed @ {2}:</summary>{0}{0}##### Server Instance{0}{1}{0}</details>{0}",
|
||||
Environment.NewLine, // 0
|
||||
Metadata.Name, // 1
|
||||
compileJob.Job.StartedAt); // 2
|
||||
|
||||
/// <summary>
|
||||
/// Update the deployment for a given <paramref name="compileJob"/>.
|
||||
|
||||
+141
-52
@@ -6,13 +6,13 @@ using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using GitLabApiClient;
|
||||
using GitLabApiClient.Models.MergeRequests.Responses;
|
||||
using GitLabApiClient.Models.Notes.Requests;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using StrawberryShake;
|
||||
|
||||
using Tgstation.Server.Host.Components.Repository;
|
||||
using Tgstation.Server.Host.Models;
|
||||
using Tgstation.Server.Host.Utils.GitLab.GraphQL;
|
||||
|
||||
namespace Tgstation.Server.Host.Components.Deployment.Remote
|
||||
{
|
||||
@@ -52,49 +52,78 @@ namespace Tgstation.Server.Host.Components.Deployment.Remote
|
||||
return Array.Empty<TestMerge>();
|
||||
}
|
||||
|
||||
var client = repositorySettings.AccessToken != null
|
||||
? new GitLabClient(GitLabRemoteFeatures.GitLabUrl, repositorySettings.AccessToken)
|
||||
: new GitLabClient(GitLabRemoteFeatures.GitLabUrl);
|
||||
var newList = revisionInformation.ActiveTestMerges.Select(x => x.TestMerge).ToList();
|
||||
|
||||
var tasks = revisionInformation
|
||||
.ActiveTestMerges
|
||||
.Select(x => client
|
||||
.MergeRequests
|
||||
.GetAsync(
|
||||
$"{repository.RemoteRepositoryOwner}/{repository.RemoteRepositoryName}",
|
||||
x.TestMerge.Number)
|
||||
.WaitAsync(cancellationToken));
|
||||
await using var client = await GraphQLGitLabClientFactory.CreateClient(repositorySettings.AccessToken);
|
||||
IOperationResult<IGetMergeRequestsResult> operationResult;
|
||||
try
|
||||
{
|
||||
await Task.WhenAll(tasks);
|
||||
operationResult = await client.GraphQL.GetMergeRequests.ExecuteAsync(
|
||||
$"{repository.RemoteRepositoryOwner}/{repository.RemoteRepositoryName}",
|
||||
revisionInformation.ActiveTestMerges.Select(revInfoTestMerge => revInfoTestMerge.TestMerge.Number.ToString(CultureInfo.InvariantCulture)).ToList(),
|
||||
cancellationToken);
|
||||
|
||||
operationResult.EnsureNoErrors();
|
||||
}
|
||||
catch (Exception ex) when (ex is not OperationCanceledException)
|
||||
{
|
||||
Logger.LogWarning(ex, "Merge requests update check failed!");
|
||||
return newList;
|
||||
}
|
||||
|
||||
var newList = revisionInformation.ActiveTestMerges.Select(x => x.TestMerge).ToList();
|
||||
|
||||
MergeRequest? lastMerged = null;
|
||||
async ValueTask CheckRemoveMR(Task<MergeRequest> task)
|
||||
var data = operationResult.Data?.Project?.MergeRequests?.Nodes;
|
||||
if (data == null)
|
||||
{
|
||||
var mergeRequest = await task;
|
||||
Logger.LogWarning("GitLab MergeRequests check returned null!");
|
||||
return newList;
|
||||
}
|
||||
|
||||
async ValueTask CheckRemoveMR(IGetMergeRequests_Project_MergeRequests_Nodes? mergeRequest)
|
||||
{
|
||||
if (mergeRequest == null)
|
||||
{
|
||||
Logger.LogWarning("GitLab MergeRequest node was null!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mergeRequest.State != MergeRequestState.Merged)
|
||||
return;
|
||||
|
||||
// We don't just assume, actually check the repo contains the merge commit.
|
||||
if (await repository.CommittishIsParent(mergeRequest.MergeCommitSha, cancellationToken))
|
||||
var mergeCommitSha = mergeRequest.MergeCommitSha;
|
||||
if (mergeCommitSha == null)
|
||||
{
|
||||
if (lastMerged == null || lastMerged.ClosedAt < mergeRequest.ClosedAt)
|
||||
lastMerged = mergeRequest;
|
||||
Logger.LogWarning("MergeRequest #{id} had no MergeCommitSha!", mergeRequest.Iid);
|
||||
return;
|
||||
}
|
||||
|
||||
var closedAtStr = mergeRequest.ClosedAt;
|
||||
if (closedAtStr == null)
|
||||
{
|
||||
Logger.LogWarning("MergeRequest #{id} had no ClosedAt!", mergeRequest.Iid);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!DateTimeOffset.TryParseExact(closedAtStr, "O", CultureInfo.InvariantCulture, DateTimeStyles.RoundtripKind, out DateTimeOffset closedAt))
|
||||
{
|
||||
Logger.LogWarning("MergeRequest #{id} had invalid ClosedAt: {closedAt}", mergeRequest.Iid, closedAtStr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Int64.TryParse(mergeRequest.Iid, out long number))
|
||||
{
|
||||
Logger.LogWarning("MergeRequest #{id} is non-numeric!", mergeRequest.Iid);
|
||||
return;
|
||||
}
|
||||
|
||||
// We don't just assume, actually check the repo contains the merge commit.
|
||||
if (await repository.CommittishIsParent(mergeCommitSha, cancellationToken))
|
||||
newList.Remove(
|
||||
newList.First(
|
||||
potential => potential.Number == mergeRequest.Id));
|
||||
}
|
||||
potential => potential.Number == number));
|
||||
}
|
||||
|
||||
foreach (var prTask in tasks)
|
||||
await CheckRemoveMR(prTask);
|
||||
foreach (var mergeRequest in data)
|
||||
await CheckRemoveMR(mergeRequest);
|
||||
|
||||
return newList;
|
||||
}
|
||||
@@ -131,23 +160,69 @@ namespace Tgstation.Server.Host.Components.Deployment.Remote
|
||||
int testMergeNumber,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var client = repositorySettings.AccessToken != null
|
||||
? new GitLabClient(GitLabRemoteFeatures.GitLabUrl, repositorySettings.AccessToken)
|
||||
: new GitLabClient(GitLabRemoteFeatures.GitLabUrl);
|
||||
|
||||
await using var client = await GraphQLGitLabClientFactory.CreateClient(repositorySettings.AccessToken);
|
||||
try
|
||||
{
|
||||
await client
|
||||
.MergeRequests
|
||||
.CreateNoteAsync(
|
||||
$"{remoteRepositoryOwner}/{remoteRepositoryName}",
|
||||
testMergeNumber,
|
||||
new CreateMergeRequestNoteRequest(comment))
|
||||
.WaitAsync(cancellationToken);
|
||||
string header = String.Format(CultureInfo.InvariantCulture, "{1}{0}## Test merge deployment history:{0}{0}", Environment.NewLine, DeploymentMsgHeaderStart);
|
||||
|
||||
// Try to find an existing note
|
||||
var notesQueryResult = await client.GraphQL.GetMergeRequestNotes.ExecuteAsync(
|
||||
$"{remoteRepositoryOwner}/{remoteRepositoryName}",
|
||||
testMergeNumber.ToString(CultureInfo.InvariantCulture),
|
||||
cancellationToken);
|
||||
|
||||
notesQueryResult.EnsureNoErrors();
|
||||
|
||||
var mergeRequest = notesQueryResult.Data?.Project?.MergeRequest;
|
||||
if (mergeRequest == null)
|
||||
{
|
||||
Logger.LogWarning("GitLab GetMergeRequestNotes mergeRequest returned null!");
|
||||
return;
|
||||
}
|
||||
|
||||
var comments = mergeRequest.Notes?.Nodes;
|
||||
IGetMergeRequestNotes_Project_MergeRequest_Notes_Nodes? existingComment = null;
|
||||
if (comments != null)
|
||||
{
|
||||
for (int i = comments.Count - 1; i > -1; i--)
|
||||
{
|
||||
var currentComment = comments[i];
|
||||
if (currentComment?.Author?.Username == repositorySettings.AccessUser && (currentComment?.Body?.StartsWith(DeploymentMsgHeaderStart) ?? false))
|
||||
{
|
||||
if (currentComment.Body.Length > 987856)
|
||||
{ // Limit should be 999,999 so we'll leave a 12,143 buffer
|
||||
break;
|
||||
}
|
||||
|
||||
existingComment = currentComment;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Either amend or create the note
|
||||
if (existingComment != null)
|
||||
{
|
||||
var noteModificationResult = await client.GraphQL.ModifyNote.ExecuteAsync(
|
||||
existingComment.Id,
|
||||
existingComment.Body + comment,
|
||||
cancellationToken);
|
||||
|
||||
notesQueryResult.EnsureNoErrors();
|
||||
}
|
||||
else
|
||||
{
|
||||
var noteCreationResult = await client.GraphQL.CreateNote.ExecuteAsync(
|
||||
mergeRequest.Id,
|
||||
header + comment,
|
||||
cancellationToken);
|
||||
|
||||
noteCreationResult.EnsureNoErrors();
|
||||
}
|
||||
}
|
||||
catch (Exception ex) when (ex is not OperationCanceledException)
|
||||
{
|
||||
Logger.LogWarning(ex, "Error posting GitHub comment!");
|
||||
Logger.LogWarning(ex, "Error posting GitLab comment!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,26 +235,40 @@ namespace Tgstation.Server.Host.Components.Deployment.Remote
|
||||
string remoteRepositoryName,
|
||||
bool updated) => String.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"#### Test Merge {4}{0}{0}##### Server Instance{0}{5}{1}{0}{0}##### Revision{0}Origin: {6}{0}Merge Request: {2}{0}Server: {7}{3}",
|
||||
Environment.NewLine,
|
||||
"<details><summary>Test Merge {4} @ {8}</summary>{0}{0}##### Server Instance{0}{5}{1}{0}{0}##### Revision{0}Origin: {6}{0}Merge Request: {2}{0}Server: {7}{3}</details>{0}",
|
||||
Environment.NewLine, // 0
|
||||
repositorySettings.ShowTestMergeCommitters!.Value
|
||||
? String.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0}{0}##### Merged By{0}{1}",
|
||||
Environment.NewLine,
|
||||
testMerge.MergedBy!.Name)
|
||||
: String.Empty,
|
||||
testMerge.TargetCommitSha,
|
||||
testMerge.Comment != null
|
||||
? String.Format(
|
||||
: String.Empty, // 1
|
||||
testMerge.TargetCommitSha, // 2
|
||||
String.IsNullOrEmpty(testMerge.Comment)
|
||||
? String.Empty
|
||||
: String.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"{0}{0}##### Comment{0}{1}",
|
||||
Environment.NewLine,
|
||||
testMerge.Comment)
|
||||
: String.Empty,
|
||||
updated ? "Updated" : "Deployed",
|
||||
Metadata.Name,
|
||||
compileJob.RevisionInformation.OriginCommitSha,
|
||||
compileJob.RevisionInformation.CommitSha);
|
||||
testMerge.Comment), // 3
|
||||
updated ? "Updated" : "Deployed", // 4
|
||||
Metadata.Name, // 5
|
||||
compileJob.RevisionInformation.OriginCommitSha, // 6
|
||||
compileJob.RevisionInformation.CommitSha, // 7
|
||||
compileJob.Job.StartedAt); // 8
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override string FormatTestMergeRemoval(
|
||||
RepositorySettings repositorySettings,
|
||||
CompileJob compileJob,
|
||||
TestMerge testMerge,
|
||||
string remoteRepositoryOwner,
|
||||
string remoteRepositoryName) => String.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"<details><summary>Test Merge Removed @ {2}:</summary>{0}{0}##### Server Instance{0}{1}{0}</details>{0}",
|
||||
Environment.NewLine, // 0
|
||||
Metadata.Name, // 1
|
||||
compileJob.Job.StartedAt); // 2
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +65,15 @@ namespace Tgstation.Server.Host.Components.Deployment.Remote
|
||||
bool updated)
|
||||
=> String.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override string FormatTestMergeRemoval(
|
||||
Models.RepositorySettings repositorySettings,
|
||||
Models.CompileJob compileJob,
|
||||
TestMerge testMerge,
|
||||
string remoteRepositoryOwner,
|
||||
string remoteRepositoryName)
|
||||
=> String.Empty;
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override ValueTask MarkInactiveImpl(Models.CompileJob compileJob, CancellationToken cancellationToken) => ValueTask.CompletedTask;
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using GitLabApiClient;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using StrawberryShake;
|
||||
|
||||
using Tgstation.Server.Api.Models;
|
||||
using Tgstation.Server.Host.Utils.GitLab.GraphQL;
|
||||
|
||||
namespace Tgstation.Server.Host.Components.Repository
|
||||
{
|
||||
@@ -45,30 +48,25 @@ namespace Tgstation.Server.Host.Components.Repository
|
||||
RepositorySettings repositorySettings,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var client = repositorySettings.AccessToken != null
|
||||
? new GitLabClient(GitLabUrl, repositorySettings.AccessToken)
|
||||
: new GitLabClient(GitLabUrl);
|
||||
|
||||
await using var client = await GraphQLGitLabClientFactory.CreateClient(repositorySettings.AccessToken);
|
||||
try
|
||||
{
|
||||
var mr = await client
|
||||
.MergeRequests
|
||||
.GetAsync($"{RemoteRepositoryOwner}/{RemoteRepositoryName}", parameters.Number)
|
||||
.WaitAsync(cancellationToken);
|
||||
var operationResult = await client.GraphQL.GetMergeRequest.ExecuteAsync(
|
||||
$"{RemoteRepositoryOwner}/{RemoteRepositoryName}",
|
||||
parameters.Number.ToString(CultureInfo.InvariantCulture),
|
||||
cancellationToken);
|
||||
|
||||
var revisionToUse = parameters.TargetCommitSha == null
|
||||
|| mr.Sha.StartsWith(parameters.TargetCommitSha, StringComparison.OrdinalIgnoreCase)
|
||||
? mr.Sha
|
||||
: parameters.TargetCommitSha;
|
||||
operationResult.EnsureNoErrors();
|
||||
var mr = operationResult.Data?.Project?.MergeRequest ?? throw new InvalidOperationException("GitLab MergeRequest check returned null!");
|
||||
|
||||
return new Models.TestMerge
|
||||
{
|
||||
Author = mr.Author.Username,
|
||||
Author = mr.Author?.Username,
|
||||
BodyAtMerge = mr.Description,
|
||||
TitleAtMerge = mr.Title,
|
||||
Comment = parameters.Comment,
|
||||
Number = parameters.Number,
|
||||
TargetCommitSha = mr.Sha,
|
||||
TargetCommitSha = mr.DiffHeadSha,
|
||||
Url = mr.WebUrl,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@ using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using GitLabApiClient;
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
using StrawberryShake;
|
||||
|
||||
using Tgstation.Server.Api;
|
||||
using Tgstation.Server.Api.Models;
|
||||
using Tgstation.Server.Api.Models.Request;
|
||||
@@ -27,6 +27,7 @@ using Tgstation.Server.Host.Models;
|
||||
using Tgstation.Server.Host.Security;
|
||||
using Tgstation.Server.Host.Utils;
|
||||
using Tgstation.Server.Host.Utils.GitHub;
|
||||
using Tgstation.Server.Host.Utils.GitLab.GraphQL;
|
||||
|
||||
namespace Tgstation.Server.Host.Controllers
|
||||
{
|
||||
@@ -585,70 +586,84 @@ namespace Tgstation.Server.Host.Controllers
|
||||
switch (remoteFeatures.RemoteGitProvider!.Value)
|
||||
{
|
||||
case RemoteGitProvider.GitHub:
|
||||
var gitHubClient = await gitHubClientFactory.CreateClientForRepository(
|
||||
{
|
||||
var gitHubClient = await gitHubClientFactory.CreateClientForRepository(
|
||||
model.AccessToken,
|
||||
new RepositoryIdentifier(
|
||||
remoteFeatures.RemoteRepositoryOwner!,
|
||||
remoteFeatures.RemoteRepositoryName!),
|
||||
cancellationToken);
|
||||
if (gitHubClient == null)
|
||||
{
|
||||
return this.StatusCode(HttpStatusCode.FailedDependency, new ErrorMessageResponse(ErrorCode.RemoteApiError)
|
||||
if (gitHubClient == null)
|
||||
{
|
||||
AdditionalData = "GitHub authentication failed!",
|
||||
});
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
string username;
|
||||
if (!model.AccessToken.StartsWith(Api.Models.RepositorySettings.TgsAppPrivateKeyPrefix))
|
||||
{
|
||||
var user = await gitHubClient.User.Current();
|
||||
username = user.Login;
|
||||
}
|
||||
else
|
||||
{
|
||||
// we literally need to app auth again to get the damn bot username
|
||||
var appClient = gitHubClientFactory.CreateAppClient(model.AccessToken)!;
|
||||
var app = await appClient.GitHubApps.GetCurrent();
|
||||
username = app.Name;
|
||||
return this.StatusCode(HttpStatusCode.FailedDependency, new ErrorMessageResponse(ErrorCode.RemoteApiError)
|
||||
{
|
||||
AdditionalData = "GitHub authentication failed!",
|
||||
});
|
||||
}
|
||||
|
||||
if (username != model.AccessUser)
|
||||
return Conflict(new ErrorMessageResponse(ErrorCode.RepoTokenUsernameMismatch));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return this.StatusCode(HttpStatusCode.FailedDependency, new ErrorMessageResponse(ErrorCode.RemoteApiError)
|
||||
try
|
||||
{
|
||||
AdditionalData = $"GitHub Authentication Failure: {ex.Message}",
|
||||
});
|
||||
string username;
|
||||
if (!model.AccessToken.StartsWith(Api.Models.RepositorySettings.TgsAppPrivateKeyPrefix))
|
||||
{
|
||||
var user = await gitHubClient.User.Current();
|
||||
username = user.Login;
|
||||
}
|
||||
else
|
||||
{
|
||||
// we literally need to app auth again to get the damn bot username
|
||||
var appClient = gitHubClientFactory.CreateAppClient(model.AccessToken)!;
|
||||
var app = await appClient.GitHubApps.GetCurrent();
|
||||
username = app.Name;
|
||||
}
|
||||
|
||||
if (username != model.AccessUser)
|
||||
return Conflict(new ErrorMessageResponse(ErrorCode.RepoTokenUsernameMismatch));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return this.StatusCode(HttpStatusCode.FailedDependency, new ErrorMessageResponse(ErrorCode.RemoteApiError)
|
||||
{
|
||||
AdditionalData = $"GitHub Authentication Failure: {ex.Message}",
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case RemoteGitProvider.GitLab:
|
||||
// need to abstract this eventually
|
||||
var gitLabClient = new GitLabClient(GitLabRemoteFeatures.GitLabUrl, model.AccessToken);
|
||||
try
|
||||
{
|
||||
var user = await gitLabClient.Users.GetCurrentSessionAsync();
|
||||
if (user.Username != model.AccessUser)
|
||||
return Conflict(new ErrorMessageResponse(ErrorCode.RepoTokenUsernameMismatch));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return this.StatusCode(HttpStatusCode.FailedDependency, new ErrorMessageResponse(ErrorCode.RemoteApiError)
|
||||
// need to abstract this eventually
|
||||
await using var gitLabClient = await GraphQLGitLabClientFactory.CreateClient(model.AccessToken);
|
||||
try
|
||||
{
|
||||
AdditionalData = $"GitLab Authentication Failure: {ex.Message}",
|
||||
});
|
||||
var operationResult = await gitLabClient.GraphQL.GetCurrentUser.ExecuteAsync(cancellationToken);
|
||||
|
||||
operationResult.EnsureNoErrors();
|
||||
|
||||
var user = operationResult.Data?.CurrentUser;
|
||||
if (user == null || user.Username != model.AccessUser)
|
||||
{
|
||||
return Conflict(new ErrorMessageResponse(ErrorCode.RepoTokenUsernameMismatch));
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return this.StatusCode(HttpStatusCode.FailedDependency, new ErrorMessageResponse(ErrorCode.RemoteApiError)
|
||||
{
|
||||
AdditionalData = $"GitLab Authentication Failure: {ex.Message}",
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case RemoteGitProvider.Unknown:
|
||||
default:
|
||||
Logger.LogWarning("RemoteGitProvider is {provider}, no auth check implemented!", remoteFeatures.RemoteGitProvider.Value);
|
||||
break;
|
||||
{
|
||||
Logger.LogWarning("RemoteGitProvider is {provider}, no auth check implemented!", remoteFeatures.RemoteGitProvider.Value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -97,8 +97,6 @@
|
||||
<PackageReference Include="DotEnv.Core" Version="3.1.0" />
|
||||
<!-- Usage: Text formatter for Elasticsearch logging plugin -->
|
||||
<PackageReference Include="Elastic.CommonSchema.Serilog" Version="8.12.3" />
|
||||
<!-- Usage: GitLab interop -->
|
||||
<PackageReference Include="GitLabApiClient" Version="1.8.0" />
|
||||
<!-- Usage: GraphQL API Engine -->
|
||||
<PackageReference Include="HotChocolate.AspNetCore" Version="15.0.3" />
|
||||
<!-- Usage: GraphQL Authorization Plugin -->
|
||||
@@ -168,6 +166,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Tgstation.Server.Api\Tgstation.Server.Api.csproj" />
|
||||
<ProjectReference Include="..\Tgstation.Server.Host.Common\Tgstation.Server.Host.Common.csproj" />
|
||||
<ProjectReference Include="..\Tgstation.Server.Host.Utils.GitLab.GraphQL\Tgstation.Server.Host.Utils.GitLab.GraphQL.csproj" />
|
||||
<ProjectReference Include="..\Tgstation.Server.Shared\Tgstation.Server.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -163,6 +163,73 @@ namespace Tgstation.Server.Host.Utils.GitHub
|
||||
.WaitAsync(cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task AppendCommentOnIssue(string repoOwner, string repoName, string comment, IssueComment issueComment, CancellationToken cancellationToken)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(repoOwner);
|
||||
|
||||
ArgumentNullException.ThrowIfNull(repoName);
|
||||
|
||||
ArgumentNullException.ThrowIfNull(comment);
|
||||
|
||||
ArgumentNullException.ThrowIfNull(issueComment);
|
||||
|
||||
logger.LogTrace("AppendCommentOnIssue");
|
||||
|
||||
return gitHubClient
|
||||
.Issue
|
||||
.Comment
|
||||
.Update(
|
||||
repoOwner,
|
||||
repoName,
|
||||
issueComment.Id,
|
||||
issueComment.Body + comment)
|
||||
.WaitAsync(cancellationToken);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async ValueTask<IssueComment?> GetExistingCommentOnIssue(string repoOwner, string repoName, string header, int issueNumber, CancellationToken cancellationToken)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(repoOwner);
|
||||
|
||||
ArgumentNullException.ThrowIfNull(repoName);
|
||||
|
||||
ArgumentNullException.ThrowIfNull(header);
|
||||
|
||||
logger.LogTrace("GetExistingCommentOnIssue");
|
||||
|
||||
var comments = await gitHubClient
|
||||
.Issue
|
||||
.Comment
|
||||
.GetAllForIssue(
|
||||
repoOwner,
|
||||
repoName,
|
||||
issueNumber)
|
||||
.WaitAsync(cancellationToken);
|
||||
if (comments == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
long userId = await GetCurrentUserId(cancellationToken);
|
||||
|
||||
for (int i = comments.Count - 1; i > -1; i--)
|
||||
{
|
||||
var currentComment = comments[i];
|
||||
if (currentComment.User?.Id == userId && (currentComment.Body?.StartsWith(header) ?? false))
|
||||
{
|
||||
if (currentComment.Body.Length > 250000)
|
||||
{ // Limit should be 262,143 so we'll leave a 12,143 buffer
|
||||
return null;
|
||||
}
|
||||
|
||||
return currentComment;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async ValueTask<long> GetRepositoryId(string repoOwner, string repoName, CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,28 @@ namespace Tgstation.Server.Host.Utils.GitHub
|
||||
/// <returns>A <see cref="Task"/> representing the running operation.</returns>
|
||||
Task CommentOnIssue(string repoOwner, string repoName, string comment, int issueNumber, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Append a comment on an existing <paramref name="issueComment"/>.
|
||||
/// </summary>
|
||||
/// <param name="repoOwner">The owner of the target repository.</param>
|
||||
/// <param name="repoName">The name of the target repository.</param>
|
||||
/// <param name="comment">The text of the comment.</param>
|
||||
/// <param name="issueComment">The <see cref="IssueComment"/> to amend.</param>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
|
||||
/// <returns>A <see cref="Task"/> representing the running operation.</returns>
|
||||
Task AppendCommentOnIssue(string repoOwner, string repoName, string comment, IssueComment issueComment, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IssueComment"/> for a particular <paramref name="issueNumber"/> with the provided <paramref name="header"/> if it exists and is not too large.
|
||||
/// </summary>
|
||||
/// <param name="repoOwner">The owner of the target repository.</param>
|
||||
/// <param name="repoName">The name of the target repository.</param>
|
||||
/// <param name="header">The starting text of the comment to search for.</param>
|
||||
/// <param name="issueNumber">The number of the issue to comment on.</param>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
|
||||
/// <returns>A <see cref="ValueTask{TResult}"/> of an existing comment if its currently under 250k characters, otherwise the <see cref="IssueComment"/> will be null.</returns>
|
||||
ValueTask<IssueComment?> GetExistingCommentOnIssue(string repoOwner, string repoName, string header, int issueNumber, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Create a <paramref name="newDeployment"/> on a target repostiory.
|
||||
/// </summary>
|
||||
|
||||
@@ -91,6 +91,18 @@ namespace Tgstation.Server.Tests.Live
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task AppendCommentOnIssue(string repoOwner, string repoName, string comment, IssueComment issueComment, CancellationToken cancellationToken)
|
||||
{
|
||||
logger.LogTrace("AppendCommentOnIssue");
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public ValueTask<IssueComment> GetExistingCommentOnIssue(string repoOwner, string repoName, string header, int issueNumber, CancellationToken cancellationToken)
|
||||
{
|
||||
logger.LogTrace("GetExistingCommentOnIssue");
|
||||
return ValueTask.FromResult<IssueComment>(null);
|
||||
}
|
||||
|
||||
public ValueTask<long> CreateDeployment(NewDeployment newDeployment, string repoOwner, string repoName, CancellationToken cancellationToken)
|
||||
{
|
||||
logger.LogTrace("CreateDeployment");
|
||||
|
||||
@@ -275,6 +275,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nix", "nix", "{5130526C-A55
|
||||
build\package\nix\tgstation-server.nix = build\package\nix\tgstation-server.nix
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tgstation.Server.Host.Utils.GitLab.GraphQL", "src\Tgstation.Server.Host.Utils.GitLab.GraphQL\Tgstation.Server.Host.Utils.GitLab.GraphQL.csproj", "{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -557,6 +559,18 @@ Global
|
||||
{8BF95E2D-FD27-470C-82B7-C21AC01BFBD7}.ReleaseNoWindows|Any CPU.Build.0 = Release|Any CPU
|
||||
{8BF95E2D-FD27-470C-82B7-C21AC01BFBD7}.ReleaseNoWix|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8BF95E2D-FD27-470C-82B7-C21AC01BFBD7}.ReleaseNoWix|Any CPU.Build.0 = Release|Any CPU
|
||||
{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}.DebugNoWindows|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}.DebugNoWindows|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}.DebugNoWix|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}.DebugNoWix|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}.ReleaseNoWindows|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}.ReleaseNoWindows|Any CPU.Build.0 = Release|Any CPU
|
||||
{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}.ReleaseNoWix|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BF02BCC5-735C-4FF1-8EEF-FF78EA42FC85}.ReleaseNoWix|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user