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

Bug 1834262: show relative time for pipeline run duration #5378

Merged
merged 1 commit into from May 22, 2020

Conversation

vikram-raj
Copy link
Member

Fixes:
https://issues.redhat.com/browse/ODC-2239

Analysis / Root cause:
When we are showing live duration progress, we are at the whims of the firehose kicks. This can cause our data to not live update, but jump several seconds forward.

Solution Description:
Instead of showing the exact time. Now, we show the pipeline run duration in relative time formate.

Screen shots / Gifs for design review:
Screenshot 2020-05-11 at 2 54 40 PM
Screenshot 2020-05-11 at 2 54 52 PM
Screenshot 2020-05-11 at 5 13 31 PM

cc: @openshift/team-devconsole-ux

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@vikram-raj
Copy link
Member Author

/retitle Bug 1834262: show relative time for pipeline run duration

@openshift-ci-robot openshift-ci-robot changed the title show relative time for pipeline run duration Bug 1834262: show relative time for pipeline run duration May 11, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels May 11, 2020
@openshift-ci-robot
Copy link
Contributor

@vikram-raj: This pull request references Bugzilla bug 1834262, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.5.0) matches configured target release for branch (4.5.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1834262: show relative time for pipeline run duration

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@debsmita1
Copy link
Contributor

an existing testcase needs to be fixed.

@vikram-raj vikram-raj force-pushed the odc-2239 branch 3 times, most recently from 507d199 to aae60a3 Compare May 18, 2020 07:42
Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

Sorry for the late review.

@@ -314,6 +314,30 @@ export const getPipelineRunWorkspaces = (
);
};

export const calculateRelativeTime = (startTime: string, completionTime?: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please write stand alone tests for this @vikram-raj Not sure why you updated the other test and didn't write more for just this method :)

Not sure if this would have caught your logic gap but it might have.

Comment on lines +324 to +328
if (minutesAgo > 90) {
const count = Math.round(hoursAgo);
return `about ${count} hours`;
}
if (minutesAgo > 45) {
Copy link
Contributor

Choose a reason for hiding this comment

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

What about the 'about an hour'?

More than 45m to less than 90m can have 1h 29m 59s be 'less than a hour'?

return `about ${count} hours`;
}
if (minutesAgo > 45) {
return 'less than a hour';
Copy link
Contributor

Choose a reason for hiding this comment

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

English is stupid lol. I read this and felt it was wrong, but I didn't want to say that without finding a reason for it. I think this qualities:

First thing first, to decide whether it’s a/an to a word, it all depends on how we pronounce the word itself. If we pronounce the word, and the first sound starts with vowels (a,i,u,o,e) you give ‘an’. [...]

For the word ‘Hour’, the correct pronunciation is /auer/ more or less. The first letter we hear is ‘a’ which is a vowel, so we put ‘an hour’ not ‘a hour’. I am giving you more example. Let’s take a look at the word ‘University’, to pronounce it, you say /yuniversiti/. Having said that, the very first letter you her is /y/ so you do not put ‘an university’, but ‘a university’.

[source]

Suggested change
return 'less than a hour';
return 'less than an hour';

const count = Math.round(minutesAgo);
return `about ${count} minutes`;
}
if (secondsAgo > 45) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Same issue here... this will be 'less than a minute' for up to 1m 29s.

Copy link
Contributor

@andrewballantyne andrewballantyne left a comment

Choose a reason for hiding this comment

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

/lgtm

Didn't put any thought into how you'd fix my comments, but I approve of the simple choice of just reworking the labels. 👍

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 22, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andrewballantyne, vikram-raj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2020
@openshift-merge-robot openshift-merge-robot merged commit 1ed324f into openshift:master May 22, 2020
@openshift-ci-robot
Copy link
Contributor

@vikram-raj: All pull requests linked via external trackers have merged: openshift/console#5378. Bugzilla bug 1834262 has been moved to the MODIFIED state.

In response to this:

Bug 1834262: show relative time for pipeline run duration

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@vikram-raj vikram-raj deleted the odc-2239 branch May 22, 2020 16:27
@spadgett spadgett added this to the v4.5 milestone Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/dev-console Related to dev-console lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants