Skip to content

Conversation

@jglick
Copy link
Member

@jglick jglick commented Feb 9, 2018

JEP-206

Not exactly pulled out of #15, but in the same vein and complementary. One component of the solution only; as noted in jenkinsci/workflow-job-plugin#89, users will need to update multiple plugins to resolve issues.

if(charset==null) return Charset.defaultCharset(); // just being defensive
return Charset.forName(charset);
if (charset == null) { // new style
return StandardCharsets.UTF_8;
Copy link
Member

Choose a reason for hiding this comment

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

Is this actually safe to do? Wouldn't some legacy builds potentially be in other Charsets?

Seems like we should default the same way we did -- but always initialize with UTF-8, or am I missing something here? (Granted I'm pretty out of it at the moment, so that's possible.)

Some of this might be why windows breaks.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes historical builds would typically be in some other charset—which is why their charset field would be set, and we would honor that setting. It is only new builds which omit the field and thus use UTF-8 regardless of the master’s system default encoding.

Copy link
Member

@svanoort svanoort left a comment

Choose a reason for hiding this comment

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

Windows test failure -- and I'm not convinced this is safe for loading previous builds' logs if the encoding is nonstandard somehow.

Test can be strengthened only after jenkinsci/workflow-job-plugin#89 is released,
so we do not get into a cyclic dependency
(or by rewriting this aspect of the test to save content into a file and read it from test code).
@jglick
Copy link
Member Author

jglick commented Feb 12, 2018

The Windows test failure is a bit misleading. It happened to pass before because the character being expected, », is included in the ISO-8859-1 system encoding used by the CI build machine. With the complete fix, all characters may be used in log files, regardless of environment.

Copy link
Member

@svanoort svanoort left a comment

Choose a reason for hiding this comment

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

Looks safe AFAICT -- but pending a quick smoketest of the full stack.

@jglick
Copy link
Member Author

jglick commented Feb 16, 2018

the ISO-8859-1 system encoding used by the CI build machine

Well, more likely CP-1252 actually, but same applies.

@jglick
Copy link
Member Author

jglick commented Feb 16, 2018

the full stack

To be precise: jenkinsci/workflow-job-plugin#89 (and this, its dependency), plus jenkinsci/workflow-durable-task-step-plugin#64 (and jenkinsci/durable-task-plugin#61, its dependency). As a user, since the plugin manager deals with dependencies transparently, it means that you should update both Pipeline: Job and Pipeline: Nodes and Processes if you deal with funny characters. The fixes will apply to newly started builds (nothing should change for historical builds).

Copy link
Member

@svanoort svanoort left a comment

Choose a reason for hiding this comment

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

Blocking until we have some validation of the end-to-end scenarios (pending).

@jglick jglick requested a review from svanoort June 7, 2018 23:02
@jglick jglick mentioned this pull request Jun 9, 2018
6 tasks
@jglick jglick changed the title [JENKINS-31096] Always use UTF-8 for per-step log files [JEP-206] Always use UTF-8 for per-step log files Aug 6, 2018
@svanoort svanoort merged commit 01ca50a into jenkinsci:master Aug 7, 2018
@jglick jglick deleted the UTF-8-JENKINS-31096 branch August 7, 2018 21:45
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.

4 participants