Skip to content

Commit 1336825

Browse files
committed
Merge branch 'release/5.2.0'
2 parents 0c91456 + 647a538 commit 1336825

16 files changed

+292
-38
lines changed

Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe.Tests/Cake.Frosting.Issues.Recipe.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818

1919
<ItemGroup>
2020
<PackageReference Include="Cake.Frosting" Version="5.0.0" />
21-
<PackageReference Include="Cake.Issues.Testing" Version="5.1.1" />
21+
<PackageReference Include="Cake.Issues.Testing" Version="5.2.0" />
2222
<PackageReference Include="Cake.Testing" Version="5.0.0" />
2323
<PackageReference Include="Cake.Testing.Xunit" Version="5.0.0" />
2424
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0">
2525
<PrivateAssets>all</PrivateAssets>
2626
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2727
</PackageReference>
2828
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
29-
<PackageReference Include="xunit" Version="2.9.2" />
29+
<PackageReference Include="xunit" Version="2.9.3" />
3030
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
3131
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
3232
<PrivateAssets>all</PrivateAssets>

Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe.csproj

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ For recipe compatible with Cake Script Runners see Cake.Issues.Recipe.</Descript
2525
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2626
<RepositoryType>git</RepositoryType>
2727
<RepositoryUrl>https://github.com/cake-contrib/Cake.Issues.Recipe.git</RepositoryUrl>
28-
<PackageReleaseNotes>https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/5.1.1</PackageReleaseNotes>
28+
<PackageReleaseNotes>https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/5.2.0</PackageReleaseNotes>
2929
</PropertyGroup>
3030

3131
<ItemGroup>
@@ -42,20 +42,20 @@ For recipe compatible with Cake Script Runners see Cake.Issues.Recipe.</Descript
4242
<PackageReference Include="Cake.Frosting.AzureDevOps" Version="5.0.0" />
4343
<PackageReference Include="Cake.Frosting" Version="5.0.0" PrivateAssets="All" />
4444
<PackageReference Include="Cake.Frosting.Git" Version="5.0.1" />
45-
<PackageReference Include="Cake.Issues" Version="5.1.1" />
46-
<PackageReference Include="Cake.Frosting.Issues.EsLint" Version="5.1.1" />
47-
<PackageReference Include="Cake.Frosting.Issues.InspectCode" Version="5.1.1" />
48-
<PackageReference Include="Cake.Frosting.Issues.Markdownlint" Version="5.1.1" />
49-
<PackageReference Include="Cake.Frosting.Issues.MsBuild" Version="5.1.1" />
50-
<PackageReference Include="Cake.Frosting.Issues.Sarif" Version="5.1.1" />
51-
<PackageReference Include="Cake.Frosting.Issues.PullRequests" Version="5.1.1" />
52-
<PackageReference Include="Cake.Frosting.Issues.PullRequests.AppVeyor" Version="5.1.1" />
53-
<PackageReference Include="Cake.Frosting.Issues.PullRequests.AzureDevOps" Version="5.1.1" />
54-
<PackageReference Include="Cake.Frosting.Issues.PullRequests.GitHubActions" Version="5.1.1" />
55-
<PackageReference Include="Cake.Frosting.Issues.Reporting" Version="5.1.1" />
56-
<PackageReference Include="Cake.Frosting.Issues.Reporting.Sarif" Version="5.1.1" />
57-
<PackageReference Include="Cake.Frosting.Issues.Reporting.Generic" Version="5.1.1" />
58-
<PackageReference Include="Cake.Frosting.Issues.Reporting.Console" Version="5.1.1" />
45+
<PackageReference Include="Cake.Issues" Version="5.2.0" />
46+
<PackageReference Include="Cake.Frosting.Issues.EsLint" Version="5.2.0" />
47+
<PackageReference Include="Cake.Frosting.Issues.InspectCode" Version="5.2.0" />
48+
<PackageReference Include="Cake.Frosting.Issues.Markdownlint" Version="5.2.0" />
49+
<PackageReference Include="Cake.Frosting.Issues.MsBuild" Version="5.2.0" />
50+
<PackageReference Include="Cake.Frosting.Issues.Sarif" Version="5.2.0" />
51+
<PackageReference Include="Cake.Frosting.Issues.PullRequests" Version="5.2.0" />
52+
<PackageReference Include="Cake.Frosting.Issues.PullRequests.AppVeyor" Version="5.2.0" />
53+
<PackageReference Include="Cake.Frosting.Issues.PullRequests.AzureDevOps" Version="5.2.0" />
54+
<PackageReference Include="Cake.Frosting.Issues.PullRequests.GitHubActions" Version="5.2.0" />
55+
<PackageReference Include="Cake.Frosting.Issues.Reporting" Version="5.2.0" />
56+
<PackageReference Include="Cake.Frosting.Issues.Reporting.Sarif" Version="5.2.0" />
57+
<PackageReference Include="Cake.Frosting.Issues.Reporting.Generic" Version="5.2.0" />
58+
<PackageReference Include="Cake.Frosting.Issues.Reporting.Console" Version="5.2.0" />
5959
</ItemGroup>
6060

6161
</Project>

Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IIssuesParameters.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,9 @@ public interface IIssuesParameters
4141
/// Gets the parameters for pull request system integration.
4242
/// </summary>
4343
IIssuesParametersPullRequestSystem PullRequestSystem { get; }
44+
45+
/// <summary>
46+
/// Gets the parameters for build breaking.
47+
/// </summary>
48+
IIssuesParametersBuildBreaking BuildBreaking { get; }
4449
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
namespace Cake.Frosting.Issues.Recipe;
2+
3+
/// <summary>
4+
/// Parameters for build breaking.
5+
/// </summary>
6+
public interface IIssuesParametersBuildBreaking
7+
{
8+
/// <summary>
9+
/// Gets or sets a value indicating whether build should fail if any issues are found.
10+
/// Default value is <c>false</c>.
11+
/// </summary>
12+
bool ShouldFailBuildOnIssues { get; set; }
13+
14+
/// <summary>
15+
/// Gets or sets the minimum priority of issues considered to fail the build.
16+
/// If set to <see cref="IssuePriority.Undefined"/>, all issues are considered.
17+
/// Default value is <see cref="IssuePriority.Undefined"/>.
18+
/// </summary>
19+
IssuePriority MinimumPriority { get; set; }
20+
21+
/// <summary>
22+
/// Gets the list of issue provider types to consider.
23+
/// If empty, all providers are considered.
24+
/// Default value is empty.
25+
/// </summary>
26+
IList<string> IssueProvidersToConsider { get; }
27+
28+
/// <summary>
29+
/// Gets the list of issue provider types to ignore.
30+
/// Default value is empty.
31+
/// </summary>
32+
IList<string> IssueProvidersToIgnore { get; }
33+
}

Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IssuesParameters.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace Cake.Frosting.Issues.Recipe;
33
/// <summary>
44
/// Parameters of the build.
55
/// </summary>
6-
public class IssuesParameters : IssuesParameters<IssuesParametersInputFiles, IssuesParametersReporting, IssuesParametersBuildServer, IssuesParametersPullRequestSystem>
6+
public class IssuesParameters : IssuesParameters<IssuesParametersInputFiles, IssuesParametersReporting, IssuesParametersBuildServer, IssuesParametersPullRequestSystem, IssuesParametersBuildBreaking>
77
{
88
/// <inheritdoc />
99
protected override IssuesParametersBuildServer CreateBuildServerParameters() => new();
@@ -16,4 +16,7 @@ public class IssuesParameters : IssuesParameters<IssuesParametersInputFiles, Iss
1616

1717
/// <inheritdoc />
1818
protected override IssuesParametersReporting CreateReportingParameters() => new();
19+
20+
/// <inheritdoc />
21+
protected override IssuesParametersBuildBreaking CreateBuildBreakingParameters() => new();
1922
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
namespace Cake.Frosting.Issues.Recipe;
2+
3+
/// <summary>
4+
/// Parameters for passing input files.
5+
/// </summary>
6+
public class IssuesParametersBuildBreaking: IIssuesParametersBuildBreaking
7+
{
8+
/// <inheritdoc />
9+
public bool ShouldFailBuildOnIssues { get; set; }
10+
11+
/// <inheritdoc />
12+
public IssuePriority MinimumPriority { get; set; } = IssuePriority.Undefined;
13+
14+
/// <inheritdoc />
15+
public IList<string> IssueProvidersToConsider { get; } = [];
16+
17+
/// <inheritdoc />
18+
public IList<string> IssueProvidersToIgnore { get; } = [];
19+
}

Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IssuesParametersInputFiles.cs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ public void AddMsBuildXmlFileLoggerLogFilePath(FilePath logfilePath, IReadIssues
6060
{
6161
logfilePath.NotNull();
6262

63+
if (this.MsBuildXmlFileLoggerLogFilePaths.ContainsKey(logfilePath))
64+
{
65+
throw new ArgumentException(
66+
$"The path '{logfilePath.FullPath}' is already registered for the MsBuildXmlFileLogger log file format.",
67+
nameof(logfilePath));
68+
}
69+
6370
this.MsBuildXmlFileLoggerLogFilePaths.Add(logfilePath, settings);
6471
}
6572

@@ -76,6 +83,13 @@ public void AddMsBuildBinaryLogFilePath(FilePath logfilePath, IReadIssuesSetting
7683
{
7784
logfilePath.NotNull();
7885

86+
if (this.MsBuildBinaryLogFilePaths.ContainsKey(logfilePath))
87+
{
88+
throw new ArgumentException(
89+
$"The path '{logfilePath.FullPath}' is already registered for the MsBuildBinary log file format.",
90+
nameof(logfilePath));
91+
}
92+
7993
this.MsBuildBinaryLogFilePaths.Add(logfilePath, settings);
8094
}
8195

@@ -92,6 +106,13 @@ public void AddInspectCodeLogFilePath(FilePath logfilePath, IReadIssuesSettings
92106
{
93107
logfilePath.NotNull();
94108

109+
if (this.InspectCodeLogFilePaths.ContainsKey(logfilePath))
110+
{
111+
throw new ArgumentException(
112+
$"The path '{logfilePath.FullPath}' is already registered for InspectCode issue provider.",
113+
nameof(logfilePath));
114+
}
115+
95116
this.InspectCodeLogFilePaths.Add(logfilePath, settings);
96117
}
97118

@@ -108,6 +129,13 @@ public void AddMarkdownlintCliLogFilePath(FilePath logfilePath, IReadIssuesSetti
108129
{
109130
logfilePath.NotNull();
110131

132+
if (this.MarkdownlintCliLogFilePaths.ContainsKey(logfilePath))
133+
{
134+
throw new ArgumentException(
135+
$"The path '{logfilePath.FullPath}' is already registered for the MarkdownlintCli log file format.",
136+
nameof(logfilePath));
137+
}
138+
111139
this.MarkdownlintCliLogFilePaths.Add(logfilePath, settings);
112140
}
113141

@@ -124,6 +152,13 @@ public void AddMarkdownlintCliJsonLogFilePath(FilePath logfilePath, IReadIssuesS
124152
{
125153
logfilePath.NotNull();
126154

155+
if (this.MarkdownlintCliJsonLogFilePaths.ContainsKey(logfilePath))
156+
{
157+
throw new ArgumentException(
158+
$"The path '{logfilePath.FullPath}' is already registered for the MarkdownlintCliJson log file format.",
159+
nameof(logfilePath));
160+
}
161+
127162
this.MarkdownlintCliJsonLogFilePaths.Add(logfilePath, settings);
128163
}
129164

@@ -140,6 +175,13 @@ public void AddMarkdownlintV1LogFilePath(FilePath logfilePath, IReadIssuesSettin
140175
{
141176
logfilePath.NotNull();
142177

178+
if (this.MarkdownlintV1LogFilePaths.ContainsKey(logfilePath))
179+
{
180+
throw new ArgumentException(
181+
$"The path '{logfilePath.FullPath}' is already registered for the MarkdownlintV1 log file format.",
182+
nameof(logfilePath));
183+
}
184+
143185
this.MarkdownlintV1LogFilePaths.Add(logfilePath, settings);
144186
}
145187

@@ -156,6 +198,13 @@ public void AddEsLintJsonLogFilePath(FilePath logfilePath, IReadIssuesSettings s
156198
{
157199
logfilePath.NotNull();
158200

201+
if (this.EsLintJsonLogFilePaths.ContainsKey(logfilePath))
202+
{
203+
throw new ArgumentException(
204+
$"The path '{logfilePath.FullPath}' is already registered for the EsLintJson log file format.",
205+
nameof(logfilePath));
206+
}
207+
159208
this.EsLintJsonLogFilePaths.Add(logfilePath, settings);
160209
}
161210

@@ -172,6 +221,13 @@ public void AddSarifLogFilePath(FilePath logfilePath, IReadIssuesSettings settin
172221
{
173222
logfilePath.NotNull();
174223

224+
if (this.SarifLogFilePaths.ContainsKey(logfilePath))
225+
{
226+
throw new ArgumentException(
227+
$"The path '{logfilePath.FullPath}' is already registered for the SARIF issue provider.",
228+
nameof(logfilePath));
229+
}
230+
175231
this.SarifLogFilePaths.Add(logfilePath, settings);
176232
}
177233

Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/Context/Parameters/IssuesParameters{TInputFiles,TReporting,TBuildServer,TPullRequestSystem}.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,19 @@ namespace Cake.Frosting.Issues.Recipe;
99
/// <typeparam name="TReporting">Type of reporting parameters.</typeparam>
1010
/// <typeparam name="TBuildServer">Type of parameters for build server integration.</typeparam>
1111
/// <typeparam name="TPullRequestSystem">Type of parameters for pull request system integration</typeparam>
12-
public abstract class IssuesParameters<TInputFiles, TReporting, TBuildServer, TPullRequestSystem> : IIssuesParameters
12+
/// <typeparam name="TBuildBreaking">Type of parameters for build breaking.</typeparam>
13+
public abstract class IssuesParameters<TInputFiles, TReporting, TBuildServer, TPullRequestSystem, TBuildBreaking> : IIssuesParameters
1314
where TInputFiles : IIssuesParametersInputFiles
1415
where TReporting : IIssuesParametersReporting
1516
where TBuildServer : IIssuesParametersBuildServer
1617
where TPullRequestSystem : IIssuesParametersPullRequestSystem
18+
where TBuildBreaking : IIssuesParametersBuildBreaking
1719
{
1820
private readonly Lazy<TInputFiles> inputFiles;
1921
private readonly Lazy<TReporting> reporting;
2022
private readonly Lazy<TBuildServer> buildServer;
2123
private readonly Lazy<TPullRequestSystem> pullRequestSystem;
24+
private readonly Lazy<TBuildBreaking> buildBreaking;
2225

2326
/// <inheritdoc />
2427
public DirectoryPath OutputDirectory { get; set; } = "BuildArtifacts";
@@ -38,6 +41,9 @@ public abstract class IssuesParameters<TInputFiles, TReporting, TBuildServer, TP
3841
/// <inheritdoc />
3942
public TPullRequestSystem PullRequestSystem => this.pullRequestSystem.Value;
4043

44+
/// <inheritdoc />
45+
public TBuildBreaking BuildBreaking => this.buildBreaking.Value;
46+
4147
IIssuesParametersInputFiles IIssuesParameters.InputFiles => this.InputFiles;
4248

4349
IIssuesParametersReporting IIssuesParameters.Reporting => this.Reporting;
@@ -46,6 +52,8 @@ public abstract class IssuesParameters<TInputFiles, TReporting, TBuildServer, TP
4652

4753
IIssuesParametersPullRequestSystem IIssuesParameters.PullRequestSystem => this.PullRequestSystem;
4854

55+
IIssuesParametersBuildBreaking IIssuesParameters.BuildBreaking => this.BuildBreaking;
56+
4957
/// <summary>
5058
/// Creates a new instance of the <see cref="IssuesParameters"/> class.
5159
/// </summary>
@@ -55,6 +63,7 @@ protected IssuesParameters()
5563
this.reporting = new Lazy<TReporting>(this.CreateReportingParameters);
5664
this.buildServer = new Lazy<TBuildServer>(this.CreateBuildServerParameters);
5765
this.pullRequestSystem = new Lazy<TPullRequestSystem>(this.CreatePullRequestSystemParameters);
66+
this.buildBreaking = new Lazy<TBuildBreaking>(this.CreateBuildBreakingParameters);
5867
}
5968

6069
/// <summary>
@@ -80,4 +89,10 @@ protected IssuesParameters()
8089
/// </summary>
8190
/// <returns>Parameters object pull request system integration.</returns>
8291
protected abstract TPullRequestSystem CreatePullRequestSystemParameters();
92+
93+
/// <summary>
94+
/// Factory method to instantiate <see cref="buildBreaking"/>.
95+
/// </summary>
96+
/// <returns>Parameters object for build breaking settings.</returns>
97+
protected abstract TBuildBreaking CreateBuildBreakingParameters();
8398
}

Cake.Frosting.Issues.Recipe/Cake.Frosting.Issues.Recipe/IssuesTask.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
namespace Cake.Frosting.Issues.Recipe;
2-
32
/// <summary>
43
/// Main task for issue management integration.
54
/// </summary>
@@ -10,6 +9,23 @@
109
[IsDependentOn(typeof(ReportIssuesToPullRequestTask))]
1110
[IsDependentOn(typeof(SetPullRequestIssuesStateTask))]
1211
[IsDependentOn(typeof(ReportIssuesToConsoleTask))]
13-
public sealed class IssuesTask : FrostingTask
12+
public sealed class IssuesTask : FrostingTask<IIssuesContext>
1413
{
14+
/// <inheritdoc/>
15+
public override void Run(IIssuesContext context)
16+
{
17+
context.NotNull();
18+
19+
if (context.Parameters.BuildBreaking.ShouldFailBuildOnIssues)
20+
{
21+
context.BreakBuildOnIssues(
22+
context.State.Issues,
23+
new BuildBreakingSettings
24+
{
25+
MinimumPriority = context.Parameters.BuildBreaking.MinimumPriority,
26+
IssueProvidersToConsider = context.Parameters.BuildBreaking.IssueProvidersToConsider,
27+
IssueProvidersToIgnore = context.Parameters.BuildBreaking.IssueProvidersToIgnore
28+
});
29+
}
30+
}
1531
}

Cake.Issues.Recipe/Content/addins.cake

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
///////////////////////////////////////////////////////////////////////////////
44

55
#addin nuget:?package=Cake.Git&version=5.0.1
6-
#addin nuget:?package=Cake.Issues&version=5.1.1
7-
#addin nuget:?package=Cake.Issues.MsBuild&version=5.1.1
8-
#addin nuget:?package=Cake.Issues.InspectCode&version=5.1.1
9-
#addin nuget:?package=Cake.Issues.Markdownlint&version=5.1.1
10-
#addin nuget:?package=Cake.Issues.EsLint&version=5.1.1
11-
#addin nuget:?package=Cake.Issues.Sarif&version=5.1.1
12-
#addin nuget:?package=Cake.Issues.Reporting&version=5.1.1
13-
#addin nuget:?package=Cake.Issues.Reporting.Generic&version=5.1.1
14-
#addin nuget:?package=Cake.Issues.Reporting.Sarif&version=5.1.1
15-
#addin nuget:?package=Cake.Issues.Reporting.Console&version=5.1.1
16-
#addin nuget:?package=Cake.Issues.PullRequests&version=5.1.1
17-
#addin nuget:?package=Cake.Issues.PullRequests.AppVeyor&version=5.1.1
18-
#addin nuget:?package=Cake.Issues.PullRequests.AzureDevOps&version=5.1.1
19-
#addin nuget:?package=Cake.Issues.PullRequests.GitHubActions&version=5.1.1
6+
#addin nuget:?package=Cake.Issues&version=5.2.0
7+
#addin nuget:?package=Cake.Issues.MsBuild&version=5.2.0
8+
#addin nuget:?package=Cake.Issues.InspectCode&version=5.2.0
9+
#addin nuget:?package=Cake.Issues.Markdownlint&version=5.2.0
10+
#addin nuget:?package=Cake.Issues.EsLint&version=5.2.0
11+
#addin nuget:?package=Cake.Issues.Sarif&version=5.2.0
12+
#addin nuget:?package=Cake.Issues.Reporting&version=5.2.0
13+
#addin nuget:?package=Cake.Issues.Reporting.Generic&version=5.2.0
14+
#addin nuget:?package=Cake.Issues.Reporting.Sarif&version=5.2.0
15+
#addin nuget:?package=Cake.Issues.Reporting.Console&version=5.2.0
16+
#addin nuget:?package=Cake.Issues.PullRequests&version=5.2.0
17+
#addin nuget:?package=Cake.Issues.PullRequests.AppVeyor&version=5.2.0
18+
#addin nuget:?package=Cake.Issues.PullRequests.AzureDevOps&version=5.2.0
19+
#addin nuget:?package=Cake.Issues.PullRequests.GitHubActions&version=5.2.0
2020
#addin nuget:?package=Cake.AzureDevOps&version=5.0.0

0 commit comments

Comments
 (0)