Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TAP issue provider #930

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ For questions and to discuss ideas & feature requests, use the [GitHub discussio
| [Cake.Issues.InspectCode](https://www.nuget.org/packages/Cake.Issues.InspectCode) | [Cake.Frosting.Issues.InspectCode](https://www.nuget.org/packages/Cake.Frosting.Issues.InspectCode) | Issue provider for reading JetBrains Inspect Code issues. |
| [Cake.Issues.Markdownlint](https://www.nuget.org/packages/Cake.Issues.Markdownlint) | [Cake.Frosting.Issues.Markdownlint](https://www.nuget.org/packages/Cake.Frosting.Issues.Markdownlint) | Issue provider for reading issues from markdownlint. |
| [Cake.Issues.Sarif](https://www.nuget.org/packages/Cake.Issues.Sarif) | [Cake.Frosting.Issues.Sarif](https://www.nuget.org/packages/Cake.Frosting.Issues.Sarif) | Issue provider for reading SARIF reports. |
| [Cake.Issues.Tap](https://www.nuget.org/packages/Cake.Issues.Tap) | [Cake.Frosting.Issues.Tap](https://www.nuget.org/packages/Cake.Frosting.Issues.Tap) | Issue provider for reading files in Test Anything Protocol (TAP) format. |
| [Cake.Issues.Terraform](https://www.nuget.org/packages/Cake.Issues.Terraform) | [Cake.Frosting.Issues.Terraform](https://www.nuget.org/packages/Cake.Frosting.Issues.Terraform) | Issue provider for reading Terraform validation output. |
| [Cake.Issues.PullRequests](https://www.nuget.org/packages/Cake.Issues.PullRequests) | [Cake.Frosting.Issues.PullRequests](https://www.nuget.org/packages/Cake.Frosting.Issues.PullRequests) | Addin providing the aliases for writing issues to pull requests and build servers. |
| [Cake.Issues.PullRequests.AppVeyor](https://www.nuget.org/packages/Cake.Issues.PullRequests.AppVeyor) | [Cake.Frosting.Issues.PullRequests.AppVeyor](https://www.nuget.org/packages/Cake.Frosting.Issues.PullRequests.AppVeyor) | Integration with AppVeyor builds. |
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"Tool","Tool Version","Format","Issue Provider","Supported Since"
"[stylelint](https://stylelint.io/){target='_blank'} :material-alert-decagram:",,"[tap](https://stylelint.io/user-guide/options/#formatter){target='_blank'}","[Cake.Issues.Tap](issue-providers/tap/index.md)",5.1.0
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"Tool","Tool Version","Format","Issue Provider","Supported Since"
"[checkov](https://www.checkov.io/){target='_blank'}",,"[SARIF](https://www.checkov.io/2.Basics/CLI%20Command%20Reference.html){target='_blank'}","[Cake.Issues.Sarif](issue-providers/sarif/index.md)",4.2.0
"[kics](https://kics.io/){target='_blank'}",,"[sarif](https://github.com/Checkmarx/kics/blob/master/docs/results.md#sarif){target='_blank'}","[Cake.Issues.Sarif](issue-providers/sarif/index.md)",4.2.0
"[Kubeconform](https://github.com/yannh/kubeconform){target='_blank'} :material-alert-decagram:",,"[tap](https://github.com/yannh/kubeconform?tab=readme-ov-file#usage){target='_blank'}","[Cake.Issues.Tap](issue-providers/tap/index.md)",4.2.0
"[Trivy](https://trivy.dev/){target='_blank'}",,"[SARIF](https://trivy.dev/v0.58/docs/configuration/reporting/#sarif){target='_blank'}","[Cake.Issues.Sarif](issue-providers/sarif/index.md)",4.2.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"Tool","Tool Version","Format","Issue Provider","Supported Since"
"[textlint](https://textlint.github.io/){target='_blank'} :material-alert-decagram:",,"[tap](https://textlint.github.io/docs/cli.html#options){target='_blank'}","[Cake.Issues.Tap](issue-providers/tap/index.md)",5.1.0
2 changes: 2 additions & 0 deletions docs/input/documentation/issue-providers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Issue provider addins are responsible for providing the output of an analyzer or
- :material-layers-plus: __[Markdownlint]__ – Issue provider for reading issues from markdownlint
- :material-layers-plus: __[MsBuild]__ – Issue provider for reading MsBuild errors and warnings
- :material-layers-plus: __[Sarif]__ – Issue provider for reading SARIF reports
- :material-layers-plus: __[Test Anything Protocol (TAP)]__ – Issue provider for reading TAP reports
- :material-layers-plus: __[Terraform]__ – Issue provider for reading Terraform validation output

</div>
Expand All @@ -25,6 +26,7 @@ Issue provider addins are responsible for providing the output of an analyzer or
[Markdownlint]: markdownlint/index.md
[MsBuild]: msbuild/index.md
[Sarif]: sarif/index.md
[Test Anything Protocol (TAP)]: tap/index.md
[Terraform]: terraform/index.md

!!! tip
Expand Down
117 changes: 117 additions & 0 deletions docs/input/documentation/issue-providers/tap/features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
title: Features
description: Features of the Cake.Issues.Tap addin.
icon: material/creation-outline
---

The [Cake.Issues.Tap addin](https://cakebuild.net/extensions/cake-issues-tap/){target="_blank"} provides the following features.

## Basic features

- [x] Reads issues from files in [Test Anything Protocol (TAP)]{target="_blank"} format version 13 or 14.

## Supported log file formats

!!! note
Details, like file, line / column or rule information, are not standardized in [Test Anything Protocol (TAP)]{target="_blank"}.
The `GenericLogFileFormat` will therefore only return issues containing the description, which might be the file name for some tools.
To retrieve detailed information a tool specific log file format needs to be used which can parse the non-standardized
data provided by the tool for every issue.

- [x] `GenericLogFileFormat` alias for reading issues from any [Test Anything Protocol (TAP)]{target="_blank"} compatible file
- [x] `StylelintLogFileFormat` alias for reading TAP files generated by [stylelint](https://stylelint.io/){target="_blank"}.
- [x] `TextlintLogFileFormat` alias for reading TAP files generated by [Textlint](https://textlint.github.io/){target="_blank"}.

## Supported IIssue properties

=== "GenericLogFileFormat"

<div class="annotate" markdown>

- [x] `IIssue.ProviderType`
- [x] `IIssue.ProviderName`
- [ ] `IIssue.Run` (1)
- [x] `IIssue.Identifier` (2)
- [ ] `IIssue.ProjectName`
- [ ] `IIssue.ProjectFileRelativePath`
- [ ] `IIssue.AffectedFileRelativePath`
- [ ] `IIssue.Line`
- [ ] `IIssue.EndLine`
- [ ] `IIssue.Column`
- [ ] `IIssue.EndColumn`
- [ ] `IIssue.FileLink` (3)
- [x] `IIssue.MessageText`
- [ ] `IIssue.MessageHtml`
- [ ] `IIssue.MessageMarkdown`
- [ ] `IIssue.Priority`
- [ ] `IIssue.PriorityName`
- [ ] `IIssue.RuleId`
- [ ] `IIssue.RuleUrl`

</div>

1. Can be set while reading issues
2. Set to `IIssue.MessageText`
3. Can be set while reading issues

=== "StylelintLogFileFormat"

<div class="annotate" markdown>

- [x] `IIssue.ProviderType`
- [x] `IIssue.ProviderName`
- [ ] `IIssue.Run` (1)
- [x] `IIssue.Identifier` (2)
- [ ] `IIssue.ProjectName`
- [ ] `IIssue.ProjectFileRelativePath`
- [x] `IIssue.AffectedFileRelativePath`
- [x] `IIssue.Line`
- [x] `IIssue.EndLine`
- [x] `IIssue.Column`
- [x] `IIssue.EndColumn`
- [ ] `IIssue.FileLink` (3)
- [x] `IIssue.MessageText`
- [ ] `IIssue.MessageHtml`
- [ ] `IIssue.MessageMarkdown`
- [x] `IIssue.Priority`
- [x] `IIssue.PriorityName`
- [x] `IIssue.RuleId`
- [ ] `IIssue.RuleUrl`

</div>

1. Can be set while reading issues
2. Set to `IIssue.MessageText`
3. Can be set while reading issues

=== "TextlintLogFileFormat"

<div class="annotate" markdown>

- [x] `IIssue.ProviderType`
- [x] `IIssue.ProviderName`
- [ ] `IIssue.Run` (1)
- [x] `IIssue.Identifier` (2)
- [ ] `IIssue.ProjectName`
- [ ] `IIssue.ProjectFileRelativePath`
- [x] `IIssue.AffectedFileRelativePath`
- [x] `IIssue.Line`
- [ ] `IIssue.EndLine`
- [x] `IIssue.Column`
- [ ] `IIssue.EndColumn`
- [ ] `IIssue.FileLink` (3)
- [x] `IIssue.MessageText`
- [ ] `IIssue.MessageHtml`
- [ ] `IIssue.MessageMarkdown`
- [x] `IIssue.Priority`
- [x] `IIssue.PriorityName`
- [x] `IIssue.RuleId`
- [ ] `IIssue.RuleUrl`

</div>

1. Can be set while reading issues
2. Set to `IIssue.MessageText`
3. Can be set while reading issues

[Test Anything Protocol (TAP)]: https://testanything.org/
15 changes: 15 additions & 0 deletions docs/input/documentation/issue-providers/tap/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Test Anything Protocol
description: Issue provider which allows you to read issues from Test Anything Protocol files.
status: new
---

Support for reading issues in [Test Anything Protocol (TAP)](https://testanything.org/){target="_blank"} format
is implemented in the [Cake.Issues.Tap addin](https://cakebuild.net/extensions/cake-issues-tap/){target="_blank"}.

<div class="grid cards" markdown>

- :material-creation-outline: [Features](features.md)
- :material-api: [API](https://cakebuild.net/extensions/cake-issues-tap){target="_blank"}

</div>
8 changes: 8 additions & 0 deletions docs/input/documentation/supported-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ This pages lists tools known to be working with Cake Issues (1)

{{ read_csv('assets/tables/supported-tools-clojure.csv',keep_default_na=False) }}

## CSS, SCSS, Sass

{{ read_csv('assets/tables/supported-tools-css.csv',keep_default_na=False) }}

## Dockerfile

{{ read_csv('assets/tables/supported-tools-docker.csv',keep_default_na=False) }}
Expand Down Expand Up @@ -81,6 +85,10 @@ This pages lists tools known to be working with Cake Issues (1)

{{ read_csv('assets/tables/supported-tools-markdown.csv',keep_default_na=False) }}

## Natural language

{{ read_csv('assets/tables/supported-tools-natural-language.csv',keep_default_na=False) }}

## OpenAPI

{{ read_csv('assets/tables/supported-tools-openapi.csv',keep_default_na=False) }}
Expand Down
4 changes: 4 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ nav:
- documentation/issue-providers/sarif/index.md
- Features: documentation/issue-providers/sarif/features.md
- API: https://cakebuild.net/extensions/cake-issues-sarif" target="_blank
- Test Anything Protocol (TAP):
- documentation/issue-providers/tap/index.md
- Features: documentation/issue-providers/tap/features.md
- API: https://cakebuild.net/extensions/cake-issues-tap" target="_blank
- Terraform:
- documentation/issue-providers/terraform/index.md
- Features: documentation/issue-providers/terraform/features.md
Expand Down
63 changes: 63 additions & 0 deletions nuspec/nuget/Cake.Frosting.Issues.Tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Support for reading TAP compatible files using the Cake.Issues addin for Cake Frosting

> **NOTE**:
> This is the version of the addin compatible with [Cake Frosting].
> For addin compatible with [Cake .NET Tool] see [Cake.Issues.Tap](https://www.nuget.org/packages/Cake.Issues.Tap).

The TAP support for the Cake.Issues addin for Cake allows you to read Test Anything Protocol (TAP) compatible files.

Cake.Issues redefines issue management within the Cake build system by offering a comprehensive, universal, and extensible solution.
The unique capabilities of the addins empower development teams to enforce coding standards, generate insightful reports,
seamlessly incorporate various linting tools, and streamlining the integration with pull requests.
With its [modular architecture] and extensive [set of aliases], Cake.Issues provides a future-proof infrastructure for issue management
in Cake builds, fostering a more efficient and adaptable development process.

For more information and extensive documentation see the [Cake.Issues website](https://cakeissues.net).
For general information about the Cake build automation system see the [Cake website](http://cakebuild.net).

## How to use

Integrating Cake.Issues into your Cake build is straightforward.
With minimal setup, teams can enjoy the benefits of enhanced code quality management seamlessly integrated into their existing build pipeline.

After adding the addin the TAP log file can be parsed:

```csharp
[TaskName("Analyze")]
public sealed class AnalyzeTask : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
{
var logPath = @"c:\build\log.tap";
var repoRootPath = @"c:\repo";

// Read issues.
var issues =
context.ReadIssues(
context.TapIssuesFromFilePath(logPath),
repoRootPath);

context.Information("{0} issues are found.", issues.Count());
}
}
```

## Support & Discussion

For questions and to discuss ideas & feature requests, use the [GitHub discussions on the Cake GitHub repository](https://github.com/cake-build/cake/discussions), under the [Extension Q&A](https://github.com/orgs/cake-build/discussions/categories/extension-q-a) category.

## Contributing

Contributions are welcome. See [Contribution Guidelines](https://github.com/cake-contrib/Cake.Issues/blob/develop/CONTRIBUTING.md).

## License

[MIT License - Copyright © Cake Issues contributors](LICENSE)

Binary distributions for some addins contain third-party code which is licensed under its own respective license.
See [LICENSE](https://github.com/cake-contrib/Cake.Issues/blob/develop/LICENSE) for details.

[modular architecture]: https://cakeissues.net/latest/documentation/how-cake-issues-works/
[set of aliases]: https://cakeissues.net/latest/api/
[Cake Frosting]: https://cakebuild.net/docs/running-builds/runners/cake-frosting
[Cake .NET Tool]: https://cakebuild.net/docs/running-builds/runners/dotnet-tool
58 changes: 58 additions & 0 deletions nuspec/nuget/Cake.Frosting.Issues.Tap.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Cake.Frosting.Issues.Tap</id>
<title>Cake.Frosting.Issues.Tap</title>
<version>0.0.0</version>
<authors>Cake Issues contributors</authors>
<owners>pascalberger, cake-contrib</owners>
<summary>Support for reading TAP compatible files using the Cake.Issues addin for Cake Frosting</summary>
<description>
The TAP support for the Cake.Issues addin for Cake allows you to read Test Anything Protocol (TAP) compatible files.

This addin provides the aliases for reading issues from TAP compatible files and providing them to the Cake.Issues addin.
It also requires the core Cake.Issues addin.

There are also additional addins for generating reports or posting issues to pull requests.

See the Project Site for an overview of the whole ecosystem of addins for working with issues in Cake scripts.

NOTE:
This is the version of the addin compatible with Cake Frosting.
For addin compatible with Cake Script Runners see Cake.Issues.Tap.
</description>
<license type="expression">MIT</license>
<projectUrl>https://cakeissues.net</projectUrl>
<icon>icon.png</icon>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.git"/>
<copyright>Copyright © Cake Issues contributors</copyright>
<tags>cake cake-addin cake-issues cake-issueprovider linting tap</tags>
<readme>docs\README.md</readme>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/5.0.1</releaseNotes>
<dependencies>
<group targetFramework="net8.0">
<dependency id="Cake.Core" version="5.0" exclude="Build,Analyzers" />
<dependency id="Cake.Issues" version="[5.0.0-beta0001,6.0)" exclude="Build,Analyzers" />
<dependency id="YamlDotNet" version="16.3.0" exclude="Build,Analyzers" />
</group>
<group targetFramework="net9.0">
<dependency id="Cake.Core" version="5.0" exclude="Build,Analyzers" />
<dependency id="Cake.Issues" version="[5.0.0-beta0001,6.0)" exclude="Build,Analyzers" />
<dependency id="YamlDotNet" version="16.3.0" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>
<files>
<file src="icon.png" target="" />
<file src="Cake.Frosting.Issues.Tap.targets" target="build" />
<file src="Cake.Frosting.Issues.Tap.targets" target="buildTransitive" />
<file src="Cake.Frosting.Issues.Tap.md" target="docs\README.md" />
<file src="..\..\src\Cake.Issues.Tap\bin\Release\net8.0\Cake.Issues.Tap.dll" target="lib\net8.0" />
<file src="..\..\src\Cake.Issues.Tap\bin\Release\net8.0\Cake.Issues.Tap.pdb" target="lib\net8.0" />
<file src="..\..\src\Cake.Issues.Tap\bin\Release\net8.0\Cake.Issues.Tap.xml" target="lib\net8.0" />
<file src="..\..\src\Cake.Issues.Tap\bin\Release\net9.0\Cake.Issues.Tap.dll" target="lib\net9.0" />
<file src="..\..\src\Cake.Issues.Tap\bin\Release\net9.0\Cake.Issues.Tap.pdb" target="lib\net9.0" />
<file src="..\..\src\Cake.Issues.Tap\bin\Release\net9.0\Cake.Issues.Tap.xml" target="lib\net9.0" />
</files>
</package>
5 changes: 5 additions & 0 deletions nuspec/nuget/Cake.Frosting.Issues.Tap.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project>
<ItemGroup Condition="'$(Language)' == 'C#' AND ('$(ImplicitUsings)' == 'true' or '$(ImplicitUsings)' == 'enable')">
<Using Include="Cake.Issues.Tap" />
</ItemGroup>
</Project>
59 changes: 59 additions & 0 deletions nuspec/nuget/Cake.Issues.Tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Support for reading TAP compatible files using the Cake.Issues addin for Cake Build Automation System

> **NOTE**:
> This is the version of the addin compatible with [Cake .NET Tool].
> For addin compatible with [Cake Frosting] see [Cake.Frosting.Issues.Tap](https://www.nuget.org/packages/Cake.Frosting.Issues.Tap).

The TAP support for the Cake.Issues addin for Cake allows you to read Test Anything Protocol (TAP) compatible files.

Cake.Issues redefines issue management within the Cake build system by offering a comprehensive, universal, and extensible solution.
The unique capabilities of the addins empower development teams to enforce coding standards, generate insightful reports,
seamlessly incorporate various linting tools, and streamlining the integration with pull requests.
With its [modular architecture] and extensive [set of aliases], Cake.Issues provides a future-proof infrastructure for issue management
in Cake builds, fostering a more efficient and adaptable development process.

For more information and extensive documentation see the [Cake.Issues website](https://cakeissues.net).
For general information about the Cake build automation system see the [Cake website](http://cakebuild.net).

## How to use

Integrating Cake.Issues into your Cake build is straightforward.
With minimal setup, teams can enjoy the benefits of enhanced code quality management seamlessly integrated into their existing build pipeline.

After adding the addin the TAP log file can be parsed:

```csharp
Task("Analyze").Does(() =>
{
var logPath = @"c:\build\log.tap";
var repoRootPath = @"c:\repo";

// Read issues.
var issues =
ReadIssues(
TapIssuesFromFilePath(logPath),
repoRootPath);

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

## Support & Discussion

For questions and to discuss ideas & feature requests, use the [GitHub discussions on the Cake GitHub repository](https://github.com/cake-build/cake/discussions), under the [Extension Q&A](https://github.com/orgs/cake-build/discussions/categories/extension-q-a) category.

## Contributing

Contributions are welcome. See [Contribution Guidelines](https://github.com/cake-contrib/Cake.Issues/blob/develop/CONTRIBUTING.md).

## License

[MIT License - Copyright © Cake Issues contributors](LICENSE)

Binary distributions for some addins contain third-party code which is licensed under its own respective license.
See [LICENSE](https://github.com/cake-contrib/Cake.Issues/blob/develop/LICENSE) for details.

[modular architecture]: https://cakeissues.net/docs/fundamentals/architecture
[set of aliases]: https://cakeissues.net/dsl/
[Cake Frosting]: https://cakebuild.net/docs/running-builds/runners/cake-frosting
[Cake .NET Tool]: https://cakebuild.net/docs/running-builds/runners/dotnet-tool
Loading
Loading