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

Add download option to 'Console output', move 'View as plain text' and 'Copy' buttons to app bar #9169

Merged
merged 12 commits into from
May 22, 2024

Conversation

janfaracik
Copy link
Contributor

@janfaracik janfaracik commented Apr 14, 2024

Before
image

After
image

Small MR to add a 'Download' link to the console output, as well as to move the controls to the app bar so that they're grouped. Let me know your thoughts on the updated placement - happy to discuss alternatives.

Testing done

  • Copy button works as before
  • View as plain text works as before
  • Download button downloads the full log

Proposed changelog entries

  • Add download option to 'Console output', move 'View as plain text' and 'Copy' buttons to app bar

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@jenkinsci/sig-ux

Before the changes are marked as ready-for-merge:

Maintainer checklist

@timja timja added rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted web-ui The PR includes WebUI changes which may need special expertise labels Apr 14, 2024
Copy link
Contributor

@mawinter69 mawinter69 left a comment

Choose a reason for hiding this comment

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

Is the copy option really the best thing as being the one that is directly accessible?
So far I never had really the need to copy the logs. But looking at the log in plain text I do from time to time

<l:copyButton ref="out" label="${%Copy}" />
<l:overflowButton>
<dd:custom>
<a class="jenkins-dropdown__item" href="consoleText" download="${it.displayName}.txt">
Copy link
Contributor

@mawinter69 mawinter69 Apr 14, 2024

Choose a reason for hiding this comment

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

Is it really useful to use the displayname here? If I choose a displayname that contains a / this wouldn't be saveable.
something like
${it.parent.name}-{it.number}.txt would guarantee a valid filename

Copy link
Member

Choose a reason for hiding this comment

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

If I choose a displayname that contains a / this wouldn't be saveable.

Per https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-download

The attribute may have a value; the value, if any, specifies the default filename that the author recommends for use in labeling the resource in a local file system. There are no restrictions on allowed values, but authors are cautioned that most file systems have limitations with regard to what punctuation is supported in filenames, and user agents are likely to adjust filenames accordingly.

Trying this PR and DOM editing in Firefox, I get the file foo_bar_#1.txt from the attribute value foo/bar/#1.txt.

(parent.fullName might still be better though. Unsure whether we should go for display names, there's arguments for and against IMO)

@mawinter69
Copy link
Contributor

mawinter69 commented Apr 14, 2024

Is the copy option really the best thing as being the one that is directly accessible? So far I never had really the need to copy the logs. But looking at the log in plain text I do from time to time

probably OK to have it like proposed.

@uhafner
Copy link
Member

uhafner commented Apr 17, 2024

It took me a while to understand that the result is visible in freestyle jobs only. Isn't the PR that unifies the console in pipelines and freestyle jobs already merged?

I think it is a good idea to move the actions to the app bar. I'm not sure why the copy action is a button (I never use this action, does it copy the whole log or the visible section?), but I very often use the "raw console" link. Maybe we can show the latter as button as well (or only this one). The app bar has a lot of space that is not used yet. Do we have anonymous user statistics about such preferences?

@mawinter69
Copy link
Contributor

but I very often use the "raw console" link

same for me

@daniel-beck
Copy link
Member

I'm not sure why the copy action is a button (I never use this action, does it copy the whole log or the visible section?)

My guess is because it's a recently added action (#8960) that has been previously implemented like this? Copying seems like the least needed use case, and between view raw, and download raw, even seems redundant. (And it only copies the visible section, via JS.)

@janfaracik
Copy link
Contributor Author

I'm not sure why the copy action is a button (I never use this action, does it copy the whole log or the visible section?)

My guess is because it's a recently added action (#8960) that has been previously implemented like this? Copying seems like the least needed use case, and between view raw, and download raw, even seems redundant. (And it only copies the visible section, via JS.)

Essentially that - I didn't want to undo the existing work, happy to prioritise the order of download/complete log however as I agree.

@janfaracik
Copy link
Contributor Author

Updated it so that there's no longer an overflow menu - all actions are top level now.

image

@yaroslavafenkin yaroslavafenkin added the security-approved @jenkinsci/core-security-review reviewed this PR for security issues label Apr 30, 2024
@basil basil added the needs-ath-build Needs to run through the full acceptance-test-harness suite label May 14, 2024
@janfaracik
Copy link
Contributor Author

ATH passing - jenkinsci/acceptance-test-harness#1563

@timja timja added ath-successful This PR has successfully passed the full acceptance-test-harness suite and removed needs-ath-build Needs to run through the full acceptance-test-harness suite labels May 17, 2024
@timja timja requested a review from mawinter69 May 19, 2024 10:14
Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

Needs a matching PR to Pipeline (probably workflow-job) as well.

Apart from that LGTM

Copy link
Contributor

@mawinter69 mawinter69 left a comment

Choose a reason for hiding this comment

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

looks good. One minor thing but not blocking

@janfaracik
Copy link
Contributor Author

Needs a matching PR to Pipeline (probably workflow-job) as well.

Apart from that LGTM

Done - thanks! jenkinsci/workflow-job-plugin#439

Copy link
Member

@timja timja left a comment

Choose a reason for hiding this comment

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

/label ready-for-merge


This PR is now ready for merge, after ~24 hours, we will merge it if there's no negative feedback.

Thanks!

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label May 21, 2024
@timja timja merged commit caea9bd into jenkinsci:master May 22, 2024
17 checks passed
@timja timja deleted the revamp-console-app-bar branch May 22, 2024 15:09
@FredericSouchon
Copy link

Hello,

as I told in JENKINS-73657, This is a real regression because it is requires to open the "console output" view that may crash the browser if the log is heavy enough. this use case may have been forgotten.

Could you submit the comeback of the "view as plain text" option in the lateral menu ?

Thanks in advance,

@JanKirsch
Copy link

Hi there, same here.

This is a real regression because it is requires to open the "console output" view that may crash the browser if the log is heavy enough. this use case may have been forgotten.

Yes, that doesn't seem to have been taken into account. On our Jenkins we have huge logs, which leads to a broken "Console Output" view at approx. 80% of our jobs. We have to wait to get to the now hidden "View as plain text" button, because it is not clickable until the browser is able to breath again. That makes me very sad. I totally understand why this change come up, but unfortunately the "Console Output" view is not stable enough to handle huge logs.

Could you submit the comeback of the "view as plain text" option in the lateral menu ?

Please bring it back or come up with a configurable Job "Navigation menu" or improve the "Console Output" view. No matter what you do, please make the community happy again :)

@mawinter69
Copy link
Contributor

Could be easily done with a plugin.

@mawinter69
Copy link
Contributor

jenkins-infra/repository-permissions-updater#4063

@mirao
Copy link

mirao commented Sep 24, 2024

Since 2.462.1, we can see the bug https://issues.jenkins.io/browse/JENKINS-73683.
As this pull request contains some changes related to console output, is it possible that it caused the issue with timestamps as mentioned in that bug?

@MarkEWaite
Copy link
Contributor

Since 2.462.1, we can see the bug https://issues.jenkins.io/browse/JENKINS-73683. As this pull request contains some changes related to console output, is it possible that it caused the issue with timestamps as mentioned in that bug?

It seems unlikely to me, but you can experiment with it by building a Jenkins core yourself with this pull request reverted. See the CONTRIBUTING file for the instructions to build Jenkins core yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ath-successful This PR has successfully passed the full acceptance-test-harness suite ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback rfe For changelog: Minor enhancement. use `major-rfe` for changes to be highlighted security-approved @jenkinsci/core-security-review reviewed this PR for security issues web-ui The PR includes WebUI changes which may need special expertise
Projects
None yet
Development

Successfully merging this pull request may close these issues.