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

Reporter API enhancements #8910

Merged
merged 3 commits into from
Jul 19, 2024
Merged

Reporter API enhancements #8910

merged 3 commits into from
Jul 19, 2024

Conversation

sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

@sschuberth sschuberth requested a review from a team as a code owner July 18, 2024 15:59
@sschuberth sschuberth enabled auto-merge (rebase) July 18, 2024 15:59
Remove these custom extension functions in favor of standard
functionality. The resulting code is a bit longer, but makes more clear
what the default value is.

Signed-off-by: Sebastian Schuberth <[email protected]>
As of 78fb986 `FileFormat` only has `JSON` and `YAML` entries, so the
`when` clause is exhausitve and the `else` branch can be removed.

Signed-off-by: Sebastian Schuberth <[email protected]>
@sschuberth sschuberth force-pushed the reporter-api branch 3 times, most recently from 0bac376 to 72806d0 Compare July 18, 2024 16:07
@@ -43,32 +43,30 @@

override val type = "EvaluatedModel"

override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> {
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> {

Check warning

Code scanning / detekt

Format signature to be single when possible, multiple lines otherwise. Warning

Newline expected after opening parenthesis
@@ -43,32 +43,30 @@

override val type = "EvaluatedModel"

override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> {
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> {

Check warning

Code scanning / detekt

Format signature to be single when possible, multiple lines otherwise. Warning

Parameter should start on a newline
@@ -43,32 +43,30 @@

override val type = "EvaluatedModel"

override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> {
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> {

Check warning

Code scanning / detekt

Format signature to be single when possible, multiple lines otherwise. Warning

Parameter should start on a newline
@@ -43,32 +43,30 @@

override val type = "EvaluatedModel"

override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> {
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> {

Check warning

Code scanning / detekt

Format signature to be single when possible, multiple lines otherwise. Warning

Newline expected before closing parenthesis
@@ -43,32 +43,30 @@

override val type = "EvaluatedModel"

override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> {
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> {

Check warning

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Warning

Line detected, which is longer than the defined maximum line length in the code style.
@@ -36,7 +36,7 @@

override val type = "FossIdSnippet"

override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> {
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> {

Check warning

Code scanning / detekt

Format signature to be single when possible, multiple lines otherwise. Warning

Newline expected after opening parenthesis
@@ -36,7 +36,7 @@

override val type = "FossIdSnippet"

override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> {
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> {

Check warning

Code scanning / detekt

Format signature to be single when possible, multiple lines otherwise. Warning

Parameter should start on a newline
@@ -36,7 +36,7 @@

override val type = "FossIdSnippet"

override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> {
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> {

Check warning

Code scanning / detekt

Format signature to be single when possible, multiple lines otherwise. Warning

Parameter should start on a newline
@@ -36,7 +36,7 @@

override val type = "FossIdSnippet"

override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> {
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> {

Check warning

Code scanning / detekt

Format signature to be single when possible, multiple lines otherwise. Warning

Newline expected before closing parenthesis
@@ -36,7 +36,7 @@

override val type = "FossIdSnippet"

override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<File> {
override fun generateReport(input: ReporterInput, outputDir: File, config: PluginConfiguration): List<Result<File>> {

Check warning

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style. Warning

Line detected, which is longer than the defined maximum line length in the code style.
@sschuberth sschuberth force-pushed the reporter-api branch 2 times, most recently from 8591cf5 to 7989e35 Compare July 18, 2024 16:18
Copy link

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.63%. Comparing base (f4aa253) to head (d851cc9).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8910   +/-   ##
=========================================
  Coverage     67.63%   67.63%           
  Complexity     1168     1168           
=========================================
  Files           244      244           
  Lines          7781     7781           
  Branches        867      867           
=========================================
  Hits           5263     5263           
  Misses         2161     2161           
  Partials        357      357           
Flag Coverage Δ
funTest-docker 67.39% <ø> (ø)
funTest-non-docker 33.90% <ø> (ø)
test 37.91% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Instead of an all-or-nothing approach with throwing an exception, allow
per-file-format results for reporters to signal that e.g. writing a JSON
format succeeded while writing an XML format for the same reporter failed.

This fixes the issue introduced in 5503c68 for the CycloneDX reporter to
not cause a non-0 exit code anymore for the reporter CLI if one of the
file formats failed to be created.

Signed-off-by: Sebastian Schuberth <[email protected]>
@sschuberth sschuberth merged commit 506ef31 into main Jul 19, 2024
22 checks passed
@sschuberth sschuberth deleted the reporter-api branch July 19, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants