Skip to content

Commit

Permalink
Refresh plugin metadata (#1161)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Oct 12, 2021
1 parent 9705959 commit c59f27c
Show file tree
Hide file tree
Showing 13 changed files with 92 additions and 111 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @jenkinsci/gitlab-plugin-developers
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
3 changes: 3 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc
_extends: .github
tag-template: gitlab-plugin-$NEXT_MINOR_VERSION
16 changes: 16 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Automates creation of Release Drafts using Release Drafter
# More Info: https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc

on:
push:
branches:
- master

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into the default branch
- uses: release-drafter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 7 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.2</version>
</extension>
</extensions>
2 changes: 2 additions & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-Pconsume-incrementals
-Pmight-produce-incrementals
105 changes: 24 additions & 81 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.16</version>
<version>4.29</version>
<relativePath />
</parent>
<artifactId>gitlab-plugin</artifactId>
<version>1.5.21-SNAPSHOT</version>
<version>${revision}${changelist}</version>
<name>GitLab Plugin</name>
<url>https://github.com/jenkinsci/gitlab-plugin/</url>
<url>https://github.com/jenkinsci/${project.artifactId}</url>
<packaging>hpi</packaging>

<properties>
<revision>1.5.18</revision>
<revision>1.5.22</revision>
<changelist>-SNAPSHOT</changelist>
<java.level>8</java.level>
<jenkins.version>2.222.4</jenkins.version>
<spotbugs.failOnError>false</spotbugs.failOnError>
<configuration-as-code-plugin.version>1.46</configuration-as-code-plugin.version>
<gitHubRepo>jenkinsci/${project.artifactId}</gitHubRepo>
<hpi.compatibleSinceVersion>1.4.0</hpi.compatibleSinceVersion>
<jackson.version>2.12.1</jackson.version>
<jenkins-test-harness.version>2.71</jenkins-test-harness.version>
<jackson.version>2.12.3</jackson.version>
<powermock.version>2.0.9</powermock.version>
</properties>


Expand Down Expand Up @@ -54,45 +55,31 @@
</distributionManagement>

<scm>
<connection>scm:git:ssh://github.com:jenkinsci/gitlab-plugin.git</connection>
<developerConnection>scm:git:git@github.com:jenkinsci/gitlab-plugin.git</developerConnection>
<url>https://github.com/jenkinsci/gitlab-plugin</url>
<tag>HEAD</tag>
<connection>scm:git:https://github.com/${gitHubRepo}</connection>
<developerConnection>scm:git:https://github.com/${gitHubRepo}</developerConnection>
<url>https://github.com/${gitHubRepo}</url>
<tag>${scmTag}</tag>
</scm>
<!-- get every artifact through repo.jenkins-ci.org, which proxies all the artifacts that we need -->
<repositories>
<repository>
<id>repo.jenkins-ci.org-public</id>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</repository>
<repository>
<id>repo.jenkins-ci.org-releases</id>
<url>https://repo.jenkins-ci.org/releases/</url>
</repository>
<repository>
<id>jgit-repository</id>
<name>Eclipse JGit Repository</name>
<url>https://download.eclipse.org/jgit/maven</url>
</repository>
</repositories>

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

<dependencies>
<!-- Jenkins dependencies -->
<dependency>
<groupId>io.jenkins.plugins</groupId>
<artifactId>caffeine-api</artifactId>
<version>2.9.1-23.v51c4e2c879c8</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down Expand Up @@ -160,10 +147,6 @@
<artifactId>ssh-credentials</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>symbol-annotation</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>matrix-project</artifactId>
Expand All @@ -178,14 +161,17 @@
<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.16.Final</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -200,10 +186,13 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
<dependency>
<groupId>net.karneim</groupId>
<artifactId>pojobuilder</artifactId>
<version>3.4.0</version>
<!-- 'provided' scope because this is only needed during compilation -->
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -231,16 +220,19 @@
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-netty</artifactId>
<version>3.10.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -264,6 +256,7 @@
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1208</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -286,65 +279,15 @@

<dependencyManagement>
<dependencies>


<dependency>
<!-- Pick up common dependencies for the selected LTS line: https://github.com/jenkinsci/bom#usage -->
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.222.x</artifactId>
<version>23</version>
<version>887.vae9c8ac09ff7</version>
<scope>import</scope>
<type>pom</type>
</dependency>

<!--3rd party-->
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1208</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-netty</artifactId>
<version>3.10.2</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
<version>1.0.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.16.Final</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>${jackson.version}</version>
</dependency>


<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
<dependency>
<groupId>net.karneim</groupId>
<artifactId>pojobuilder</artifactId>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.11</version>
</dependency>
</dependencies>

</dependencyManagement>


Expand Down
38 changes: 18 additions & 20 deletions src/main/java/com/dabsquared/gitlabjenkins/cause/CauseData.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

import java.util.*;

import static com.google.common.base.Preconditions.checkNotNull;

/**
* @author Robin Müller
*/
Expand Down Expand Up @@ -71,37 +69,37 @@ public final class CauseData {
String targetRepoHttpUrl, String triggeredByUser, String before, String after, String lastCommit, String targetProjectUrl,
String triggerPhrase, String mergeRequestState, String mergedByUser, String mergeRequestAssignee, String ref, String isTag,
String sha, String beforeSha, String status, String stages, String createdAt, String finishedAt, String buildDuration) {
this.actionType = checkNotNull(actionType, "actionType must not be null.");
this.sourceProjectId = checkNotNull(sourceProjectId, "sourceProjectId must not be null.");
this.targetProjectId = checkNotNull(targetProjectId, "targetProjectId must not be null.");
this.branch = checkNotNull(branch, "branch must not be null.");
this.sourceBranch = checkNotNull(sourceBranch, "sourceBranch must not be null.");
this.userName = checkNotNull(userName, "userName must not be null.");
this.actionType = Objects.requireNonNull(actionType, "actionType must not be null.");
this.sourceProjectId = Objects.requireNonNull(sourceProjectId, "sourceProjectId must not be null.");
this.targetProjectId = Objects.requireNonNull(targetProjectId, "targetProjectId must not be null.");
this.branch = Objects.requireNonNull(branch, "branch must not be null.");
this.sourceBranch = Objects.requireNonNull(sourceBranch, "sourceBranch must not be null.");
this.userName = Objects.requireNonNull(userName, "userName must not be null.");
this.userUsername = userUsername == null ? "" : userUsername;
this.userEmail = userEmail == null ? "" : userEmail;
this.sourceRepoHomepage = sourceRepoHomepage == null ? "" : sourceRepoHomepage;
this.sourceRepoName = checkNotNull(sourceRepoName, "sourceRepoName must not be null.");
this.sourceNamespace = checkNotNull(sourceNamespace, "sourceNamespace must not be null.");
this.sourceRepoName = Objects.requireNonNull(sourceRepoName, "sourceRepoName must not be null.");
this.sourceNamespace = Objects.requireNonNull(sourceNamespace, "sourceNamespace must not be null.");
this.sourceRepoUrl = sourceRepoUrl == null ? sourceRepoSshUrl : sourceRepoUrl;
this.sourceRepoSshUrl = checkNotNull(sourceRepoSshUrl, "sourceRepoSshUrl must not be null.");
this.sourceRepoHttpUrl = checkNotNull(sourceRepoHttpUrl, "sourceRepoHttpUrl must not be null.");
this.mergeRequestTitle = checkNotNull(mergeRequestTitle, "mergeRequestTitle must not be null.");
this.sourceRepoSshUrl = Objects.requireNonNull(sourceRepoSshUrl, "sourceRepoSshUrl must not be null.");
this.sourceRepoHttpUrl = Objects.requireNonNull(sourceRepoHttpUrl, "sourceRepoHttpUrl must not be null.");
this.mergeRequestTitle = Objects.requireNonNull(mergeRequestTitle, "mergeRequestTitle must not be null.");
this.mergeRequestDescription = mergeRequestDescription == null ? "" : mergeRequestDescription;
this.mergeRequestId = mergeRequestId;
this.mergeRequestIid = mergeRequestIid;
this.mergeRequestState = mergeRequestState == null ? "" : mergeRequestState;
this.mergedByUser = mergedByUser == null ? "" : mergedByUser;
this.mergeRequestAssignee = mergeRequestAssignee == null ? "" : mergeRequestAssignee;
this.mergeRequestTargetProjectId = mergeRequestTargetProjectId;
this.targetBranch = checkNotNull(targetBranch, "targetBranch must not be null.");
this.targetRepoName = checkNotNull(targetRepoName, "targetRepoName must not be null.");
this.targetNamespace = checkNotNull(targetNamespace, "targetNamespace must not be null.");
this.targetRepoSshUrl = checkNotNull(targetRepoSshUrl, "targetRepoSshUrl must not be null.");
this.targetRepoHttpUrl = checkNotNull(targetRepoHttpUrl, "targetRepoHttpUrl must not be null.");
this.triggeredByUser = checkNotNull(triggeredByUser, "triggeredByUser must not be null.");
this.targetBranch = Objects.requireNonNull(targetBranch, "targetBranch must not be null.");
this.targetRepoName = Objects.requireNonNull(targetRepoName, "targetRepoName must not be null.");
this.targetNamespace = Objects.requireNonNull(targetNamespace, "targetNamespace must not be null.");
this.targetRepoSshUrl = Objects.requireNonNull(targetRepoSshUrl, "targetRepoSshUrl must not be null.");
this.targetRepoHttpUrl = Objects.requireNonNull(targetRepoHttpUrl, "targetRepoHttpUrl must not be null.");
this.triggeredByUser = Objects.requireNonNull(triggeredByUser, "triggeredByUser must not be null.");
this.before = before == null ? "" : before;
this.after = after == null ? "" : after;
this.lastCommit = checkNotNull(lastCommit, "lastCommit must not be null");
this.lastCommit = Objects.requireNonNull(lastCommit, "lastCommit must not be null");
this.targetProjectUrl = targetProjectUrl;
this.triggerPhrase = triggerPhrase;
this.ref = ref;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.dabsquared.gitlabjenkins.cause;

import hudson.triggers.SCMTrigger;
import java.util.Objects;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

import static com.google.common.base.Preconditions.checkNotNull;

/**
* @author Robin Müller
*/
Expand All @@ -16,7 +15,7 @@ public class GitLabWebHookCause extends SCMTrigger.SCMTriggerCause {

public GitLabWebHookCause(CauseData data) {
super("");
this.data = checkNotNull(data, "data must not be null");
this.data = Objects.requireNonNull(data, "data must not be null");
}

@Exported
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient;
import com.dabsquared.gitlabjenkins.gitlab.api.model.*;
import com.dabsquared.gitlabjenkins.gitlab.hook.model.State;
import com.google.common.base.Function;

import java.util.List;
import java.util.function.Function;


final class ResteasyGitLabClient implements GitLabClient {
Expand Down
Loading

0 comments on commit c59f27c

Please sign in to comment.