Skip to content

Commit d86dbf1

Browse files
authored
Merge pull request #898 from jenkinsci/java17
Use Java 17 and Jenkins 2.479.3 as baseline
2 parents 8c71873 + 5328c45 commit d86dbf1

File tree

7 files changed

+14
-11
lines changed

7 files changed

+14
-11
lines changed

plugin/pom.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>org.jvnet.hudson.plugins</groupId>
66
<artifactId>analysis-pom</artifactId>
7-
<version>8.4.0</version>
7+
<version>10.2.0</version>
88
<relativePath />
99
</parent>
1010

@@ -18,7 +18,7 @@
1818
<url>https://github.com/jenkinsci/git-forensics-plugin</url>
1919

2020
<properties>
21-
<revision>2.3.0</revision>
21+
<revision>3.0.0</revision>
2222
<changelist>-SNAPSHOT</changelist>
2323

2424
<module.name>${project.groupId}.git.forensics</module.name>
@@ -75,6 +75,7 @@
7575
<dependency>
7676
<groupId>io.jenkins.plugins</groupId>
7777
<artifactId>plugin-util-api</artifactId>
78+
<version>6.0.0-rc1031.7a_4203d33c1f</version>
7879
</dependency>
7980
<dependency>
8081
<groupId>org.jenkins-ci.plugins</groupId>

plugin/src/main/java/io/jenkins/plugins/forensics/git/blame/GitBlamer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ else if (line <= blame.getResultContents().size()) {
189189
log.logException(exception, "- error running git blame on '%s' with revision '%s'",
190190
relativePath, headCommit);
191191
}
192-
log.logSummary();
193192
}
194193

195194
private void fillWithBlameResult(final String fileName, final FileBlame fileBlame, final BlameResult blame,

plugin/src/main/java/io/jenkins/plugins/forensics/git/delta/DeltaRepositoryCallback.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import java.io.ByteArrayOutputStream;
44
import java.io.IOException;
55
import java.nio.charset.StandardCharsets;
6+
import java.util.EnumMap;
67
import java.util.HashMap;
78
import java.util.List;
89
import java.util.Map;
@@ -196,7 +197,8 @@ private FileChanges createFileChanges(final FileEditType fileEditType, final Dif
196197

197198
diffFormatter.format(diffEntry);
198199

199-
FileChanges fileChanges = new FileChanges(filePath, oldFilePath, fileContent, fileEditType, new HashMap<>());
200+
FileChanges fileChanges = new FileChanges(filePath, oldFilePath, fileContent, fileEditType,
201+
new EnumMap<>(ChangeEditType.class));
200202

201203
for (Edit edit : diffFormatter.toFileHeader(diffEntry).toEditList()) {
202204
createChange(edit).ifPresent(fileChanges::addChange);
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/**
22
* Git implementation for determining the code difference - so called 'delta' - between two commits.
3-
*
4-
* @author Florian Orendi
53
*/
64
@DefaultAnnotation(NonNull.class)
75
package io.jenkins.plugins.forensics.git.delta;
86

97
import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
10-
import edu.umd.cs.findbugs.annotations.NonNull;
8+
import edu.umd.cs.findbugs.annotations.NonNull;

plugin/src/main/java/io/jenkins/plugins/forensics/git/miner/package-info.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* Provides API classes to obtain commit statistics for files in a repository.
3+
*
34
* <p>
45
* For pull requests (or more generally: for jobs that have a reference build defined) the classes in this package
56
* collect a statistical summary for all containing commits. This includes the commits count, the changed files count,
@@ -10,6 +11,7 @@
1011
* Additionally, the classes in this package will collect commit statistics for all repository files in the style of
1112
* the book "Code as a Crime Scene":
1213
* </p>
14+
*
1315
* <ul>
1416
* <li> commits count </li>
1517
* <li> different authors count </li>

plugin/src/main/java/io/jenkins/plugins/forensics/git/reference/package-info.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/**
22
* Provides classes to discover reference builds in Git projects.
3+
*
34
* <p>
45
* Several plugins that report build statistics (test results, code coverage, metrics, static analysis warnings)
56
* typically show their reports in two different ways: either as absolute report (e.g., total number of tests or

plugin/src/test/java/io/jenkins/plugins/forensics/git/reference/GitReferenceRecorderITest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
import edu.hm.hafner.util.PathUtil;
1919

20-
import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition;
2120
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
2221
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
2322
import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject;
23+
import hudson.model.Descriptor.FormException;
2424
import hudson.model.Result;
2525
import hudson.model.Run;
2626
import jenkins.branch.BranchProperty;
@@ -72,13 +72,13 @@ class GitReferenceRecorderITest extends GitITest {
7272
*/
7373
@Test
7474
@Issue("JENKINS-64545")
75-
void shouldHandleJobsWithoutGitGracefully() {
75+
void shouldHandleJobsWithoutGitGracefully() throws FormException {
7676
WorkflowJob job = createPipeline("no-git");
7777

78-
job.setDefinition(new CpsFlowDefinition("node {}", true));
78+
job.setDefinition(createPipelineScript("node {}"));
7979
buildSuccessfully(job);
8080

81-
job.setDefinition(new CpsFlowDefinition("node {discoverGitReferenceBuild(referenceJob: 'no-git')}", true));
81+
job.setDefinition(createPipelineScript("node {discoverGitReferenceBuild(referenceJob: 'no-git')}"));
8282
buildSuccessfully(job);
8383

8484
assertThat(getConsoleLog(job.getLastBuild())).contains(NOT_FOUND_MESSAGE);

0 commit comments

Comments
 (0)