-
Notifications
You must be signed in to change notification settings - Fork 275
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
Adding Yocto Scanner support. #1824
Merged
uhafner
merged 1 commit into
jenkinsci:main
from
panicking:feature/add-yocto-cve-parser
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
plugin/src/main/java/io/jenkins/plugins/analysis/warnings/YoctoScanner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package io.jenkins.plugins.analysis.warnings; | ||
|
||
import org.kohsuke.stapler.DataBoundConstructor; | ||
import org.jenkinsci.Symbol; | ||
import hudson.Extension; | ||
|
||
import io.jenkins.plugins.analysis.core.model.AnalysisModelParser; | ||
import io.jenkins.plugins.analysis.core.model.StaticAnalysisLabelProvider; | ||
import io.jenkins.plugins.analysis.core.model.SymbolIconLabelProvider; | ||
|
||
/** | ||
* Provides a parser and customized messages for Yocto Scanner CLI (scannercli) reports. | ||
* | ||
* @author Michael Trimarchi | ||
*/ | ||
public class YoctoScanner extends AnalysisModelParser { | ||
private static final long serialVersionUID = 1L; | ||
private static final String ID = "yoctocli"; | ||
|
||
/** | ||
* Creates a new instance of {@link YoctoScanner}. | ||
*/ | ||
@DataBoundConstructor | ||
public YoctoScanner() { | ||
super(); | ||
// empty constructor required for stapler | ||
} | ||
|
||
/** Descriptor for this static analysis tool. */ | ||
@Symbol("yoctoScanner") | ||
@Extension | ||
public static class Descriptor extends AnalysisModelParserDescriptor { | ||
/** Creates the descriptor instance. */ | ||
public Descriptor() { | ||
super(ID); | ||
} | ||
|
||
@Override | ||
public boolean canScanConsoleLog() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isPostProcessingEnabled() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public StaticAnalysisLabelProvider getLabelProvider() { | ||
return new SymbolIconLabelProvider(getId(), getDisplayName(), getDescriptionProvider(), "symbol-solid/shield-halved plugin-font-awesome-api"); | ||
} | ||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about adding another icon? The default warning icon might be inappropriate for security warnings?
We can select from: https://fontawesome.com/icons/categories/security or https://ionic.io/ionicons
Example code to change the icon: https://github.com/jenkinsci/warnings-ng-plugin/blob/main/plugin/src/main/java/io/jenkins/plugins/analysis/warnings/ErrorProne.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This for the pom
how icon are loaded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Icons are part of a different plug-in and are referenced in the UI.
The bug is used for bug finders so you better should use a different one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://fontawesome.com/icons/shield-exclamation?f=sharp&s=solid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is not available. You need to choose a free one, there is a checkbox
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://fontawesome.com/icons/shield-halved?f=classic&s=solid
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uhafner Add the icon and tested, include the pom.xml change