Skip to content

Conversation

@jglick
Copy link
Member

@jglick jglick commented Feb 13, 2018

Integrates #63 & #64. Downstream of jenkinsci/durable-task-plugin#62.

@reviewbybees

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Minor comments so far. Need to finalize the upstream PT's review before approval


public static final String defaultEncoding = "UTF-8";

public FormValidation doCheckEncoding(@QueryParameter boolean returnStdout, @QueryParameter String encoding) {
Copy link
Member

Choose a reason for hiding this comment

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

Restrict it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not part of this PR, but sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

(for #64)

public static final String defaultEncoding = "UTF-8";

public FormValidation doCheckEncoding(@QueryParameter boolean returnStdout, @QueryParameter String encoding) {
if (encoding.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

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

Check for null just in case the form is messed up. Ideally it makes sense to use StringUtils.isBlank() here and in the constructor

Copy link
Member Author

Choose a reason for hiding this comment

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

If the form is messed up, there is a product bug and validation will fail. No need to be unreasonably defensive.

Copy link
Member Author

Choose a reason for hiding this comment

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

(for #64)

} catch (UnsupportedOperationException x) {
getContext().onFailure(x);
} catch (Exception x) { // as below
LOGGER.log(Level.FINE, node + " is evidently offline now", x);
Copy link
Member

Choose a reason for hiding this comment

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

Apparently it's not documented in jenkinsci/durable-task-plugin#60

Copy link
Member

Choose a reason for hiding this comment

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

Execution link in the log would be helpful

Copy link
Member Author

Choose a reason for hiding this comment

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

(for #63)

if (!directory) {
throw new AbortException("missing workspace " + remote + " on " + node);
}
LOGGER.log(Level.FINE, "{0} seems to be online", node);
Copy link
Member

Choose a reason for hiding this comment

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

DEBUG/FINEST? maybe also makes sense to print Execution#toString() to the log so we understand from where it comes

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

(#63)


@DataBoundSetter public void setEncoding(String encoding) {
this.encoding = encoding;
this.encoding = Util.fixEmpty(encoding);
Copy link
Member

Choose a reason for hiding this comment

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

Does not handle blank strings 🐜

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, what?

Convert empty string to null.

That is exactly what I want here.

Copy link
Member Author

Choose a reason for hiding this comment

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

(anyway for #64)

Jenkinsfile Outdated
@@ -1 +1 @@
buildPlugin(jenkinsVersions: [null, '2.73.1'])
Copy link
Member

Choose a reason for hiding this comment

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

Test with 2.107 instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

(obsolete)

@oleg-nenashev oleg-nenashev self-requested a review March 14, 2018 01:58
Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Requested changes in #63, #64 is approved.
Comments here have not been addressed yet. I will request changes here to remove it from the queue

@jglick
Copy link
Member Author

jglick commented Jun 9, 2018

Please do not perform line-by-line reviews in this PR. Rather, review component PRs.

@jglick
Copy link
Member Author

jglick commented Aug 7, 2018

Now covered by #63.

@jglick jglick closed this Aug 7, 2018
@jglick jglick deleted the watch-plus-UTF-8-JENKINS-31096 branch August 7, 2018 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants