Skip to content

Commit

Permalink
Rename VcsProvider, refactor async method names
Browse files Browse the repository at this point in the history
  • Loading branch information
belidzs committed Jul 31, 2020
1 parent 1f53737 commit 15a8726
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Source/GitReleaseManager.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private static async Task<int> CloseMilestoneAsync(CloseSubOptions subOptions)
Log.Information("Closing milestone {Milestone}", subOptions.Milestone);
_vcsProvider = GetVcsProvider(subOptions);

await _vcsProvider.CloseMilestone(subOptions.RepositoryOwner, subOptions.RepositoryName, subOptions.Milestone).ConfigureAwait(false);
await _vcsProvider.CloseMilestoneAsync(subOptions.RepositoryOwner, subOptions.RepositoryName, subOptions.Milestone).ConfigureAwait(false);

return 0;
}
Expand Down Expand Up @@ -258,7 +258,7 @@ private static async Task<int> CreateLabelsAsync(LabelSubOptions subOptions)
Log.Information("Creating standard labels");
_vcsProvider = GetVcsProvider(subOptions);

await _vcsProvider.CreateLabels(subOptions.RepositoryOwner, subOptions.RepositoryName).ConfigureAwait(false);
await _vcsProvider.CreateLabelsAsync(subOptions.RepositoryOwner, subOptions.RepositoryName).ConfigureAwait(false);
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions Source/GitReleaseManager.Tests/FakeGitHubClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public Task<string> ExportReleases(string owner, string repository, string tagNa
throw new System.NotImplementedException();
}

public Task CloseMilestone(string owner, string repository, string milestoneTitle)
public Task CloseMilestoneAsync(string owner, string repository, string milestoneTitle)
{
throw new System.NotImplementedException();
}
Expand All @@ -113,7 +113,7 @@ public Task PublishRelease(string owner, string repository, string tagName)
throw new System.NotImplementedException();
}

public Task CreateLabels(string owner, string repository)
public Task CreateLabelsAsync(string owner, string repository)
{
throw new System.NotImplementedException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public VcsProvider(Config configuration, ILogger logger)

public abstract Task AddAssets(string owner, string repository, string tagName, IList<string> assets);

public abstract Task CloseMilestone(string owner, string repository, string milestoneTitle);
public abstract Task CloseMilestoneAsync(string owner, string repository, string milestoneTitle);

public abstract Task<Release> CreateReleaseFromInputFile(string owner, string repository, string name, string inputFilePath, string targetCommitish, IList<string> assets, bool prerelease);

Expand All @@ -50,7 +50,7 @@ public VcsProvider(Config configuration, ILogger logger)

public abstract Task PublishRelease(string owner, string repository, string tagName);

public virtual async Task CreateLabels(string owner, string repository)
public virtual async Task CreateLabelsAsync(string owner, string repository)
{
if (Configuration.Labels.Any())
{
Expand Down
4 changes: 2 additions & 2 deletions Source/GitReleaseManager/GitHubProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public Task<string> ExportReleases(string owner, string repository, string tagNa
return releaseNotesExporter.ExportReleaseNotes(tagName);
}

public async Task CloseMilestone(string owner, string repository, string milestoneTitle)
public async Task CloseMilestoneAsync(string owner, string repository, string milestoneTitle)
{
_logger.Verbose("Finding open milestone with title '{Title}' on '{Owner}/{Repository}'", milestoneTitle, owner, repository);
var milestoneClient = _gitHubClient.Issue.Milestone;
Expand Down Expand Up @@ -341,7 +341,7 @@ public async Task PublishRelease(string owner, string repository, string tagName
await _gitHubClient.Repository.Release.Edit(owner, repository, release.Id, releaseUpdate).ConfigureAwait(false);
}

public async Task CreateLabels(string owner, string repository)
public async Task CreateLabelsAsync(string owner, string repository)
{
if (_configuration.Labels.Any())
{
Expand Down
4 changes: 2 additions & 2 deletions Source/GitReleaseManager/GiteaProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace GitReleaseManager.Core
using GitReleaseManager.Core.Extensions;
using Serilog;

public class GiteaProvider : VcsProvider
public class GiteaProvider : BaseVcsProvider, IVcsProvider
{
private readonly IssueApi _api;

Expand All @@ -34,7 +34,7 @@ public override Task AddAssets(string owner, string repository, string tagName,
throw new NotImplementedException();
}

public override async Task CloseMilestone(string owner, string repository, string milestoneTitle)
public override async Task CloseMilestoneAsync(string owner, string repository, string milestoneTitle)
{
Logger.Verbose("Finding open milestone with title '{Title}' on '{Owner}/{Repository}'", milestoneTitle, owner, repository);

Expand Down
4 changes: 2 additions & 2 deletions Source/GitReleaseManager/IVcsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public interface IVcsProvider

Task<string> ExportReleases(string owner, string repository, string tagName);

Task CloseMilestone(string owner, string repository, string milestoneTitle);
Task CloseMilestoneAsync(string owner, string repository, string milestoneTitle);

Task OpenMilestone(string owner, string repository, string milestoneTitle);

Task PublishRelease(string owner, string repository, string tagName);

Task CreateLabels(string owner, string repository);
Task CreateLabelsAsync(string owner, string repository);
}
}

0 comments on commit 15a8726

Please sign in to comment.