Conversation
There was a problem hiding this comment.
Avoid using @Extension on fields. Put it on the DescriptorImpl type.
| public static final class DescriptorImpl extends BasicClientDescriptor { | ||
| private DescriptorImpl(Class<? extends BasicClient> clazz) { | ||
| super(clazz); | ||
| } |
There was a problem hiding this comment.
Delete and use the default no-arg constructor.
There was a problem hiding this comment.
This is one of things I'm a bit confused by. Are you suggesting to change it to something like the following?
public static class DescriptorImpl extends BasicClientDescriptor {
public DescriptorImpl() {
super(LocalClient.class);
}
There was a problem hiding this comment.
Use primitives. For the actual fields, use primitives unless you really need to handle null values, typically only necessary for compatibly upgrading from an earlier version lacking the field, in which case readResolve would set a non-null value.
There was a problem hiding this comment.
If there is a sensible default for any parameter, use @DataBoundSetter and delete from the @DataBoundConstructor. Guide
There was a problem hiding this comment.
Done. Moved both jobPollTime and blockbuild to @DataBoudnSetter. Left the @DataBoundConstructor for target and targetType as it is required.
There was a problem hiding this comment.
You do not need any of this. Just use f:select and have the descriptor supply choices.
| public String getTargetType() { | ||
| return targetType; | ||
| public class BasicClient implements ExtensionPoint, Describable<BasicClient> { | ||
| public Descriptor<BasicClient> getDescriptor() { |
There was a problem hiding this comment.
Just extend AbstractDescribableImpl, but @Override this method to cast the super value to BasicClientDescriptor.
| this.blockBuild = blockBuild; | ||
| } | ||
| public static class BasicClientDescriptor extends Descriptor<BasicClient> { | ||
| public BasicClientDescriptor(Class<? extends BasicClient> clazz) { |
There was a problem hiding this comment.
Delete, this class should be abstract.
There was a problem hiding this comment.
Recommend target="_blank" to avoid clobbering a Jenkins configuration page.
|
|
||
| @Override | ||
| public String getDisplayName() { | ||
| return "local"; |
There was a problem hiding this comment.
Conventionally should be capitalized, unless this is intended to match a code word in some external system.
There was a problem hiding this comment.
Yep. This is the value passed along to the rest api
…job doens't crash. Pipeline version still doesn't output however :(
|
Thanks for all your help @jglick! It looks like things generally work. Yay! But there's a few more things to do to be a good citizen with pipeline.
|
While this code implements better utilization of classes which better supports the pipeline moudule, it also doesn't properly run.
When running a pipeline containing a saltstack API cal, I get the response:
Thanks!