Skip to content

Commit

Permalink
Merge tag '4.0.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Mar 7, 2024
2 parents 2e14d51 + 1eed717 commit b5be5c1
Show file tree
Hide file tree
Showing 38 changed files with 246 additions and 251 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
using Cake.Common.Build;
using Cake.Common.IO;
using Cake.Core.IO;
using Cake.Issues;
using Cake.Issues.PullRequests;
using Cake.Issues.PullRequests.AppVeyor;
using System;

namespace Cake.Frosting.Issues.Recipe
{
using Cake.Common.Build;
using Cake.Common.IO;
using Cake.Core.IO;
using Cake.Issues;
using Cake.Issues.PullRequests;
using Cake.Issues.PullRequests.AppVeyor;
using System;

/// <summary>
/// Support for AppVeyor builds.
/// </summary>
internal class AppVeyorBuildServer : BaseBuildServer
internal sealed class AppVeyorBuildServer : BaseBuildServer
{
/// <inheritdoc />
public override Uri DetermineRepositoryRemoteUrl(
Expand All @@ -20,14 +20,14 @@ public override Uri DetermineRepositoryRemoteUrl(
{
context.NotNull(nameof(context));

switch (context.AppVeyor().Environment.Repository.Provider)
return context.AppVeyor().Environment.Repository.Provider switch
{
case "bitBucket": return new Uri($"https://bitbucket.org/{context.AppVeyor().Environment.Repository.Name}/src");
case "gitHub": return new Uri($"https://github.com/{context.AppVeyor().Environment.Repository.Name}.git");
case "gitLab": return new Uri($"https://gitlab.com/{context.AppVeyor().Environment.Repository.Name}.git");
case "vso": return new Uri($"https://dev.azure.com/{context.AppVeyor().Environment.Repository.Name}");
default: return new Uri(context.AppVeyor().Environment.Repository.Name);
}
"bitBucket" => new Uri($"https://bitbucket.org/{context.AppVeyor().Environment.Repository.Name}/src"),
"gitHub" => new Uri($"https://github.com/{context.AppVeyor().Environment.Repository.Name}.git"),
"gitLab" => new Uri($"https://gitlab.com/{context.AppVeyor().Environment.Repository.Name}.git"),
"vso" => new Uri($"https://dev.azure.com/{context.AppVeyor().Environment.Repository.Name}"),
_ => new Uri(context.AppVeyor().Environment.Repository.Name),
};
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
using Cake.Common;
using Cake.Common.Build;
using Cake.Common.Build.AzurePipelines.Data;
using Cake.Common.IO;
using Cake.Core.IO;
using Cake.Issues;
using Cake.Issues.Reporting;
using Cake.Issues.Reporting.Generic;
using System;
using System.IO;

namespace Cake.Frosting.Issues.Recipe
{
using Cake.Common;
using Cake.Common.Build;
using Cake.Common.Build.AzurePipelines.Data;
using Cake.Common.IO;
using Cake.Core.IO;
using Cake.Issues;
using Cake.Issues.Reporting;
using Cake.Issues.Reporting.Generic;
using System;
using System.IO;

/// <summary>
/// Support for Azure DevOps / Azure Pipelines builds.
/// </summary>
internal class AzureDevOpsBuildServer : BaseBuildServer
internal sealed class AzureDevOpsBuildServer : BaseBuildServer
{
/// <inheritdoc />
public override Uri DetermineRepositoryRemoteUrl(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Cake.Core.IO;
using Cake.Issues;
using System;

namespace Cake.Frosting.Issues.Recipe
{
using Cake.Core.IO;
using Cake.Issues;
using System;

/// <summary>
/// Basic implementation for all build servers.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using Cake.Common.Build;
using Cake.Core.IO;
using Cake.Issues;
using Cake.Issues.PullRequests;
using Cake.Issues.PullRequests.GitHubActions;
using System;

namespace Cake.Frosting.Issues.Recipe
{
using Cake.Common.Build;
using Cake.Core.IO;
using Cake.Issues;
using Cake.Issues.PullRequests;
using Cake.Issues.PullRequests.GitHubActions;
using System;

/// <summary>
/// Support for builds running on GitHub Actions.
/// </summary>
internal class GitHubActionsBuildServer : BaseBuildServer
internal sealed class GitHubActionsBuildServer : BaseBuildServer
{
/// <inheritdoc />
public override Uri DetermineRepositoryRemoteUrl(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Cake.Core.IO;
using System;

namespace Cake.Frosting.Issues.Recipe
{
using Cake.Core.IO;
using System;

/// <summary>
/// Description of a build server implementation.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ For recipe compatible with Cake Script Runners see Cake.Issues.Recipe.</Descript
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/cake-contrib/Cake.Issues.Recipe.git</RepositoryUrl>
<PackageReleaseNotes>https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/3.1.1</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/4.0.0</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand All @@ -36,21 +36,21 @@ For recipe compatible with Cake Script Runners see Cake.Issues.Recipe.</Descript
</ItemGroup>

<ItemGroup>
<PackageReference Include="Cake.AzureDevOps" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.AzureDevOps" Version="4.0.0" />
<PackageReference Include="Cake.Frosting" Version="4.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Git" Version="3.0.0" />
<PackageReference Include="Cake.Issues" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.Issues.EsLint" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.Issues.InspectCode" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.Issues.Markdownlint" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.Frosting.Issues.MsBuild" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.Issues.PullRequests" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.Issues.PullRequests.AppVeyor" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.Issues.PullRequests.AzureDevOps" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.Issues.PullRequests.GitHubActions" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.Issues.Reporting" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.Frosting.Issues.Reporting.Sarif" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.Frosting.Issues.Reporting.Generic" Version="4.0.0-beta0001" />
<PackageReference Include="Cake.Frosting.Git" Version="4.0.0" />
<PackageReference Include="Cake.Issues" Version="4.0.0" />
<PackageReference Include="Cake.Issues.EsLint" Version="4.0.0" />
<PackageReference Include="Cake.Issues.InspectCode" Version="4.0.0" />
<PackageReference Include="Cake.Issues.Markdownlint" Version="4.0.0" />
<PackageReference Include="Cake.Frosting.Issues.MsBuild" Version="4.0.0" />
<PackageReference Include="Cake.Issues.PullRequests" Version="4.0.0" />
<PackageReference Include="Cake.Issues.PullRequests.AppVeyor" Version="4.0.0" />
<PackageReference Include="Cake.Issues.PullRequests.AzureDevOps" Version="4.0.0" />
<PackageReference Include="Cake.Issues.PullRequests.GitHubActions" Version="4.0.0" />
<PackageReference Include="Cake.Issues.Reporting" Version="4.0.0" />
<PackageReference Include="Cake.Frosting.Issues.Reporting.Sarif" Version="4.0.0" />
<PackageReference Include="Cake.Frosting.Issues.Reporting.Generic" Version="4.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
using Cake.Core;

namespace Cake.Frosting.Issues.Recipe
namespace Cake.Frosting.Issues.Recipe
{
using Cake.Core;

/// <summary>
/// Parameters and state for the build run.
/// </summary>
public class IssuesContext : IssuesContext<IssuesParameters, IssuesState>
/// <param name="context">The Cake context.</param>
/// <param name="repositoryInfoProviderType">Defines how information about the Git repository should be determined.</param>
public class IssuesContext(
ICakeContext context,
RepositoryInfoProviderType repositoryInfoProviderType) : IssuesContext<IssuesParameters, IssuesState>(context)
{
private readonly RepositoryInfoProviderType repositoryInfoProviderType;

/// <summary>
/// Creates a new instance of the <see cref="IssuesContext"/> class.
/// </summary>
/// <param name="context">The Cake context.</param>
/// <param name="repositoryInfoProviderType">Defines how information about the Git repository should be determined.</param>
public IssuesContext(
ICakeContext context,
RepositoryInfoProviderType repositoryInfoProviderType)
: base(context)
{
this.repositoryInfoProviderType = repositoryInfoProviderType;
}
private readonly RepositoryInfoProviderType repositoryInfoProviderType = repositoryInfoProviderType;

/// <inheritdoc />
protected override IssuesParameters CreateIssuesParameters()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Cake.Core;
using System;

namespace Cake.Frosting.Issues.Recipe
namespace Cake.Frosting.Issues.Recipe
{
using Cake.Core;
using System;

/// <summary>
/// Base class for parameters and state of the build run.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Cake.Core.IO;

namespace Cake.Frosting.Issues.Recipe
namespace Cake.Frosting.Issues.Recipe
{
using Cake.Core.IO;

/// <summary>
/// Description of parameters of the build.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Cake.Core.IO;
using Cake.Issues;
using System.Collections.Generic;

namespace Cake.Frosting.Issues.Recipe
{
using Cake.Core.IO;
using Cake.Issues;
using System.Collections.Generic;

/// <summary>
/// Parameters for passing input files.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Cake.Issues;
using Cake.Issues.PullRequests;
using System.Collections.Generic;

namespace Cake.Frosting.Issues.Recipe
{
using Cake.Issues;
using Cake.Issues.PullRequests;
using System.Collections.Generic;

/// <summary>
/// Parameters for pull request integration.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Cake.Issues.Reporting.Generic;

namespace Cake.Frosting.Issues.Recipe
{
using Cake.Issues.Reporting.Generic;

/// <summary>
/// Parameters for reporting.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using Cake.Core.IO;
using System;

namespace Cake.Frosting.Issues.Recipe
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Cake.Core.IO;
using Cake.Issues;
using System.Collections.Generic;

namespace Cake.Frosting.Issues.Recipe
{
using Cake.Core.IO;
using Cake.Issues;
using System.Collections.Generic;

/// <summary>
/// Parameters for passing input files.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public class IssuesParametersPullRequestSystem : IIssuesParametersPullRequestSys
public int? MaxIssuesToPostForEachIssueProvider { get; set; } = 100;

/// <inheritdoc />
public Dictionary<string, IProviderIssueLimits> ProviderIssueLimits => new Dictionary<string, IProviderIssueLimits>();
public Dictionary<string, IProviderIssueLimits> ProviderIssueLimits => new();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Cake.Issues.Reporting.Generic;

namespace Cake.Frosting.Issues.Recipe
{
using Cake.Issues.Reporting.Generic;

/// <summary>
/// Parameters for reporting.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Cake.Core.IO;
using System;

namespace Cake.Frosting.Issues.Recipe
{
using Cake.Core.IO;
using System;

/// <summary>
/// Parameters of the build.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Cake.Core.IO;
using Cake.Issues;
using System;
using System.Collections.Generic;

namespace Cake.Frosting.Issues.Recipe
namespace Cake.Frosting.Issues.Recipe
{
using Cake.Core.IO;
using Cake.Issues;
using System;
using System.Collections.Generic;

/// <summary>
/// Description of the mutable state of the build run.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
using Cake.Common;
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Common.IO;
using Cake.Core.IO;
using Cake.Issues;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace Cake.Frosting.Issues.Recipe
namespace Cake.Frosting.Issues.Recipe
{
using Cake.Common;
using Cake.Common.Build;
using Cake.Common.Diagnostics;
using Cake.Common.IO;
using Cake.Core.IO;
using Cake.Issues;
using System;
using System.Collections.Generic;

/// <summary>
/// Mutable state of the build run.
/// </summary>
public class IssuesState : IIssuesState
{
private readonly IIssuesContext context;

private readonly List<IIssue> issues = new List<IIssue>();
private readonly List<IIssue> issues = [];

private readonly List<(IIssueProvider, string)> issueProvidersAndRuns = new List<(IIssueProvider, string)>();
private readonly List<(IIssueProvider, string)> issueProvidersAndRuns = [];

/// <inheritdoc />
public DirectoryPath RepositoryRootDirectory { get; }
Expand Down Expand Up @@ -237,10 +236,7 @@ private static IReadIssuesSettings GetSettings(IReadIssuesSettings configuredSet
return defaultSettings;
}

if (configuredSettings.FileLinkSettings == null)
{
configuredSettings.FileLinkSettings = defaultSettings.FileLinkSettings;
}
configuredSettings.FileLinkSettings ??= defaultSettings.FileLinkSettings;

return configuredSettings;
}
Expand Down
Loading

0 comments on commit b5be5c1

Please sign in to comment.