Skip to content

Commit

Permalink
Merge branch 'release/4.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Jul 25, 2024
2 parents a1c807f + 9df540e commit 1f21bfd
Show file tree
Hide file tree
Showing 12 changed files with 139 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<ItemGroup>
<PackageReference Include="Cake.Frosting" Version="4.0.0" />
<PackageReference Include="Cake.Issues.Testing" Version="4.8.1" />
<PackageReference Include="Cake.Issues.Testing" Version="4.9.0" />
<PackageReference Include="Cake.Testing" Version="4.0.0" />
<PackageReference Include="Cake.Testing.Xunit" Version="4.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,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/4.8.1</PackageReleaseNotes>
<PackageReleaseNotes>https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/4.9.0</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand All @@ -42,19 +42,20 @@ For recipe compatible with Cake Script Runners see Cake.Issues.Recipe.</Descript
<PackageReference Include="Cake.AzureDevOps" Version="4.0.0" />
<PackageReference Include="Cake.Frosting" Version="4.0.0" PrivateAssets="All" />
<PackageReference Include="Cake.Frosting.Git" Version="4.0.0" />
<PackageReference Include="Cake.Issues" Version="4.8.1" />
<PackageReference Include="Cake.Frosting.Issues.EsLint" Version="4.8.1" />
<PackageReference Include="Cake.Frosting.Issues.InspectCode" Version="4.8.1" />
<PackageReference Include="Cake.Frosting.Issues.Markdownlint" Version="4.8.1" />
<PackageReference Include="Cake.Frosting.Issues.MsBuild" Version="4.8.1" />
<PackageReference Include="Cake.Frosting.Issues.PullRequests" Version="4.8.1" />
<PackageReference Include="Cake.Frosting.Issues.PullRequests.AppVeyor" Version="4.8.1" />
<PackageReference Include="Cake.Frosting.Issues.PullRequests.AzureDevOps" Version="4.8.1" />
<PackageReference Include="Cake.Frosting.Issues.PullRequests.GitHubActions" Version="4.8.1" />
<PackageReference Include="Cake.Frosting.Issues.Reporting" Version="4.8.1" />
<PackageReference Include="Cake.Frosting.Issues.Reporting.Sarif" Version="4.8.1" />
<PackageReference Include="Cake.Frosting.Issues.Reporting.Generic" Version="4.8.1" />
<PackageReference Include="Cake.Frosting.Issues.Reporting.Console" Version="4.8.1" />
<PackageReference Include="Cake.Issues" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.EsLint" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.InspectCode" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.Markdownlint" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.MsBuild" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.Sarif" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.PullRequests" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.PullRequests.AppVeyor" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.PullRequests.AzureDevOps" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.PullRequests.GitHubActions" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.Reporting" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.Reporting.Sarif" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.Reporting.Generic" Version="4.9.0" />
<PackageReference Include="Cake.Frosting.Issues.Reporting.Console" Version="4.9.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public interface IIssuesParametersInputFiles
/// </summary>
IDictionary<FilePath, IReadIssuesSettings> EsLintJsonLogFilePaths { get; }

/// <summary>
/// Gets list of registered paths to SARIF log files.
/// </summary>
IDictionary<FilePath, IReadIssuesSettings> SarifLogFilePaths { get; }

/// <summary>
/// Adds a path to a MSBuild log file created by XmlFileLogger.
/// </summary>
Expand Down Expand Up @@ -132,5 +137,18 @@ public interface IIssuesParametersInputFiles
/// <param name="logfilePath">Path to the ESLint log file.</param>
/// <param name="settings">Settings for reading the log file. <c>Null</c> for default values.</param>
void AddEsLintJsonLogFile(FilePath logfilePath, IReadIssuesSettings settings);

/// <summary>
/// Adds a path to a log file in SARIF format.
/// </summary>
/// <param name="logfilePath">Path to the SARIF log file.</param>
void AddSarifLogFile(FilePath logfilePath);

/// <summary>
/// Adds a path to a log file in SARIF format.
/// </summary>
/// <param name="logfilePath">Path to the SARIF log file.</param>
/// <param name="settings">Settings for reading the log file. <c>Null</c> for default values.</param>
void AddSarifLogFile(FilePath logfilePath, IReadIssuesSettings settings);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public class IssuesParametersInputFiles : IIssuesParametersInputFiles
/// <inheritdoc />
public IDictionary<FilePath, IReadIssuesSettings> EsLintJsonLogFilePaths { get; } = new Dictionary<FilePath, IReadIssuesSettings>();

/// <inheritdoc />
public IDictionary<FilePath, IReadIssuesSettings> SarifLogFilePaths { get; } = new Dictionary<FilePath, IReadIssuesSettings>();

/// <inheritdoc />
public void AddMsBuildXmlFileLoggerLogFile(FilePath logfilePath)
{
Expand Down Expand Up @@ -140,5 +143,21 @@ public void AddEsLintJsonLogFile(FilePath logfilePath, IReadIssuesSettings setti

this.EsLintJsonLogFilePaths.Add(logfilePath, settings);
}

/// <inheritdoc />
public void AddSarifLogFile(FilePath logfilePath)
{
logfilePath.NotNull(nameof(logfilePath));

this.AddSarifLogFile(logfilePath, null);
}

/// <inheritdoc />
public void AddSarifLogFile(FilePath logfilePath, IReadIssuesSettings settings)
{
logfilePath.NotNull(nameof(logfilePath));

this.SarifLogFilePaths.Add(logfilePath, settings);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ public override void Run(IIssuesContext context)
logFile.Value);
}

// Read SARIF log files.
foreach (var logFile in context.Parameters.InputFiles.SarifLogFilePaths)
{
context.State.AddIssues(
context.SarifIssues(
new SarifIssuesSettings(logFile.Key)
{
// Since there might be multiple SARIF log files we need to have a predictable
// issue provider name for reporting pull request states.
UseToolNameAsIssueProviderName = false
}),
logFile.Value);
}

context.Information("{0} issues are found.", context.State.Issues.Count());
}
}
Expand Down
27 changes: 14 additions & 13 deletions Cake.Issues.Recipe/Content/addins.cake
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
///////////////////////////////////////////////////////////////////////////////

#addin nuget:?package=Cake.Git&version=4.0.0
#addin nuget:?package=Cake.Issues&version=4.8.1
#addin nuget:?package=Cake.Issues.MsBuild&version=4.8.1
#addin nuget:?package=Cake.Issues.InspectCode&version=4.8.1
#addin nuget:?package=Cake.Issues.Markdownlint&version=4.8.1
#addin nuget:?package=Cake.Issues.EsLint&version=4.8.1
#addin nuget:?package=Cake.Issues.Reporting&version=4.8.1
#addin nuget:?package=Cake.Issues.Reporting.Generic&version=4.8.1
#addin nuget:?package=Cake.Issues.Reporting.Sarif&version=4.8.1
#addin nuget:?package=Cake.Issues.Reporting.Console&version=4.8.1
#addin nuget:?package=Cake.Issues.PullRequests&version=4.8.1
#addin nuget:?package=Cake.Issues.PullRequests.AppVeyor&version=4.8.1
#addin nuget:?package=Cake.Issues.PullRequests.AzureDevOps&version=4.8.1
#addin nuget:?package=Cake.Issues.PullRequests.GitHubActions&version=4.8.1
#addin nuget:?package=Cake.Issues&version=4.9.0
#addin nuget:?package=Cake.Issues.MsBuild&version=4.9.0
#addin nuget:?package=Cake.Issues.InspectCode&version=4.9.0
#addin nuget:?package=Cake.Issues.Markdownlint&version=4.9.0
#addin nuget:?package=Cake.Issues.EsLint&version=4.9.0
#addin nuget:?package=Cake.Issues.Sarif&version=4.9.0
#addin nuget:?package=Cake.Issues.Reporting&version=4.9.0
#addin nuget:?package=Cake.Issues.Reporting.Generic&version=4.9.0
#addin nuget:?package=Cake.Issues.Reporting.Sarif&version=4.9.0
#addin nuget:?package=Cake.Issues.Reporting.Console&version=4.9.0
#addin nuget:?package=Cake.Issues.PullRequests&version=4.9.0
#addin nuget:?package=Cake.Issues.PullRequests.AppVeyor&version=4.9.0
#addin nuget:?package=Cake.Issues.PullRequests.AzureDevOps&version=4.9.0
#addin nuget:?package=Cake.Issues.PullRequests.GitHubActions&version=4.9.0
#addin nuget:?package=Cake.AzureDevOps&version=4.0.0
14 changes: 14 additions & 0 deletions Cake.Issues.Recipe/Content/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@ IssuesBuildTasks.ReadIssuesTask = Task("Read-Issues")
logFile.Value);
}

// Read SARIF log files.
foreach (var logFile in IssuesParameters.InputFiles.SarifLogFilePaths)
{
data.AddIssues(
SarifIssues(
new SarifIssuesSettings(logFile.Key)
{
// Since there might be multiple SARIF log files we need to have a predictable
// issue provider name for reporting pull request states.
UseToolNameAsIssueProviderName = false
}),
logFile.Value);
}

Information("{0} issues are found.", data.Issues.Count());
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public class IssuesParametersInputFiles
/// </summary>
public IDictionary<FilePath, IReadIssuesSettings> EsLintJsonLogFilePaths { get; } = new Dictionary<FilePath, IReadIssuesSettings>();

/// <summary>
/// Gets list of registered paths to SARIF log files.
/// </summary>
public IDictionary<FilePath, IReadIssuesSettings> SarifLogFilePaths { get; } = new Dictionary<FilePath, IReadIssuesSettings>();

/// <summary>
/// Adds a path to a MSBuild log file created by XmlFileLogger.
/// </summary>
Expand Down Expand Up @@ -184,4 +189,24 @@ public class IssuesParametersInputFiles
logfilePath.NotNull(nameof(logfilePath));
this.EsLintJsonLogFilePaths.Add(logfilePath, settings);
}

/// <summary>
/// Adds a path to a log file in SARIF format.
/// </summary>
/// <param name="logfilePath">Path to the SARIF log file.</param>
public void AddSarifLogFile(FilePath logfilePath)
{
logfilePath.NotNull(nameof(logfilePath));
this.AddSarifLogFile(logfilePath, null);
}
/// <summary>
/// Adds a path to a log file in SARIF format.
/// </summary>
/// <param name="logfilePath">Path to the SARIF log file.</param>
/// <param name="settings">Settings for reading the log file. <c>Null</c> for default values.</param>
public void AddSarifLogFile(FilePath logfilePath, IReadIssuesSettings settings)
{
logfilePath.NotNull(nameof(logfilePath));
this.SarifLogFilePaths.Add(logfilePath, settings);
}
}
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ By default [Cake.Git addin] will be used.
| `IssuesParameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddMarkdownlintCliJsonLogFile()` | `IssuesContext.Parameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddMarkdownlintCliJsonLogFile()` | Adds a path to a markdownlint-cli log file writting with `--json`. |
| `IssuesParameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddMarkdownlintV1LogFile()` | `IssuesContext.Parameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddMarkdownlintV1LogFile()` | Adds a path to a markdownlint log file in version 1. |
| `IssuesParameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddEsLintJsonLogFile()` | `IssuesContext.Parameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddEsLintJsonLogFile()` | Adds a path to a ESLint log file generated by the [ESLint json formatter]. |
| `IssuesParameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddSarifLogFile()` | `IssuesContext.Parameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddSarifLogFile()` | Adds a path to a SARIF log file. |

[ESLint json formatter]: https://eslint.org/docs/user-guide/formatters/#json

Expand Down
27 changes: 15 additions & 12 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,19 @@ Cake.Issues recipes will add the following addins to your build:
| Addin Cake.Issues.Recipe | Addin.Frosting.Issues.Recipe | Remarks |
|---------------------------------------------------------|---------------------------------------------------------|-|
| [Cake.Git] 4.0.0 | [Cake.Frosting.Git] 4.0.0 | Only used if `RepositoryInfoProvider` type is set to `RepositoryInfoProviderType.CakeGit`. See [Git repository information configuration] for details. |
| [Cake.Issues] 4.8.1 | [Cake.Issues] 4.8.1 | |
| [Cake.Issues.MsBuild] 4.8.1 | [Cake.Frosting.Issues.MsBuild] 4.8.1 | |
| [Cake.Issues.InspectCode] 4.8.1 | [Cake.Frosting.Issues.InspectCode] 4.8.1 | |
| [Cake.Issues.Markdownlint] 4.8.1 | [Cake.Frosting.Issues.Markdownlint] 4.8.1 | |
| [Cake.Issues.EsLint] 4.8.1 | [Cake.Frosting.Issues.EsLint] 4.8.1 | |
| [Cake.Issues.Reporting] 4.8.1 | [Cake.Frosting.Issues.Reporting] 4.8.1 | |
| [Cake.Issues.Reporting.Generic] 4.8.1 | [Cake.Frosting.Issues.Reporting.Generic] 4.8.1 | |
| [Cake.Issues.Reporting.Sarif] 4.8.1 | [Cake.Frosting.Issues.Reporting.Sarif] 4.8.1 | |
| [Cake.Issues.PullRequests] 4.8.1 | [Cake.Frosting.Issues.PullRequests] 4.8.1 | |
| [Cake.Issues.PullRequests.AppVeyor] 4.8.1 | [Cake.Frosting.Issues.PullRequests.AppVeyor] 4.8.1 | |
| [Cake.Issues.PullRequests.AzureDevOps] 4.8.1 | [Cake.Frosting.Issues.PullRequests.AzureDevOps] 4.8.1 | |
| [Cake.Issues.PullRequests.GitHubActions] 4.8.1 | [Cake.Frosting.Issues.PullRequests.GitHubActions] 4.8.1 | |
| [Cake.Issues] 4.9.0 | [Cake.Issues] 4.9.0 | |
| [Cake.Issues.MsBuild] 4.9.0 | [Cake.Frosting.Issues.MsBuild] 4.9.0 | |
| [Cake.Issues.InspectCode] 4.9.0 | [Cake.Frosting.Issues.InspectCode] 4.9.0 | |
| [Cake.Issues.Markdownlint] 4.9.0 | [Cake.Frosting.Issues.Markdownlint] 4.9.0 | |
| [Cake.Issues.EsLint] 4.9.0 | [Cake.Frosting.Issues.EsLint] 4.9.0 | |
| [Cake.Issues.Sarif] 4.9.0 | [Cake.Frosting.Issues.Sarif] 4.9.0 | |
| [Cake.Issues.Reporting] 4.9.0 | [Cake.Frosting.Issues.Reporting] 4.9.0 | |
| [Cake.Issues.Reporting.Generic] 4.9.0 | [Cake.Frosting.Issues.Reporting.Generic] 4.9.0 | |
| [Cake.Issues.Reporting.Sarif] 4.9.0 | [Cake.Frosting.Issues.Reporting.Sarif] 4.9.0 | |
| [Cake.Issues.PullRequests] 4.9.0 | [Cake.Frosting.Issues.PullRequests] 4.9.0 | |
| [Cake.Issues.PullRequests.AppVeyor] 4.9.0 | [Cake.Frosting.Issues.PullRequests.AppVeyor] 4.9.0 | |
| [Cake.Issues.PullRequests.AzureDevOps] 4.9.0 | [Cake.Frosting.Issues.PullRequests.AzureDevOps] 4.9.0 | |
| [Cake.Issues.PullRequests.GitHubActions] 4.9.0 | [Cake.Frosting.Issues.PullRequests.GitHubActions] 4.9.0 | |
| [Cake.AzureDevOps] 4.0.0 | [Cake.AzureDevOps] 4.0.0 | |

