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 job start and duration time to job page #458

Conversation

mr-remington
Copy link
Contributor

This PR adds the job start time and job duration to the table view on the jobs page along with minor formatting to make it cleaner and easier to use:

  • ID column header is now left aligned
  • Duration column is new and sortable

For the ID column custom displayNames are accounted for w ellipsis cutoff. This PR addresses issue #449. Note I made some minor cleanups from the screenshot in the issue. Here is the final view:
full-page

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@mr-remington mr-remington requested a review from a team as a code owner June 28, 2024 05:50
@mr-remington mr-remington force-pushed the add-job-start-and-duration-time branch from 57c58e1 to 3a508f8 Compare June 28, 2024 06:20
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.

Hey I've pushed a few changes so it doesn't take up as much room, let me know what you think.

I've left some inline comments or TODOs in the code where it could be improved

FYI I'll be away for ~2 weeks or so in a few hours and I won't merge this before leaving as I don't want to be not around in case there's an issue.


SimpleDateFormat sdf = new SimpleDateFormat("d MMM, hh:mm", Locale.getDefault());
// TODO support user timezones from UserProperty
sdf.setTimeZone(TimeZone.getDefault());
Copy link
Member

Choose a reason for hiding this comment

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

Users are able to set their own timezone in their user configuration, it would be good to support this, and also the Jenkins timezone property won't be supported by this core Java feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed I would have much rather passed epoch into RunInfo, also respecting a users preference for clock notation(12/24) but that information isn't bubbled up to this plugin yet..

// TODO support user timezones from UserProperty
sdf.setTimeZone(TimeZone.getDefault());
// TODO display full duration on hover but continue shortened for display
this.startTime = sdf.format(new Date(run.getStartTimeInMillis()));
Copy link
Member

Choose a reason for hiding this comment

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

I think there was too much info there before, I've shortened it but it would be good to show the full version on hover (ideally client side formatted I just didn't have much time)

<p>{run.displayName}</p>
</a>
<div className="PWGx-Start">
<span>{run.startTime} - {jobStatus === "in_progress" ? "Running..." : run.duration}</span>
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be good to move this out to its own 'chip' but I wasn't able to make it work in the 10mins or so I had (the display flex column wants each on their own line)

this is probably ok though

image

@timja timja added the enhancement New feature or request label Jun 28, 2024
@mr-remington mr-remington marked this pull request as draft July 6, 2024 16:08
@oneingan
Copy link

Any help needed to move this forward?

@mr-remington
Copy link
Contributor Author

Closing due to age. Will revisit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants