Yet even more ValueTask conversions

This commit is contained in:
Jordan Dominion
2023-10-07 15:05:30 -04:00
parent dc52156e0e
commit 64b7526f73
9 changed files with 33 additions and 33 deletions
@@ -27,7 +27,7 @@ namespace Tgstation.Server.Host.Components.Repository
public string RemoteRepositoryName => null;
/// <inheritdoc />
public Task<Models.TestMerge> GetTestMerge(
public ValueTask<Models.TestMerge> GetTestMerge(
TestMergeParameters parameters,
Api.Models.Internal.RepositorySettings repositorySettings,
CancellationToken cancellationToken) => throw new NotSupportedException();
@@ -56,7 +56,7 @@ namespace Tgstation.Server.Host.Components.Repository
}
/// <inheritdoc />
protected override async Task<Models.TestMerge> GetTestMergeImpl(
protected override async ValueTask<Models.TestMerge> GetTestMergeImpl(
TestMergeParameters parameters,
RepositorySettings repositorySettings,
CancellationToken cancellationToken)
@@ -51,7 +51,7 @@ namespace Tgstation.Server.Host.Components.Repository
}
/// <inheritdoc />
protected override async Task<Models.TestMerge> GetTestMergeImpl(
protected override async ValueTask<Models.TestMerge> GetTestMergeImpl(
TestMergeParameters parameters,
RepositorySettings repositorySettings,
CancellationToken cancellationToken)
@@ -54,7 +54,7 @@ namespace Tgstation.Server.Host.Components.Repository
}
/// <inheritdoc />
public async Task<Models.TestMerge> GetTestMerge(
public async ValueTask<Models.TestMerge> GetTestMerge(
TestMergeParameters parameters,
RepositorySettings repositorySettings,
CancellationToken cancellationToken)
@@ -85,8 +85,8 @@ namespace Tgstation.Server.Host.Components.Repository
/// <param name="parameters">The <see cref="TestMergeParameters"/>.</param>
/// <param name="repositorySettings">The <see cref="RepositorySettings"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
/// <returns>A <see cref="Task{TResult}"/> resulting in the <see cref="Models.TestMerge"/> of the <paramref name="parameters"/>.</returns>
protected abstract Task<Models.TestMerge> GetTestMergeImpl(
/// <returns>A <see cref="ValueTask{TResult}"/> resulting in the <see cref="Models.TestMerge"/> of the <paramref name="parameters"/>.</returns>
protected abstract ValueTask<Models.TestMerge> GetTestMergeImpl(
TestMergeParameters parameters,
RepositorySettings repositorySettings,
CancellationToken cancellationToken);
@@ -17,9 +17,9 @@ namespace Tgstation.Server.Host.Components.Repository
/// <param name="parameters">The <see cref="TestMergeParameters"/>.</param>
/// <param name="repositorySettings">The <see cref="RepositorySettings"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
/// <returns>A <see cref="Task{TResult}"/> resulting in the <see cref="Models.TestMerge"/> of the <paramref name="parameters"/>.</returns>
/// <returns>A <see cref="ValueTask{TResult}"/> resulting in the <see cref="Models.TestMerge"/> of the <paramref name="parameters"/>.</returns>
/// <remarks><see cref="TestMergeApiBase.MergedAt"/> and <see cref="Models.TestMerge.MergedBy"/> will be unset.</remarks>
Task<Models.TestMerge> GetTestMerge(
ValueTask<Models.TestMerge> GetTestMerge(
TestMergeParameters parameters,
RepositorySettings repositorySettings,
CancellationToken cancellationToken);
@@ -22,8 +22,8 @@ namespace Tgstation.Server.Host.Components.Repository
/// </summary>
/// <param name="path">The full path to the <see cref="LibGit2Sharp.IRepository"/>.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
/// <returns>A <see cref="Task{TResult}"/> resulting in the loaded <see cref="LibGit2Sharp.IRepository"/>.</returns>
Task<LibGit2Sharp.IRepository> CreateFromPath(string path, CancellationToken cancellationToken);
/// <returns>A <see cref="ValueTask{TResult}"/> resulting in the loaded <see cref="LibGit2Sharp.IRepository"/>.</returns>
ValueTask<LibGit2Sharp.IRepository> CreateFromPath(string path, CancellationToken cancellationToken);
/// <summary>
/// Clone a remote <see cref="LibGit2Sharp.IRepository"/>.
@@ -49,8 +49,8 @@ namespace Tgstation.Server.Host.Components.Repository
/// <param name="updateSubmodules">If a submodule update should be attempted after the merge.</param>
/// <param name="progressReporter">The <see cref="JobProgressReporter"/> to report progress of the operation.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
/// <returns>A <see cref="Task"/> representing the running operation.</returns>
Task CheckoutObject(
/// <returns>A <see cref="ValueTask"/> representing the running operation.</returns>
ValueTask CheckoutObject(
string committish,
string username,
string password,
@@ -69,8 +69,8 @@ namespace Tgstation.Server.Host.Components.Repository
/// <param name="updateSubmodules">If a submodule update should be attempted after the merge.</param>
/// <param name="progressReporter">The <see cref="JobProgressReporter"/> to report progress of the operation.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
/// <returns>A <see cref="Task{TResult}"/> resulting in the <see cref="TestMergeResult"/>.</returns>
Task<TestMergeResult> AddTestMerge(
/// <returns>A <see cref="ValueTask{TResult}"/> resulting in the <see cref="TestMergeResult"/>.</returns>
ValueTask<TestMergeResult> AddTestMerge(
TestMergeParameters testMergeParameters,
string committerName,
string committerEmail,
@@ -88,8 +88,8 @@ namespace Tgstation.Server.Host.Components.Repository
/// <param name="password">The password to fetch from the origin repository.</param>
/// <param name="deploymentPipeline">If any events created should be marked as part of the deployment pipeline.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
/// <returns>A <see cref="Task"/> representing the running operation.</returns>
Task FetchOrigin(
/// <returns>A <see cref="ValueTask"/> representing the running operation.</returns>
ValueTask FetchOrigin(
JobProgressReporter progressReporter,
string username,
string password,
@@ -105,8 +105,8 @@ namespace Tgstation.Server.Host.Components.Repository
/// <param name="updateSubmodules">If a submodule update should be attempted after the merge.</param>
/// <param name="deploymentPipeline">If any events created should be marked as part of the deployment pipeline.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
/// <returns>A <see cref="Task{TResult}"/> resulting in the SHA of the new HEAD.</returns>
Task ResetToOrigin(
/// <returns>A <see cref="ValueTask{TResult}"/> resulting in the SHA of the new HEAD.</returns>
ValueTask ResetToOrigin(
JobProgressReporter progressReporter,
string username,
string password,
@@ -131,8 +131,8 @@ namespace Tgstation.Server.Host.Components.Repository
/// <param name="committerEmail">The e-mail of the merge committer.</param>
/// <param name="deploymentPipeline">If any events created should be marked as part of the deployment pipeline.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
/// <returns>A <see cref="Task{TResult}"/> resulting in a <see cref="Nullable{T}"/> <see cref="bool"/> representing the merge result that is <see langword="true"/> after a fast forward, <see langword="false"/> on a merge or up to date, <see langword="null"/> on a conflict.</returns>
Task<bool?> MergeOrigin(
/// <returns>A <see cref="ValueTask{TResult}"/> resulting in a <see cref="Nullable{T}"/> <see cref="bool"/> representing the merge result that is <see langword="true"/> after a fast forward, <see langword="false"/> on a merge or up to date, <see langword="null"/> on a conflict.</returns>
ValueTask<bool?> MergeOrigin(
JobProgressReporter progressReporter,
string committerName,
string committerEmail,
@@ -150,8 +150,8 @@ namespace Tgstation.Server.Host.Components.Repository
/// <param name="synchronizeTrackedBranch">If the synchronizations should be made to the tracked reference as opposed to a temporary branch.</param>
/// <param name="deploymentPipeline">If any events created should be marked as part of the deployment pipeline.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
/// <returns>A <see cref="Task{TResult}"/> resulting in <see langword="true"/> if commits were pushed to the tracked origin reference, <see langword="false"/> otherwise.</returns>
Task<bool> Sychronize(
/// <returns>A <see cref="ValueTask{TResult}"/> resulting in <see langword="true"/> if commits were pushed to the tracked origin reference, <see langword="false"/> otherwise.</returns>
ValueTask<bool> Sychronize(
JobProgressReporter progressReporter,
string username,
string password,
@@ -166,8 +166,8 @@ namespace Tgstation.Server.Host.Components.Repository
/// </summary>
/// <param name="path">The path to copy repository contents to.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
/// <returns>A <see cref="Task"/> representing the running operation.</returns>
Task CopyTo(string path, CancellationToken cancellationToken);
/// <returns>A <see cref="ValueTask"/> representing the running operation.</returns>
ValueTask CopyTo(string path, CancellationToken cancellationToken);
/// <summary>
/// Check if a given <paramref name="sha"/> is a parent of the current <see cref="Head"/>.
@@ -38,7 +38,7 @@ namespace Tgstation.Server.Host.Components.Repository
}
/// <inheritdoc />
public async Task<LibGit2Sharp.IRepository> CreateFromPath(string path, CancellationToken cancellationToken)
public async ValueTask<LibGit2Sharp.IRepository> CreateFromPath(string path, CancellationToken cancellationToken)
{
ArgumentNullException.ThrowIfNull(path);
@@ -181,7 +181,7 @@ namespace Tgstation.Server.Host.Components.Repository
/// <inheritdoc />
#pragma warning disable CA1506 // TODO: Decomplexify
public async Task<TestMergeResult> AddTestMerge(
public async ValueTask<TestMergeResult> AddTestMerge(
TestMergeParameters testMergeParameters,
string committerName,
string committerEmail,
@@ -384,7 +384,7 @@ namespace Tgstation.Server.Host.Components.Repository
#pragma warning restore CA1506
/// <inheritdoc />
public async Task CheckoutObject(
public async ValueTask CheckoutObject(
string committish,
string username,
string password,
@@ -419,7 +419,7 @@ namespace Tgstation.Server.Host.Components.Repository
}
/// <inheritdoc />
public async Task FetchOrigin(
public async ValueTask FetchOrigin(
JobProgressReporter progressReporter,
string username,
string password,
@@ -466,7 +466,7 @@ namespace Tgstation.Server.Host.Components.Repository
}
/// <inheritdoc />
public async Task ResetToOrigin(
public async ValueTask ResetToOrigin(
JobProgressReporter progressReporter,
string username,
string password,
@@ -522,7 +522,7 @@ namespace Tgstation.Server.Host.Components.Repository
TaskScheduler.Current);
/// <inheritdoc />
public async Task CopyTo(string path, CancellationToken cancellationToken)
public async ValueTask CopyTo(string path, CancellationToken cancellationToken)
{
ArgumentNullException.ThrowIfNull(path);
logger.LogTrace("Copying to {path}...", path);
@@ -557,7 +557,7 @@ namespace Tgstation.Server.Host.Components.Repository
TaskScheduler.Current);
/// <inheritdoc />
public async Task<bool?> MergeOrigin(
public async ValueTask<bool?> MergeOrigin(
JobProgressReporter progressReporter,
string committerName,
string committerEmail,
@@ -636,7 +636,7 @@ namespace Tgstation.Server.Host.Components.Repository
}
/// <inheritdoc />
public async Task<bool> Sychronize(
public async ValueTask<bool> Sychronize(
JobProgressReporter progressReporter,
string username,
string password,
@@ -828,7 +828,7 @@ namespace Tgstation.Server.Host.Components.Repository
TaskScheduler.Current);
/// <inheritdoc />
public Task<Models.TestMerge> GetTestMerge(
public ValueTask<Models.TestMerge> GetTestMerge(
TestMergeParameters parameters,
RepositorySettings repositorySettings,
CancellationToken cancellationToken) => gitRemoteFeatures.GetTestMerge(