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

[JENKINS-66269] jenkinsci/pipeline-build-step-plugin#57 precludes usage of the API #62

Merged
merged 1 commit into from Aug 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -26,6 +26,7 @@

import hudson.console.ModelHyperlinkNote;
import hudson.model.Run;
import hudson.model.TaskListener;
import javax.annotation.CheckForNull;
import jenkins.model.CauseOfInterruption;

Expand All @@ -46,11 +47,22 @@ public final class DownstreamFailureCause extends CauseOfInterruption {
return Run.fromExternalizableId(id);
}

@Override public String getShortDescription() {
@Override public void print(TaskListener listener) {
String description;
Run<?, ?> downstream = getDownstreamBuild();
if (downstream != null) {
// encodeTo(Run) calls getDisplayName, which does not include the project name.
return ModelHyperlinkNote.encodeTo("/" + downstream.getUrl(), downstream.getFullDisplayName()) + " completed with status " + downstream.getResult() + " (propagate: false to ignore)";
description = ModelHyperlinkNote.encodeTo("/" + downstream.getUrl(), downstream.getFullDisplayName()) + " completed with status " + downstream.getResult() + " (propagate: false to ignore)";
} else {
description = "Downstream build was not stable (propagate: false to ignore)";
}
listener.getLogger().println(description);
}

@Override public String getShortDescription() {
Run<?, ?> downstream = getDownstreamBuild();
if (downstream != null) {
return downstream.getFullDisplayName() + " completed with status " + downstream.getResult() + " (propagate: false to ignore)";
} else {
return "Downstream build was not stable (propagate: false to ignore)";
}
Expand Down