Skip to content

Commit

Permalink
Refresh plugin for February 2025
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Feb 10, 2025
1 parent b60af52 commit 8198262
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 159 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @jenkinsci/allure-plugin-developers
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
java-version: 21
cache: 'maven'
- name: "Build"
run: ./mvnw package
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'
cache: 'maven'
server-id: maven.jenkins-ci.org
server-username: JENKINS_USERNAME
Expand All @@ -22,4 +22,4 @@ jobs:
./mvnw deploy
env:
JENKINS_USERNAME: ${{ secrets.JENKINS_USERNAME }}
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.6</version>
<version>1.8</version>
</extension>
</extensions>
4 changes: 1 addition & 3 deletions .mvn/quality-configs/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
<!-- Filters (http://checkstyle.sourceforge.net/config_filters.html) -->
<module name="SuppressWarningsFilter"/>

<module name="NewlineAtEndOfFile">
<property name="lineSeparator" value="lf"/>
</module>
<module name="NewlineAtEndOfFile"/>
<!-- disabled in favour of PMD ExcessiveClassLength check, which correctly checks class length not file length -->
<!--<module name="FileLength">-->
<!--<property name="max" value="500"/>-->
Expand Down
11 changes: 11 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
See the documentation for more options:
https://github.com/jenkins-infra/pipeline-library/
*/
buildPlugin(
forkCount: '1C', // run this number of tests in parallel for faster feedback. If the number terminates with a 'C', the value will be multiplied by the number of available CPU cores
useContainerAgent: true, // Set to `false` if you need to use Docker for containerized tests
configurations: [
[platform: 'linux', jdk: 21],
[platform: 'windows', jdk: 17],
])
44 changes: 11 additions & 33 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.74</version>
<version>5.7</version>
<relativePath />
</parent>

Expand All @@ -21,9 +21,10 @@
<revision>2.31.0.11</revision>
<changelist>-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/allure-plugin</gitHubRepo>
<jenkins.version>2.387.3</jenkins.version>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
<allureCommandline.version>2.21.0</allureCommandline.version>
<truezip.version>7.7.10</truezip.version>
</properties>

<developers>
Expand Down Expand Up @@ -162,7 +163,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.2.1</version>
<version>3.6.0</version>
<configuration>
<configLocation>.mvn/quality-configs/checkstyle/checkstyle.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
Expand Down Expand Up @@ -239,7 +240,7 @@
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.6.8</version>
<version>1.13.0</version>
<executions>
<execution>
<id>download-commandline</id>
Expand Down Expand Up @@ -280,8 +281,8 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.387.x</artifactId>
<version>2496.vddfca_753db_80</version>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>3893.v213a_42768d35</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -292,31 +293,9 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<version>1.18.36</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.schlichtherle.truezip</groupId>
<artifactId>truezip-driver-zip</artifactId>
<version>${truezip.version}</version>
<exclusions>
<!-- Provided by Jenkins core -->
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
<!-- Provided by bouncycastle-api plugin -->
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>de.schlichtherle.truezip</groupId>
<artifactId>truezip-file</artifactId>
<version>${truezip.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>jackson2-api</artifactId>
Expand Down Expand Up @@ -348,7 +327,6 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>job-dsl</artifactId>
<version>1.83</version>
<optional>true</optional>
</dependency>
<dependency>
Expand All @@ -367,13 +345,13 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.24.2</version>
<version>3.27.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ru.yandex.qatools.matchers</groupId>
<artifactId>nio-matchers</artifactId>
<version>1.3</version>
<version>1.4.1</version>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import hudson.model.Action;
import hudson.model.BuildBadgeAction;
import hudson.model.DirectoryBrowserSupport;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.StaplerResponse2;

import javax.servlet.ServletException;
import jakarta.servlet.ServletException;
import java.io.IOException;

/**
Expand Down Expand Up @@ -63,8 +63,8 @@ public String getBuildUrl() {
}

@SuppressWarnings({"unused", "TrailingComment"})
public DirectoryBrowserSupport doDynamic(final StaplerRequest req,
final StaplerResponse rsp) //NOSONAR
public DirectoryBrowserSupport doDynamic(final StaplerRequest2 req,
final StaplerResponse2 rsp) //NOSONAR
throws IOException, ServletException, InterruptedException {
final AbstractProject<?, ?> project = build.getProject();
final FilePath systemDirectory = new FilePath(AllureReportPlugin.getReportBuildDirectory(build));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
import org.jfree.chart.JFreeChart;
import org.jfree.data.category.CategoryDataset;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.StaplerResponse2;
import ru.yandex.qatools.allure.jenkins.utils.BuildSummary;
import ru.yandex.qatools.allure.jenkins.utils.ChartUtils;
import ru.yandex.qatools.allure.jenkins.utils.FilePathUtils;

import javax.servlet.ServletException;
import jakarta.servlet.ServletException;
import java.io.IOException;
import java.lang.ref.WeakReference;
import java.util.Collection;
Expand Down Expand Up @@ -77,7 +77,7 @@ public void setReportPath(final FilePath reportPath) {
this.reportPath = reportPath.getName();
}

public void doGraph(final StaplerRequest req, final StaplerResponse rsp) throws IOException {
public void doGraph(final StaplerRequest2 req, final StaplerResponse2 rsp) throws IOException {
final CategoryDataset data = buildDataSet();

new Graph(-1, 600, 300) {
Expand All @@ -88,7 +88,7 @@ protected JFreeChart createGraph() {
}.doPng(req, rsp);
}

public void doGraphMap(final StaplerRequest req, final StaplerResponse rsp) throws IOException {
public void doGraphMap(final StaplerRequest2 req, final StaplerResponse2 rsp) throws IOException {
final CategoryDataset data = buildDataSet();

new Graph(-1, 600, 300) {
Expand Down Expand Up @@ -223,8 +223,8 @@ public String getBuildUrl() {
}

@SuppressWarnings("unused")
public ArchiveReportBrowser doDynamic(final StaplerRequest req,
final StaplerResponse rsp)
public ArchiveReportBrowser doDynamic(final StaplerRequest2 req,
final StaplerResponse2 rsp)
throws IOException, ServletException, InterruptedException {
final FilePath archive = new FilePath(run.getRootDir()).child("archive/allure-report.zip");
final ArchiveReportBrowser archiveReportBrowser = new ArchiveReportBrowser(archive);
Expand Down Expand Up @@ -262,8 +262,8 @@ private void setReportPath(final String reportPath) {
}

@Override
public void generateResponse(final StaplerRequest req,
final StaplerResponse rsp,
public void generateResponse(final StaplerRequest2 req,
final StaplerResponse2 rsp,
final Object node)
throws IOException, ServletException {
rsp.setHeader(CACHE_CONTROL, "no-cache, no-store, must-revalidate");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import hudson.model.TaskListener;
import hudson.tasks.BuildStepMonitor;
import hudson.tasks.Recorder;
import hudson.util.io.ArchiverFactory;
import jenkins.model.Jenkins;
import jenkins.tasks.SimpleBuildStep;
import org.apache.commons.lang.StringUtils;
Expand All @@ -47,7 +48,6 @@
import ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation;
import ru.yandex.qatools.allure.jenkins.utils.BuildUtils;
import ru.yandex.qatools.allure.jenkins.utils.FilePathUtils;
import ru.yandex.qatools.allure.jenkins.utils.TrueZipArchiver;

import edu.umd.cs.findbugs.annotations.Nullable;
import java.io.File;
Expand Down Expand Up @@ -385,7 +385,7 @@ private void saveAllureArtifact(final Run<?, ?> run,

try (OutputStream os = Files.newOutputStream(tempArchive.toPath())) {
Objects.requireNonNull(reportPath.getParent())
.archive(TrueZipArchiver.FACTORY, os, reportPath.getName() + "/**");
.archive(ArchiverFactory.ZIP, os, reportPath.getName() + "/**");
}

Files.move(tempArchive.toPath(), archive.toPath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import net.sf.json.JSONObject;
import org.apache.commons.collections.CollectionUtils;
import org.jenkinsci.Symbol;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;
import ru.yandex.qatools.allure.jenkins.config.PropertyConfig;
import ru.yandex.qatools.allure.jenkins.config.ReportBuildPolicy;
import ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation;
Expand Down Expand Up @@ -94,7 +94,7 @@ public AutoCompletionCandidates doAutoCompletePropertyKey() {
}

@Override
public boolean configure(final StaplerRequest req,
public boolean configure(final StaplerRequest2 req,
final JSONObject json) throws FormException {
try {
if (json.has(PROPERTIES)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.jfree.chart.renderer.category.StackedAreaRenderer;
import org.jfree.data.category.CategoryDataset;
import org.jfree.ui.RectangleInsets;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;
import ru.yandex.qatools.allure.jenkins.AllureReportBuildAction;
import ru.yandex.qatools.allure.jenkins.Messages;

Expand All @@ -43,7 +43,7 @@ private ChartUtils() {
}

@SuppressWarnings({"AnonInnerLength", "PMD.NcssCount"})
public static JFreeChart createChart(final StaplerRequest req,
public static JFreeChart createChart(final StaplerRequest2 req,
final CategoryDataset dataset) {

final String relPath = getRelPath(req);
Expand Down Expand Up @@ -132,7 +132,7 @@ public String generateToolTip(final CategoryDataset dataset,
return chart;
}

private static String getRelPath(final StaplerRequest req) {
private static String getRelPath(final StaplerRequest2 req) {
final String relPath = req.getParameter("rel");
if (relPath == null) {
return "";
Expand Down
Loading

0 comments on commit 8198262

Please sign in to comment.