3using System.Threading.Tasks;
6using Microsoft.Extensions.Logging;
21 public const string GitLabUrl =
"https://gitlab.com";
38 : base(logger, remoteUrl)
46 CancellationToken cancellationToken)
48 var client = repositorySettings.AccessToken !=
null
56 .GetAsync($
"{RemoteRepositoryOwner}/{RemoteRepositoryName}", parameters.
Number)
57 .WaitAsync(cancellationToken);
59 var revisionToUse = parameters.TargetCommitSha ==
null
60 || mr.Sha.StartsWith(parameters.
TargetCommitSha, StringComparison.OrdinalIgnoreCase)
66 Author = mr.
Author.Username,
67 BodyAtMerge = mr.Description,
68 TitleAtMerge = mr.Title,
70 Number = parameters.
Number,
71 TargetCommitSha = mr.Sha,
77 Logger.LogWarning(ex,
"Error retrieving merge request metadata!");
82 BodyAtMerge = ex.Message,
83 TitleAtMerge = ex.Message,
85 Number = parameters.
Number,
87 Url = $
"https://gitlab.com/{RemoteRepositoryOwner}/{RemoteRepositoryName}/-/merge_requests/{parameters.Number}",
string? Author
The author of the test merge source.
Represents configurable settings for a git repository.
string? AccessToken
The token/password to access the git repository with. Can also be a TGS encoded app private key....
Parameters for creating a TestMerge.
virtual ? string TargetCommitSha
The sha of the test merge revision to merge. If not specified, the latest commit from the source will...
string? Comment
Optional comment about the test.
int Number
The number of the test merge source.
GitLab IGitRemoteFeatures.
override async ValueTask< Models.TestMerge > GetTestMergeImpl(TestMergeParameters parameters, RepositorySettings repositorySettings, CancellationToken cancellationToken)
override string TestMergeLocalBranchNameFormatter
Get.
const string GitLabUrl
Url for main GitLab site.
GitLabRemoteFeatures(ILogger< GitLabRemoteFeatures > logger, Uri remoteUrl)
Initializes a new instance of the GitLabRemoteFeatures class.
override string TestMergeRefSpecFormatter
Gets a formatter string which creates the remote refspec for fetching the HEAD of passed in test merg...
Base class for implementing IGitRemoteFeatures.
ILogger< GitRemoteFeaturesBase > Logger
The ILogger for the GitRemoteFeaturesBase.
RemoteGitProvider
Indicates the remote git host.