Skip to content

avoid printing too long argument in Pipeline Steps visualization#71

Open
ArturHarasimiuk wants to merge 3 commits intojenkinsci:masterfrom
ArturHarasimiuk:master
Open

avoid printing too long argument in Pipeline Steps visualization#71
ArturHarasimiuk wants to merge 3 commits intojenkinsci:masterfrom
ArturHarasimiuk:master

Conversation

@ArturHarasimiuk
Copy link
Copy Markdown

In some cases it is possible that node argument will be impossible to
wrap properly and is displayed as single line. In this case pipeline
steps view becomes hard to read because right most columns are moved
beyond the screen. This requires scrolling which is not so convenient.
Also status colum is outside of screen.

This change cuts arguments list to 80 characters which should be fine
for most of usages.

Signed-off-by: Artur Harasimiuk artur.harasimiuk@intel.com

Copy link
Copy Markdown
Member

@dwnusbaum dwnusbaum left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

This change looks fine in isolation, but I'm not very familiar with the visualization code here and would need to look a little closer to understand how it works. Do you have before/after screenshots for the change?


public String get(FlowNode node) {
return ArgumentsAction.getStepArgumentsAsString(node);
return StringUtils.substring(ArgumentsAction.getStepArgumentsAsString(node), 0, 80);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe it would be better to truncate to 77, and if the text was truncated, add ... to make it clear that the content was truncated?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

sure, no problem

@ArturHarasimiuk
Copy link
Copy Markdown
Author

Thanks for the PR!

This change looks fine in isolation, but I'm not very familiar with the visualization code here and would need to look a little closer to understand how it works. Do you have before/after screenshots for the change?

Please find attached screenshots. This is based on our production system but real strings were replaced.

Before:
image

After:
image

In some cases it is possible that node argument will be impossible to
wrap properly and is displayed as single line. In this case pipeline
steps view becomes hard to read because right most columns are moved
beyond the screen. This requires scrolling which is not so convenient.
Also status colum is outside of screen.

This change cuts arguments list to 80 characters which should be fine
for most of usages.

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
@ArturHarasimiuk ArturHarasimiuk requested a review from dwnusbaum May 31, 2021 07:17
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