Skip to content

Commit

Permalink
Make releasable before JENKINS-39533
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenc committed Dec 7, 2016
1 parent 036bea5 commit ef13b2f
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -35,7 +35,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>scm-api</artifactId>
<version>2.0-SNAPSHOT</version>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -62,7 +62,7 @@
<dependency>
<groupId>com.coravy.hudson.plugins.github</groupId>
<artifactId>github</artifactId>
<version>1.22.5-SNAPSHOT</version>
<version>1.24.0</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
Expand Up @@ -27,6 +27,7 @@
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Item;
import hudson.model.Job;
import java.io.IOException;
import java.io.StringReader;
import java.util.Set;
Expand Down Expand Up @@ -62,7 +63,7 @@ public class GitHubRepositoryEventSubscriber extends GHEventsSubscriber {
private static final Pattern REPOSITORY_NAME_PATTERN = Pattern.compile("https?://([^/]+)/([^/]+)/([^/]+)");


@Override
// TODO Post JENKINS-39533 @Override
protected boolean isApplicable(@Nullable Item item) {
if (item instanceof SCMNavigatorOwner) {
for (SCMNavigator navigator : ((SCMNavigatorOwner) item).getSCMNavigators()) {
Expand All @@ -74,6 +75,12 @@ protected boolean isApplicable(@Nullable Item item) {
return false;
}

// TODO Post JENKINS-39533 delete
@Override
protected boolean isApplicable(@Nullable Job<?, ?> job) {
return isApplicable((Item)job);
}

/**
* @return set with only REPOSITORY event
*/
Expand Down
Expand Up @@ -478,7 +478,7 @@ public List<Action> retrieveActions(@NonNull SCMNavigatorOwner owner,
*/
@Override
public void afterSave(@NonNull SCMNavigatorOwner owner) {
GitHubWebHook.get().registerHookFor(owner);
// TODO Post JENKINS-39533 GitHubWebHook.get().registerHookFor(owner);
try {
// FIXME MINOR HACK ALERT
StandardCredentials credentials =
Expand Down
Expand Up @@ -370,10 +370,6 @@ protected final void retrieve(@CheckForNull SCMSourceCriteria criteria,
@NonNull SCMHeadObserver observer,
@CheckForNull SCMHeadEvent<?> event,
@NonNull final TaskListener listener) throws IOException, InterruptedException {
if (event != null) {
// we rely on Observer#getIncludes() for filtering the retrieve to an event
observer = event.filter(this, observer);
}
StandardCredentials credentials = Connector.lookupScanCredentials(getOwner(), apiUri, scanCredentialsId);
// Github client and validation
GitHub github = Connector.connect(apiUri, credentials);
Expand Down Expand Up @@ -976,7 +972,7 @@ protected List<Action> retrieveActions(@CheckForNull SCMSourceEvent event,
public void afterSave() {
SCMSourceOwner owner = getOwner();
if (owner != null) {
GitHubWebHook.get().registerHookFor(owner);
// TODO Post JENKINS-39533 GitHubWebHook.get().registerHookFor(owner);
}
}

Expand Down
Expand Up @@ -28,6 +28,7 @@
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Item;
import hudson.model.Job;
import hudson.scm.SCM;
import java.io.IOException;
import java.io.StringReader;
Expand Down Expand Up @@ -70,7 +71,7 @@ public class PullRequestGHEventSubscriber extends GHEventsSubscriber {
private static final Logger LOGGER = Logger.getLogger(PullRequestGHEventSubscriber.class.getName());
private static final Pattern REPOSITORY_NAME_PATTERN = Pattern.compile("https?://([^/]+)/([^/]+)/([^/]+)");

@Override
// TODO Post JENKINS-39533 @Override
protected boolean isApplicable(@Nullable Item project) {
if (project != null) {
if (project instanceof SCMSourceOwner) {
Expand All @@ -93,6 +94,12 @@ protected boolean isApplicable(@Nullable Item project) {
return false;
}

// TODO Post JENKINS-39533 delete
@Override
protected boolean isApplicable(@Nullable Job<?, ?> job) {
return isApplicable((Item)job);
}

/**
* @return set with only PULL_REQUEST event
*/
Expand Down
Expand Up @@ -28,6 +28,7 @@
import edu.umd.cs.findbugs.annotations.NonNull;
import hudson.Extension;
import hudson.model.Item;
import hudson.model.Job;
import hudson.scm.SCM;
import java.io.StringReader;
import java.util.Collections;
Expand Down Expand Up @@ -67,7 +68,7 @@ public class PushGHEventSubscriber extends GHEventsSubscriber {
private static final Logger LOGGER = Logger.getLogger(PushGHEventSubscriber.class.getName());
private static final Pattern REPOSITORY_NAME_PATTERN = Pattern.compile("https?://([^/]+)/([^/]+)/([^/]+)");

@Override
//TODO Post JENKINS-39533 @Override
protected boolean isApplicable(@Nullable Item project) {
if (project != null) {
if (project instanceof SCMSourceOwner) {
Expand All @@ -90,6 +91,12 @@ protected boolean isApplicable(@Nullable Item project) {
return false;
}

// TODO Post JENKINS-39533 delete
@Override
protected boolean isApplicable(@Nullable Job<?, ?> job) {
return isApplicable((Item)job);
}

/**
* @return set with only PULL_REQUEST event
*/
Expand Down

1 comment on commit ef13b2f

@uhafner
Copy link
Member

@uhafner uhafner commented on ef13b2f Dec 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in all issue references: it is JENKINS-39355 and not JENKINS-39533.

Please sign in to comment.