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

[JENKINS-58167] Add support for source code retention strategy of Prism plugin #1660

Merged
merged 26 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
8c97e58
[JENKINS-72059] Add new quality gate options to alter the stage only.
uhafner Dec 29, 2023
afb3d2a
Fix some tests.
uhafner Jan 1, 2024
69d72f5
Make API method of quality result accessible.
uhafner Jan 2, 2024
58afecf
Fix reference of old quality gate status.
uhafner Jan 2, 2024
0ec09b2
Fix quality gate definition in Job DSL.
uhafner Jan 2, 2024
1b37074
Fix quality gates in remote API.
uhafner Jan 2, 2024
b840867
Add integer based setter fpr threshold.
uhafner Jan 2, 2024
a8614a1
Add integer based setter for threshold.
uhafner Jan 2, 2024
9ddcf8c
Fix new quality gates in UI test.
uhafner Jan 3, 2024
e998875
Fix enum values.
uhafner Jan 3, 2024
fbe68be
Fix enum values for pipelines.
uhafner Jan 3, 2024
96a63ca
Add integer based threshold.
uhafner Jan 4, 2024
7c345c7
Add integer based threshold to quality gate.
uhafner Jan 4, 2024
d1f0abe
Add an integer-based threshold for quality gates.
uhafner Jan 4, 2024
96f31be
Fix order in assertion.
uhafner Jan 4, 2024
6290cee
Use new data-bound properties of QualityGate.
uhafner Jan 6, 2024
f7a00f8
Use new output of snippet generator.
uhafner Jan 6, 2024
33ce1b8
Remove deprecated code.
uhafner Jan 10, 2024
ae9c8fe
Merge remote-tracking branch 'origin/main' into remove-deprecated
uhafner Jan 12, 2024
cc2f21e
Remove global configuration of source paths.
uhafner Jan 12, 2024
d1fad88
Remove source directory.
uhafner Jan 12, 2024
e4b3c2f
Remove source directory.
uhafner Jan 12, 2024
c9e0b4a
Restore totals field when `null`.
uhafner Jan 13, 2024
16139ca
Remove test for old serialization.
uhafner Jan 15, 2024
8f0571f
[JENKINS-58167] Use source code retention strategy of Prism.
uhafner Jan 12, 2024
7422834
ZIP all source files before copying into build folder.
uhafner Jan 13, 2024
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
64 changes: 48 additions & 16 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'
check-latest: true
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.6
- name: Build warnings plugin and download dependencies
run: mvn -V --color always -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the details tabs
Expand All @@ -33,13 +37,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'
check-latest: true
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.6
- name: Build warnings plugin and download dependencies
run: mvn -V --color always -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the dashboard view
Expand All @@ -53,13 +61,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'
check-latest: true
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.6
- name: Build warnings plugin and download dependencies
run: mvn -V --color always -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the freestyle configuration
Expand All @@ -73,13 +85,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'
check-latest: true
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.6
- name: Build warnings plugin and download dependencies
run: mvn -V --color always -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the pipeline snippet configurator
Expand All @@ -93,13 +109,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'
check-latest: true
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.6
- name: Build warnings plugin and download dependencies
run: mvn -V --color always -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for Jenkins' global configuration
Expand All @@ -113,13 +133,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'
check-latest: true
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.6
- name: Build warnings plugin and download dependencies
run: mvn -V --color always -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the issues column
Expand All @@ -133,13 +157,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'
check-latest: true
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.6
- name: Build warnings plugin and download dependencies
run: mvn -V --color always -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run UI tests for the trend charts
Expand All @@ -153,13 +181,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '21'
check-latest: true
cache: 'maven'
- name: Set up Maven
uses: stCarolas/setup-maven@v4.5
with:
maven-version: 3.9.6
- name: Build warnings plugin and download dependencies
run: mvn -V --color always -ntp verify -Pskip --file plugin/pom.xml -Dgpg.skip
- name: Run miscellaneous UI tests of the warnings plugin
Expand Down
5 changes: 2 additions & 3 deletions doc/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,11 @@ the number of issues that will fail a given quality gate.
An example pipeline with these options is shown in the following snippet:

```groovy
recordIssues tool: java(pattern: '*.log'), qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]]
recordIssues tool: java(pattern: '*.log'), qualityGates: [[threshold: 1, type: 'TOTAL', criticality: 'FAILURE']]
```

The type determines the property that will be picked to evaluate the quality gate. Refer to the enum
[QualityGateType](../plugin/src/main/java/io/jenkins/plugins/analysis/core/util/QualityGate.java) to see which different
types are supported.
[QualityGateType](../plugin/src/main/java/io/jenkins/plugins/analysis/core/util/WarningsQualityGate.java) to see which different types are supported.

### Health report configuration

Expand Down
11 changes: 10 additions & 1 deletion plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<url>https://github.com/jenkinsci/warnings-ng-plugin</url>

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

Expand Down Expand Up @@ -51,6 +51,7 @@
<argLine>-Djava.awt.headless=true -Xmx1024m -Djenkins.test.timeout=1000 --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED</argLine>

<prism-api.version>1.29.0-8</prism-api.version>
<plugin-util-api.version>3.9.0-rc855.756b_f8df78a_1</plugin-util-api.version>

</properties>

Expand Down Expand Up @@ -102,6 +103,7 @@
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>plugin-util-api</artifactId>
<version>${plugin-util-api.version}</version>
</dependency>
<dependency>
<groupId>io.jenkins.plugins</groupId>
Expand Down Expand Up @@ -314,6 +316,7 @@
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>plugin-util-api</artifactId>
<version>${plugin-util-api.version}</version>
<scope>test</scope>
<classifier>tests</classifier>
<exclusions>
Expand Down Expand Up @@ -369,6 +372,12 @@
<artifactId>parasoft-findings</artifactId>
<version>10.7.1</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>warnings-ng</artifactId>
<groupId>io.jenkins.plugins</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
*/
public class AggregatedTrendAction implements Action, AsyncConfigurableTrendChart {
private static final int MIN_TOOLS = 2;
private static final String EMPTY = "{}";

private final Job<?, ?> owner;

Expand Down Expand Up @@ -76,17 +75,6 @@ private Set<AnalysisHistory> createBuildHistory() {
}
}

/**
* Returns the trend chart model that renders the aggregated build results.
*
* @return the trend chart
* @deprecated replaced {@link #getConfigurableBuildTrendModel(String)}
*/
@Deprecated
public String getBuildTrendModel() {
return getConfigurableBuildTrendModel(EMPTY);
}

/**
* Returns the trend chart model that renders the aggregated build results.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

import io.jenkins.plugins.analysis.core.charts.JenkinsBuild;
import io.jenkins.plugins.analysis.core.util.AnalysisBuildResult;
import io.jenkins.plugins.analysis.core.util.QualityGateEvaluator;
import io.jenkins.plugins.analysis.core.util.QualityGateStatus;

import static io.jenkins.plugins.analysis.core.model.AnalysisHistory.JobResultEvaluationMode.*;
import static io.jenkins.plugins.analysis.core.model.AnalysisHistory.QualityGateEvaluationMode.*;
Expand Down Expand Up @@ -44,7 +42,7 @@ public class AnalysisHistory implements History {
private final JobResultEvaluationMode jobResultEvaluationMode;

/**
* Determines how the evaluation of the {@link QualityGateEvaluator} is taken into account when the previous result is
* Determines how the evaluation of the quality gates is taken into account when the previous result is
* searched for.
*/
public enum QualityGateEvaluationMode {
Expand All @@ -53,7 +51,7 @@ public enum QualityGateEvaluationMode {
*/
IGNORE_QUALITY_GATE,
/**
* The quality gate result must be {@link QualityGateStatus#isSuccessful()}. I.e. the history is searched for a
* The quality gate result must be successful. I.e., the history is searched for a
* build that either passed the quality gate or has deactivated the quality gate.
*/
SUCCESSFUL_QUALITY_GATE
Expand All @@ -65,7 +63,7 @@ public enum QualityGateEvaluationMode {
*/
public enum JobResultEvaluationMode {
/**
* Only those jobs are considered that did not fail. I.e. jobs with result {@link Result#UNSTABLE} or {@link
* Only those jobs are considered that did not fail. I.e., jobs with result {@link Result#UNSTABLE} or {@link
* Result#SUCCESS}.
*/
NO_JOB_FAILURE,
Expand All @@ -78,7 +76,7 @@ public enum JobResultEvaluationMode {
}

/**
* Creates a new instance of {@link AnalysisHistory}. This history ignores the {@link QualityGateStatus} of the
* Creates a new instance of {@link AnalysisHistory}. This history ignores the results of the
* quality gate and the {@link Result} of the associated {@link Run}.
*
* @param baseline
Expand Down
Loading
Loading