Skip to content

Commit

Permalink
Merge pull request #898 from jenkinsci/java17
Browse files Browse the repository at this point in the history
Use Java 17 and Jenkins 2.479.3 as baseline
  • Loading branch information
uhafner authored Jan 15, 2025
2 parents 8c71873 + 5328c45 commit d86dbf1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
5 changes: 3 additions & 2 deletions plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jvnet.hudson.plugins</groupId>
<artifactId>analysis-pom</artifactId>
<version>8.4.0</version>
<version>10.2.0</version>
<relativePath />
</parent>

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

<properties>
<revision>2.3.0</revision>
<revision>3.0.0</revision>
<changelist>-SNAPSHOT</changelist>

<module.name>${project.groupId}.git.forensics</module.name>
Expand Down Expand Up @@ -75,6 +75,7 @@
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>plugin-util-api</artifactId>
<version>6.0.0-rc1031.7a_4203d33c1f</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ else if (line <= blame.getResultContents().size()) {
log.logException(exception, "- error running git blame on '%s' with revision '%s'",
relativePath, headCommit);
}
log.logSummary();
}

private void fillWithBlameResult(final String fileName, final FileBlame fileBlame, final BlameResult blame,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -196,7 +197,8 @@ private FileChanges createFileChanges(final FileEditType fileEditType, final Dif

diffFormatter.format(diffEntry);

FileChanges fileChanges = new FileChanges(filePath, oldFilePath, fileContent, fileEditType, new HashMap<>());
FileChanges fileChanges = new FileChanges(filePath, oldFilePath, fileContent, fileEditType,
new EnumMap<>(ChangeEditType.class));

for (Edit edit : diffFormatter.toFileHeader(diffEntry).toEditList()) {
createChange(edit).ifPresent(fileChanges::addChange);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/**
* Git implementation for determining the code difference - so called 'delta' - between two commits.
*
* @author Florian Orendi
*/
@DefaultAnnotation(NonNull.class)
package io.jenkins.plugins.forensics.git.delta;

import edu.umd.cs.findbugs.annotations.DefaultAnnotation;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.NonNull;
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Provides API classes to obtain commit statistics for files in a repository.
*
* <p>
* For pull requests (or more generally: for jobs that have a reference build defined) the classes in this package
* collect a statistical summary for all containing commits. This includes the commits count, the changed files count,
Expand All @@ -10,6 +11,7 @@
* Additionally, the classes in this package will collect commit statistics for all repository files in the style of
* the book "Code as a Crime Scene":
* </p>
*
* <ul>
* <li> commits count </li>
* <li> different authors count </li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/**
* Provides classes to discover reference builds in Git projects.
*
* <p>
* Several plugins that report build statistics (test results, code coverage, metrics, static analysis warnings)
* typically show their reports in two different ways: either as absolute report (e.g., total number of tests or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

import edu.hm.hafner.util.PathUtil;

import org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition;
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject;
import hudson.model.Descriptor.FormException;
import hudson.model.Result;
import hudson.model.Run;
import jenkins.branch.BranchProperty;
Expand Down Expand Up @@ -72,13 +72,13 @@ class GitReferenceRecorderITest extends GitITest {
*/
@Test
@Issue("JENKINS-64545")
void shouldHandleJobsWithoutGitGracefully() {
void shouldHandleJobsWithoutGitGracefully() throws FormException {
WorkflowJob job = createPipeline("no-git");

job.setDefinition(new CpsFlowDefinition("node {}", true));
job.setDefinition(createPipelineScript("node {}"));
buildSuccessfully(job);

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

assertThat(getConsoleLog(job.getLastBuild())).contains(NOT_FOUND_MESSAGE);
Expand Down

0 comments on commit d86dbf1

Please sign in to comment.