This repository has been archived by the owner on Dec 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add membership=true to gitlab project listings (#66)
* add membership=true to gitlab project listings * add removal of double slashes which occurs and makes api fail * decode MergeRequestHook objectAttributes action as string and do it outside of gitlab-plugin as it is wrong there. Also add support for reopen action to do same as Open. * fix settings screen not storing option for Build Merged because of wrong variable * remove duplicative call to build after merge * fix test code
- Loading branch information
1 parent
19b02a2
commit b2831d3
Showing
9 changed files
with
220 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...ain/java/argelbargel/jenkins/plugins/gitlab_branch_source/api/Hooks/MergeRequestHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package argelbargel.jenkins.plugins.gitlab_branch_source.api.Hooks; | ||
|
||
|
||
import org.apache.commons.lang.builder.EqualsBuilder; | ||
import org.apache.commons.lang.builder.HashCodeBuilder; | ||
import org.apache.commons.lang.builder.ToStringBuilder; | ||
|
||
public class MergeRequestHook extends WebHook { | ||
|
||
private MergeRequestObjectAttributes objectAttributes; | ||
|
||
public MergeRequestObjectAttributes getObjectAttributes() { | ||
return objectAttributes; | ||
} | ||
|
||
public void setObjectAttributes(MergeRequestObjectAttributes objectAttributes) { | ||
this.objectAttributes = objectAttributes; | ||
} | ||
|
||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
MergeRequestHook that = (MergeRequestHook) o; | ||
return new EqualsBuilder() | ||
.append(objectAttributes, that.objectAttributes) | ||
.isEquals(); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return new HashCodeBuilder(17, 37) | ||
|
||
.append(objectAttributes) | ||
.toHashCode(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new ToStringBuilder(this) | ||
.append("objectAttributes", objectAttributes) | ||
.toString(); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...elbargel/jenkins/plugins/gitlab_branch_source/api/Hooks/MergeRequestObjectAttributes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package argelbargel.jenkins.plugins.gitlab_branch_source.api.Hooks; | ||
|
||
import org.apache.commons.lang.builder.EqualsBuilder; | ||
import org.apache.commons.lang.builder.HashCodeBuilder; | ||
import org.apache.commons.lang.builder.ToStringBuilder; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
|
||
public class MergeRequestObjectAttributes { | ||
|
||
private String action; | ||
|
||
|
||
public String getAction() { | ||
return action; | ||
} | ||
|
||
public void setAction(String action) { | ||
this.action = action; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
MergeRequestObjectAttributes that = (MergeRequestObjectAttributes) o; | ||
return new EqualsBuilder() | ||
.append(action, that.action) | ||
.isEquals(); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return new HashCodeBuilder(17, 37) | ||
.append(action) | ||
.toHashCode(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new ToStringBuilder(this) | ||
.append("action", action) | ||
.toString(); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
src/main/java/argelbargel/jenkins/plugins/gitlab_branch_source/api/Hooks/WebHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package argelbargel.jenkins.plugins.gitlab_branch_source.api.Hooks; | ||
|
||
|
||
import org.apache.commons.lang.builder.EqualsBuilder; | ||
import org.apache.commons.lang.builder.HashCodeBuilder; | ||
import org.apache.commons.lang.builder.ToStringBuilder; | ||
|
||
/** | ||
* @author Robin Müller | ||
*/ | ||
public abstract class WebHook { | ||
|
||
private String objectKind; | ||
|
||
public String getObjectKind() { | ||
return objectKind; | ||
} | ||
|
||
public void setObjectKind(String objectKind) { | ||
this.objectKind = objectKind; | ||
} | ||
|
||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
WebHook webHook = (WebHook) o; | ||
return new EqualsBuilder() | ||
.append(objectKind, webHook.objectKind) | ||
.isEquals(); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return new HashCodeBuilder(17, 37) | ||
|
||
.append(objectKind) | ||
.toHashCode(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new ToStringBuilder(this) | ||
.append("objectKind", objectKind) | ||
.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters