diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbbe05bc..644a32f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,12 +13,7 @@ jobs: strategy: matrix: platform: [ubuntu-latest, macos-latest, windows-latest] - jdk: [17] - include: - - platform: ubuntu-latest - jdk: 11 - - platform: macos-latest - jdk: 11 + jdk: [17, 21] runs-on: ${{ matrix.platform }} name: on ${{ matrix.platform }} with JDK ${{ matrix.jdk }} @@ -32,5 +27,11 @@ jobs: java-version: '${{ matrix.jdk }}' check-latest: true cache: 'maven' + - name: Set up Maven + uses: stCarolas/setup-maven@v4 + with: + maven-version: 3.9.5 - name: Build with Maven + env: + BROWSER: chrome-container run: mvn -V --color always -ntp clean verify --file pom.xml '-Djenkins.test.timeout=5000' '-Dgpg.skip' diff --git a/.github/workflows/enforce-labels.yml b/.github/workflows/enforce-labels.yml index 5a27f6a0..a0a9164a 100644 --- a/.github/workflows/enforce-labels.yml +++ b/.github/workflows/enforce-labels.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: mheap/github-action-required-labels@v5 with: - mode: exactly + mode: minimum count: 1 labels: "bug,feature,enhancement,breaking,tests,documentation,internal,dependencies" message: "Maintainer needs to assign at least one label before merge" diff --git a/README.md b/README.md index 257f557f..49fd5307 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Git Forensics Jenkins Plugin [![Join the chat at https://gitter.im/jenkinsci/warnings-plugin](https://badges.gitter.im/jenkinsci/warnings-plugin.svg)](https://gitter.im/jenkinsci/warnings-plugin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -[![Jenkins](https://ci.jenkins.io/job/Plugins/job/git-forensics-plugin/job/master/badge/icon?subject=Jenkins%20CI)](https://ci.jenkins.io/job/Plugins/job/git-forensics-plugin/job/master/) -[![GitHub Actions](https://github.com/jenkinsci/git-forensics-plugin/workflows/GitHub%20CI/badge.svg?branch=master)](https://github.com/jenkinsci/git-forensics-plugin/actions) +[![Jenkins](https://ci.jenkins.io/job/Plugins/job/git-forensics-plugin/job/main/badge/icon?subject=Jenkins%20CI)](https://ci.jenkins.io/job/Plugins/job/git-forensics-plugin/job/main/) +[![GitHub Actions](https://github.com/jenkinsci/git-forensics-plugin/workflows/GitHub%20CI/badge.svg)](https://github.com/jenkinsci/git-forensics-plugin/actions) [![codecov](https://codecov.io/gh/jenkinsci/git-forensics-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/jenkinsci/git-forensics-plugin) -[![CodeQL](https://github.com/jenkinsci/git-forensics-plugin/workflows/CodeQL/badge.svg?branch=master)](https://github.com/jenkinsci/git-forensics-plugin/actions/workflows/codeql.yml) +[![CodeQL](https://github.com/jenkinsci/git-forensics-plugin/workflows/CodeQL/badge.svg)](https://github.com/jenkinsci/git-forensics-plugin/actions/workflows/codeql.yml) This Git Forensics Jenkins plugin mines and analyzes data from a Git repository. It implements all extension points of [Jenkins' Forensics API Plugin](https://github.com/jenkinsci/forensics-api-plugin) and provides the following services: diff --git a/plugin/etc/assertj-templates/assertion_class_template.txt b/plugin/etc/assertj-templates/assertion_class_template.txt new file mode 100644 index 00000000..320e3603 --- /dev/null +++ b/plugin/etc/assertj-templates/assertion_class_template.txt @@ -0,0 +1,26 @@ +package ${package}; +${imports} +/** + * {@link ${class_to_assert}} specific assertions - Generated by CustomAssertionGenerator. + */ +@edu.hm.hafner.util.Generated(value="assertj-assertions-generator") +public class ${custom_assertion_class} extends AbstractObjectAssert<${custom_assertion_class}, ${class_to_assert}> { + + /** + * Creates a new {@link ${custom_assertion_class}} to make assertions on actual ${class_to_assert}. + * @param actual the ${class_to_assert} we want to make assertions on. + */ + public ${custom_assertion_class}(${class_to_assert} actual) { + super(actual, ${custom_assertion_class}.class); + } + + /** + * An entry point for ${custom_assertion_class} to follow AssertJ standard assertThat() statements.
+ * With a static import, one can write directly: assertThat(my${class_to_assert}) and get specific assertion with code completion. + * @param actual the ${class_to_assert} we want to make assertions on. + * @return a new {@link ${custom_assertion_class}} + */ + @org.assertj.core.util.CheckReturnValue + public static ${custom_assertion_class} assertThat(${class_to_assert} actual) { + return new ${custom_assertion_class}(actual); + } diff --git a/plugin/etc/assertj-templates/assertions_entry_point_class_template.txt b/plugin/etc/assertj-templates/assertions_entry_point_class_template.txt index f5204a15..a275e227 100644 --- a/plugin/etc/assertj-templates/assertions_entry_point_class_template.txt +++ b/plugin/etc/assertj-templates/assertions_entry_point_class_template.txt @@ -5,7 +5,7 @@ package ${package}; * type-specific assertion objects. */ @edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NM") -@javax.annotation.Generated(value="assertj-assertions-generator") +@edu.hm.hafner.util.Generated(value="assertj-assertions-generator") public class Assertions extends org.assertj.core.api.Assertions { ${all_assertions_entry_points} /** diff --git a/plugin/etc/assertj-templates/soft_assertions_entry_point_class_template.txt b/plugin/etc/assertj-templates/soft_assertions_entry_point_class_template.txt index c7485e42..68df9869 100644 --- a/plugin/etc/assertj-templates/soft_assertions_entry_point_class_template.txt +++ b/plugin/etc/assertj-templates/soft_assertions_entry_point_class_template.txt @@ -4,7 +4,7 @@ package ${package}; * Entry point for soft assertions of different data types. */ @edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NM") -@javax.annotation.Generated(value="assertj-assertions-generator") +@edu.hm.hafner.util.Generated(value="assertj-assertions-generator") public class SoftAssertions extends org.assertj.core.api.AutoCloseableSoftAssertions { ${all_assertions_entry_points} } diff --git a/plugin/pom.xml b/plugin/pom.xml index 14539af5..7d519f04 100644 --- a/plugin/pom.xml +++ b/plugin/pom.xml @@ -4,7 +4,7 @@ org.jvnet.hudson.plugins analysis-pom - 6.5.0 + 6.14.0 diff --git a/plugin/src/test/java/io/jenkins/plugins/forensics/git/blame/GitBlamerITest.java b/plugin/src/test/java/io/jenkins/plugins/forensics/git/blame/GitBlamerITest.java index da64656e..7c038946 100644 --- a/plugin/src/test/java/io/jenkins/plugins/forensics/git/blame/GitBlamerITest.java +++ b/plugin/src/test/java/io/jenkins/plugins/forensics/git/blame/GitBlamerITest.java @@ -2,7 +2,7 @@ import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.Test; -import org.jvnet.hudson.test.Issue; +import org.junitpioneer.jupiter.Issue; import edu.hm.hafner.util.FilteredLog; diff --git a/plugin/src/test/java/io/jenkins/plugins/forensics/git/blame/GitBlamerTest.java b/plugin/src/test/java/io/jenkins/plugins/forensics/git/blame/GitBlamerTest.java index d595a0c5..b6e4e112 100644 --- a/plugin/src/test/java/io/jenkins/plugins/forensics/git/blame/GitBlamerTest.java +++ b/plugin/src/test/java/io/jenkins/plugins/forensics/git/blame/GitBlamerTest.java @@ -15,7 +15,7 @@ import org.eclipse.jgit.lib.PersonIdent; import org.eclipse.jgit.revwalk.RevCommit; import org.junit.jupiter.api.Test; -import org.jvnet.hudson.test.Issue; +import org.junitpioneer.jupiter.Issue; import org.mockito.ArgumentMatchers; import edu.hm.hafner.util.FilteredLog; @@ -138,10 +138,10 @@ private void verifyExceptionHandling(final Class exception) when(runner.run(RELATIVE_PATH)).thenThrow(exception); callback.run(BUILDER, RELATIVE_PATH, runner, createLastCommitRunner(), log); - assertThat(log.getErrorMessages()).hasSize(3); - assertThat(log.getErrorMessages().get(1)).startsWith( + assertThat(log.getErrorMessages()).isNotEmpty(); + assertThat(log.getErrorMessages().get(0)).startsWith( "- error running git blame on '" + RELATIVE_PATH + "' with revision"); - assertThat(log.getErrorMessages().get(2)).startsWith(exception.getName()); + assertThat(log.getErrorMessages().get(1)).startsWith(exception.getName()); } @Test diff --git a/plugin/src/test/java/io/jenkins/plugins/forensics/git/reference/GitReferenceRecorderITest.java b/plugin/src/test/java/io/jenkins/plugins/forensics/git/reference/GitReferenceRecorderITest.java index a23fac74..0c4945d9 100644 --- a/plugin/src/test/java/io/jenkins/plugins/forensics/git/reference/GitReferenceRecorderITest.java +++ b/plugin/src/test/java/io/jenkins/plugins/forensics/git/reference/GitReferenceRecorderITest.java @@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.Test; -import org.jvnet.hudson.test.Issue; +import org.junitpioneer.jupiter.Issue; import com.cloudbees.hudson.plugins.folder.computed.FolderComputation; diff --git a/pom.xml b/pom.xml index cc74e538..fa5369a6 100644 --- a/pom.xml +++ b/pom.xml @@ -15,10 +15,29 @@ 1.8 + 3.48 + HEAD + 3.11.0 3.1.1 + ${java.version} + ${java.version} + + scm:git:https://github.com/jenkinsci/git-forensics-plugin.git + scm:git:git@github.com:jenkinsci/git-forensics-plugin.git + https://github.com/jenkinsci/git-forensics-plugin + ${scmTag} + + + + + repo.jenkins-ci.org + https://repo.jenkins-ci.org/public/ + + + @@ -30,6 +49,11 @@ true + + org.jenkins-ci.tools + maven-hpi-plugin + ${hpi-plugin.version} + diff --git a/ui-tests/etc/assertj-templates/assertion_class_template.txt b/ui-tests/etc/assertj-templates/assertion_class_template.txt new file mode 100644 index 00000000..320e3603 --- /dev/null +++ b/ui-tests/etc/assertj-templates/assertion_class_template.txt @@ -0,0 +1,26 @@ +package ${package}; +${imports} +/** + * {@link ${class_to_assert}} specific assertions - Generated by CustomAssertionGenerator. + */ +@edu.hm.hafner.util.Generated(value="assertj-assertions-generator") +public class ${custom_assertion_class} extends AbstractObjectAssert<${custom_assertion_class}, ${class_to_assert}> { + + /** + * Creates a new {@link ${custom_assertion_class}} to make assertions on actual ${class_to_assert}. + * @param actual the ${class_to_assert} we want to make assertions on. + */ + public ${custom_assertion_class}(${class_to_assert} actual) { + super(actual, ${custom_assertion_class}.class); + } + + /** + * An entry point for ${custom_assertion_class} to follow AssertJ standard assertThat() statements.
+ * With a static import, one can write directly: assertThat(my${class_to_assert}) and get specific assertion with code completion. + * @param actual the ${class_to_assert} we want to make assertions on. + * @return a new {@link ${custom_assertion_class}} + */ + @org.assertj.core.util.CheckReturnValue + public static ${custom_assertion_class} assertThat(${class_to_assert} actual) { + return new ${custom_assertion_class}(actual); + } diff --git a/ui-tests/etc/assertj-templates/assertions_entry_point_class_template.txt b/ui-tests/etc/assertj-templates/assertions_entry_point_class_template.txt index f5204a15..a275e227 100644 --- a/ui-tests/etc/assertj-templates/assertions_entry_point_class_template.txt +++ b/ui-tests/etc/assertj-templates/assertions_entry_point_class_template.txt @@ -5,7 +5,7 @@ package ${package}; * type-specific assertion objects. */ @edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NM") -@javax.annotation.Generated(value="assertj-assertions-generator") +@edu.hm.hafner.util.Generated(value="assertj-assertions-generator") public class Assertions extends org.assertj.core.api.Assertions { ${all_assertions_entry_points} /** diff --git a/ui-tests/etc/assertj-templates/soft_assertions_entry_point_class_template.txt b/ui-tests/etc/assertj-templates/soft_assertions_entry_point_class_template.txt index c7485e42..68df9869 100644 --- a/ui-tests/etc/assertj-templates/soft_assertions_entry_point_class_template.txt +++ b/ui-tests/etc/assertj-templates/soft_assertions_entry_point_class_template.txt @@ -4,7 +4,7 @@ package ${package}; * Entry point for soft assertions of different data types. */ @edu.umd.cs.findbugs.annotations.SuppressFBWarnings("NM") -@javax.annotation.Generated(value="assertj-assertions-generator") +@edu.hm.hafner.util.Generated(value="assertj-assertions-generator") public class SoftAssertions extends org.assertj.core.api.AutoCloseableSoftAssertions { ${all_assertions_entry_points} } diff --git a/ui-tests/pom.xml b/ui-tests/pom.xml index 717f779c..82209342 100644 --- a/ui-tests/pom.xml +++ b/ui-tests/pom.xml @@ -5,7 +5,7 @@ edu.hm.hafner codingstyle-pom - 2.29.0 + 3.33.0 @@ -16,7 +16,10 @@ UI Tests of Git Forensics Plugin - 2.428 + 2.427 + 3.48 + 2.3 + 2.38.0 ${project.groupId}.git.forensics.ui.tests 3.49 @@ -111,7 +114,7 @@ maven-surefire-plugin false - false + false ../plugin/target/test-classes/test-dependencies ${jenkins.version} @@ -147,6 +150,20 @@ + + org.pitest + pitest-maven + + true + + + + org.apache.maven.plugins + maven-javadoc-plugin + + true + + org.jacoco jacoco-maven-plugin