Skip to content

Commit

Permalink
Merge pull request #672 from jenkinsci/cleanup
Browse files Browse the repository at this point in the history
Remove annotation-api dependency
  • Loading branch information
uhafner committed Oct 19, 2023
2 parents 1bd3714 + d010987 commit 28afc92
Show file tree
Hide file tree
Showing 15 changed files with 118 additions and 24 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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'
2 changes: 1 addition & 1 deletion .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
26 changes: 26 additions & 0 deletions plugin/etc/assertj-templates/assertion_class_template.txt
Original file line number Diff line number Diff line change
@@ -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 <code>{@link ${custom_assertion_class}}</code> 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 <code>assertThat()</code> statements.<br>
* With a static import, one can write directly: <code>assertThat(my${class_to_assert})</code> and get specific assertion with code completion.
* @param actual the ${class_to_assert} we want to make assertions on.
* @return a new <code>{@link ${custom_assertion_class}}</code>
*/
@org.assertj.core.util.CheckReturnValue
public static ${custom_assertion_class} assertThat(${class_to_assert} actual) {
return new ${custom_assertion_class}(actual);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
2 changes: 1 addition & 1 deletion 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>6.5.0</version>
<version>6.14.0</version>
<relativePath />
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -138,10 +138,10 @@ private void verifyExceptionHandling(final Class<? extends Exception> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
24 changes: 24 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,29 @@

<properties>
<java.version>1.8</java.version>
<hpi-plugin.version>3.48</hpi-plugin.version>
<scmTag>HEAD</scmTag>

<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>

<scm child.scm.connection.inherit.append.path="false" child.scm.developerConnection.inherit.append.path="false" child.scm.url.inherit.append.path="false">
<connection>scm:git:https://github.com/jenkinsci/git-forensics-plugin.git</connection>
<developerConnection>scm:git:git@github.com:jenkinsci/git-forensics-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/git-forensics-plugin</url>
<tag>${scmTag}</tag>
</scm>

<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>

<build>
<plugins>
<!-- Do not deploy anything except for the plugin -->
Expand All @@ -30,6 +49,11 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<version>${hpi-plugin.version}</version>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down
26 changes: 26 additions & 0 deletions ui-tests/etc/assertj-templates/assertion_class_template.txt
Original file line number Diff line number Diff line change
@@ -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 <code>{@link ${custom_assertion_class}}</code> 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 <code>assertThat()</code> statements.<br>
* With a static import, one can write directly: <code>assertThat(my${class_to_assert})</code> and get specific assertion with code completion.
* @param actual the ${class_to_assert} we want to make assertions on.
* @return a new <code>{@link ${custom_assertion_class}}</code>
*/
@org.assertj.core.util.CheckReturnValue
public static ${custom_assertion_class} assertThat(${class_to_assert} actual) {
return new ${custom_assertion_class}(actual);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
23 changes: 20 additions & 3 deletions ui-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>edu.hm.hafner</groupId>
<artifactId>codingstyle-pom</artifactId>
<version>2.29.0</version>
<version>3.33.0</version>
<relativePath/>
</parent>

Expand All @@ -16,7 +16,10 @@
<name>UI Tests of Git Forensics Plugin</name>

<properties>
<jenkins.version>2.428</jenkins.version>
<jenkins.version>2.427</jenkins.version>
<hpi-plugin.version>3.48</hpi-plugin.version>
<json-smart.version>2.3</json-smart.version>
<json-unit-assertj.version>2.38.0</json-unit-assertj.version>
<module.name>${project.groupId}.git.forensics.ui.tests</module.name>

<hpi-plugin.version>3.49</hpi-plugin.version>
Expand Down Expand Up @@ -111,7 +114,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<reuseForks>false</reuseForks>
<trimStackTrace>false</trimStackTrace>
<trimStackTrace>false</trimStackTrace> <!-- SUREFIRE-1798 -->
<environmentVariables>
<PLUGINS_DIR>../plugin/target/test-classes/test-dependencies</PLUGINS_DIR>
<JENKINS_VERSION>${jenkins.version}</JENKINS_VERSION>
Expand Down Expand Up @@ -147,6 +150,20 @@

<build>
<plugins>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand Down

0 comments on commit 28afc92

Please sign in to comment.