Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore to the 0.1.0 version api #6

Merged
merged 2 commits into from
Aug 4, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public abstract class ChecksPublisherFactory implements ExtensionPoint {
* a listener to the builds
* @return the created {@link ChecksPublisher}
*/
protected abstract Optional<ChecksPublisher> createPublisher(Run<?, ?> run, TaskListener listener);
protected Optional<ChecksPublisher> createPublisher(Run<?, ?> run, TaskListener listener) {
return Optional.empty();
}

/**
* Creates a {@link ChecksPublisher} according to the {@link hudson.scm.SCM} used by the {@link Job}.
Expand All @@ -56,6 +58,17 @@ protected Optional<ChecksPublisher> createPublisher(Job<?, ?> job, TaskListener
return Optional.empty();
}

/**
* Returns a suitable publisher for the run.
*
* @param run
* a Jenkins run
* @return a publisher suitable for the job
*/
public static ChecksPublisher fromRun(final Run<?, ?> run) {
return fromRun(run, null, new JenkinsFacade());
}

/**
* Returns a suitable publisher for the run.
*
Expand Down