Skip to content

Commit

Permalink
Merge pull request #371 from jglick/GitStatus-multibranch-JENKINS-31884
Browse files Browse the repository at this point in the history
[JENKINS-31884] Deliver webhooks to all listeners
  • Loading branch information
MarkEWaite committed Dec 11, 2015
2 parents f00f379 + 9d1d316 commit a09fcd6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
28 changes: 17 additions & 11 deletions src/main/java/hudson/plugins/git/GitStatus.java
Expand Up @@ -219,25 +219,31 @@ public void writeBody(PrintWriter w) {
public static abstract class Listener implements ExtensionPoint {

/**
* Called when there is a change notification on a specific repository url.
*
* @param uri the repository uri.
* @param branches the (optional) branch information.
* @return any response contributors for the response to the push request.
* @since 1.4.1
* @deprecated implement #onNotifyCommit(org.eclipse.jgit.transport.URIish, String, String...)
* @deprecated implement {@link #onNotifyCommit(org.eclipse.jgit.transport.URIish, String, List, String...)}
*/
public List<ResponseContributor> onNotifyCommit(URIish uri, String[] branches) {
return onNotifyCommit(uri, null, branches);
throw new AbstractMethodError();
}

/**
* @deprecated implement {@link #onNotifyCommit(org.eclipse.jgit.transport.URIish, String, List, String...)}
*/
public List<ResponseContributor> onNotifyCommit(URIish uri, @Nullable String sha1, String... branches) {
List<ParameterValue> buildParameters = Collections.EMPTY_LIST;
return onNotifyCommit(uri, sha1, buildParameters, branches);
return onNotifyCommit(uri, branches);
}

/**
* Called when there is a change notification on a specific repository url.
*
* @param uri the repository uri.
* @param sha1 ?
* @param buildParameters ?
* @param branches the (optional) branch information.
* @return any response contributors for the response to the push request.
* @since 2.4.0
*/
public List<ResponseContributor> onNotifyCommit(URIish uri, @Nullable String sha1, List<ParameterValue> buildParameters, String... branches) {
return Collections.EMPTY_LIST;
return onNotifyCommit(uri, sha1, branches);
}


Expand Down
3 changes: 2 additions & 1 deletion src/main/java/jenkins/plugins/git/GitSCMSource.java
Expand Up @@ -29,6 +29,7 @@
import com.cloudbees.plugins.credentials.domains.URIRequirementBuilder;
import hudson.Extension;
import hudson.model.Item;
import hudson.model.ParameterValue;
import hudson.plugins.git.GitStatus;
import hudson.security.ACL;
import hudson.util.ListBoxModel;
Expand Down Expand Up @@ -146,7 +147,7 @@ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath SCMSourceOwner cont
public static class ListenerImpl extends GitStatus.Listener {

@Override
public List<GitStatus.ResponseContributor> onNotifyCommit(URIish uri, String sha1, String... branches) {
public List<GitStatus.ResponseContributor> onNotifyCommit(URIish uri, String sha1, List<ParameterValue> buildParameters, String... branches) {
List<GitStatus.ResponseContributor> result = new ArrayList<GitStatus.ResponseContributor>();
boolean notified = false;
// run in high privilege to see all the projects anonymous users don't see.
Expand Down

0 comments on commit a09fcd6

Please sign in to comment.