[Cake.Issues.Recipe]: https://www.nuget.org/packages/Cake.Issues.Recipe
Expand All @@ -58,6 +59,8 @@ Cake.Issues recipes will add the following addins to your build:
[Cake.Frosting.Issues.Markdownlint]: https://cakebuild.net/extensions/cake-issues-markdownlint/
[Cake.Issues.EsLint]: https://cakebuild.net/extensions/cake-issues-eslint/
[Cake.Frosting.Issues.EsLint]: https://cakebuild.net/extensions/cake-issues-eslint/
[Cake.Issues.Sarif]: https://cakebuild.net/extensions/cake-issues-sarif/
[Cake.Frosting.Issues.Sarif]: https://cakebuild.net/extensions/cake-issues-sarif/
[Cake.Issues.Reporting]: https://cakebuild.net/extensions/cake-issues-reporting/
[Cake.Frosting.Issues.Reporting]: https://cakebuild.net/extensions/cake-issues-reporting/
[Cake.Issues.Reporting.Generic]: https://cakebuild.net/extensions/cake-issues-reporting-generic/
Expand Down
2 changes: 2 additions & 0 deletions docs/supported-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ Cake.Issues recipes support reading issues from output of the following tools:
| markdownlint | [markdownlint-cli] with `--json` | `IssuesParameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddMarkdownlintCliJsonLogFile()` | `IssuesContext.Parameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddMarkdownlintCliJsonLogFile()` |
| markdownlint | [markdownlint] version 1 | `IssuesParameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddMarkdownlintV1LogFile()` | `IssuesContext.Parameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddMarkdownlintV1LogFile()` |
| [ESLint] | [json formatter] | `IssuesParameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddEsLintJsonLogFile()` | `IssuesContext.Parameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddEsLintJsonLogFile()` |
| Any SARIF compatible tool | [SARIF] | `IssuesParameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddSarifLogFile()` | `IssuesContext.Parameters.InputFiles.`<br/>&nbsp;&nbsp;&nbsp;&nbsp;`AddSarifLogFile()` |

[MSBuild Extension Pack XmlFileLogger]: http://www.msbuildextensionpack.com/help/4.0.5.0/html/242ab4fd-c2e2-f6aa-325b-7588725aed24.htm
[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli
[markdownlint]: https://github.com/DavidAnson/markdownlint
[ESLint]: https://eslint.org/
[json formatter]: https://eslint.org/docs/user-guide/formatters/#json
[SARIF]: https://sarifweb.azurewebsites.net/

# Build systems

Expand Down
2 changes: 1 addition & 1 deletion nuspec/nuget/Cake.Issues.Recipe.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ For recipe compatible with Cake Frosting see Cake.Frosting.Issues.Recipe.
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.Recipe.git"/>
<copyright>Copyright © Pascal Berger</copyright>
<tags>cake cake-recipe cake-issues</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/4.8.1</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/4.9.0</releaseNotes>
</metadata>
<files>
<file src="icon.png" target="" />
Expand Down

0 comments on commit 1f21bfd

Please sign in to comment.