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

Use new Java 17 based API of analysis-model #1917

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
22 changes: 12 additions & 10 deletions plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-pom</artifactId>
<version>9.0.0</version>
<version>10.0.0</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -38,16 +38,16 @@
<scm>
<connection>scm:git:https://github.com/jenkinsci/${project.artifactId}-plugin.git</connection>
<developerConnection>scm:git:[email protected]:jenkinsci/${project.artifactId}-plugin.git</developerConnection>
<tag>v11.10.0</tag>
<tag>HEAD</tag>
<url>https://github.com/jenkinsci/${project.artifactId}-plugin</url>
</scm>

<properties>
<revision>11.13.0</revision>
<revision>12.0.0</revision>
<changelist>-SNAPSHOT</changelist>
<module.name>${project.groupId}.warnings.ng</module.name>

<analysis-model-api.version>12.9.1</analysis-model-api.version>
<analysis-model-api.version>13.0.0-SNAPSHOT</analysis-model-api.version>
<analysis-model-tests.version>${analysis-model-api.version}</analysis-model-tests.version>
<pull-request-monitoring.version>335.v525cd64ec76b_</pull-request-monitoring.version>

Expand All @@ -73,6 +73,12 @@

<dependencies>

<!-- Temporary -->
<dependency>
<groupId>edu.hm.hafner</groupId>
<artifactId>analysis-model</artifactId>
<version>${analysis-model-api.version}</version>
</dependency>
<!-- Project Library Dependencies -->
<dependency>
<groupId>org.eclipse.collections</groupId>
Expand All @@ -91,15 +97,10 @@
</dependency>

<!-- Required Jenkins Plug-in Dependencies -->
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>analysis-model-api</artifactId>
<version>${analysis-model-api.version}</version>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>plugin-util-api</artifactId>
<version>5.1.0</version>
<version>6.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
Expand Down Expand Up @@ -578,6 +579,7 @@
<excludes combine.children="append">
<exclude>.*Thresholds</exclude>
<exclude>.*Test.*</exclude>
<exclude>.*Benchmark.*</exclude>
<exclude>.*TaskScanner.*</exclude>
</excludes>
<entryPointClassPackage>io.jenkins.plugins.analysis.core.assertions</entryPointClassPackage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public IssuesTotalColumn() {
}

/**
* Called after de-serialization to retain backward compatibility..
* Called after deserialization to retain backward compatibility..
*
* @return this
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public IssueReportScanner(final String filePattern, final String encoding,
@Override
protected Optional<Report> processFile(final Path file, final Charset charset, final FilteredLog log) {
try {
Report fileReport = parser.parseFile(new FileReaderFactory(file, charset));
Report fileReport = parser.parse(new FileReaderFactory(file, charset));

log.logInfo("Successfully parsed file %s", file);
log.logInfo("-> found %s (skipped %s)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public ResultAction(final Run<?, ?> owner, final AnalysisResult result, final He
}

/**
* Called after de-serialization to retain backward compatibility.
* Called after deserialization to retain backward compatibility.
*
* @return this
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

import edu.hm.hafner.analysis.Issue;
import edu.hm.hafner.analysis.Report;
import edu.hm.hafner.analysis.registry.ParserDescriptor;
import edu.hm.hafner.analysis.registry.ParserDescriptor.Type;
import edu.hm.hafner.analysis.Report.IssueType;
import edu.hm.hafner.util.Generated;
import edu.hm.hafner.util.VisibleForTesting;
import edu.umd.cs.findbugs.annotations.CheckForNull;
Expand Down Expand Up @@ -75,7 +74,7 @@ public StaticAnalysisLabelProvider(final String id, @CheckForNull final String n
*/
public StaticAnalysisLabelProvider(final String id, @CheckForNull final String name,
final DescriptionProvider descriptionProvider) {
this(id, name, descriptionProvider, Type.WARNING);
this(id, name, descriptionProvider, IssueType.WARNING);
}

/**
Expand All @@ -91,15 +90,15 @@ public StaticAnalysisLabelProvider(final String id, @CheckForNull final String n
* the type of the parser
*/
public StaticAnalysisLabelProvider(final String id, @CheckForNull final String name,
final DescriptionProvider descriptionProvider, final ParserDescriptor.Type type) {
final DescriptionProvider descriptionProvider, final IssueType type) {
this.id = id;
this.descriptionProvider = descriptionProvider;
this.icon = getIcon(type);

changeName(name);
}

private String getIcon(final ParserDescriptor.Type type) {
private String getIcon(final IssueType type) {
switch (type) {
case BUG:
return "symbol-solid/bug plugin-font-awesome-api";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void setJenkinsFacade(final JenkinsFacade jenkinsFacade) {
}

/**
* Called after de-serialization to retain backward compatibility.
* Called after deserialization to retain backward compatibility.
*
* @return this
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ public Descriptor() {
super(ID);
}

@Override
public boolean canScanConsoleLog() {
return false;
}

@Override
public StaticAnalysisLabelProvider getLabelProvider() {
return new SvgIconLabelProvider(getId(), getName(), getDescriptionProvider());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void setIgnoreSuppressedOrJustified(final boolean ignoreSuppressedOrJusti
}

/**
* Called after de-serialization to retain backward compatibility.
* Called after deserialization to retain backward compatibility.
*
* @return this
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DynamicDocumentParser extends IssueParser {

@Override
@SuppressWarnings("PMD.DoNotUseThreads")
public Report parse(final ReaderFactory reader) throws ParsingException {
public Report parseReport(final ReaderFactory reader) throws ParsingException {
Report report = new Report();
Matcher matcher = pattern.matcher(reader.readString() + "\n");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class DynamicLineParser extends LookaheadParser {
}

@Override
public Report parse(final ReaderFactory reader) throws ParsingException {
public Report parseReport(final ReaderFactory reader) throws ParsingException {
fileName = reader.getFileName();
return super.parse(reader);

return super.parseReport(reader);
}

@Override
Expand Down
Loading