-
Notifications
You must be signed in to change notification settings - Fork 178
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
Removed Started at date #1840
Removed Started at date #1840
Conversation
To add some context, I suggested @pnaik1 not adding testing for this PR, it can only be covered with integration/component testing, and we don't have anything in place for pipelines yet. |
the test for this pr should be covered with integration testing of pipelines, but it’s not already in place |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works fine.
I think Started at
was there for scheduled runs, but Created at
and Started at
were too close(8 seconds apart in the screenshot below). Correct me if I'm wrong. Is that why we chose to remove Started at
altogether?
This screenshot is of a scheduled run(Run every minute). - what happens when we run every hour/every day? That's when the Started at
and Created at
may differ widely maybe.
Edit: Sorry I wanted to start a conversation, but clicked on "Request changes" instead.
Yes @manaswinidas you can check the whole conversation in the issue, but the main take with the outcome is summarized here: #1543 (comment) We are removing Started at (scheduled at) cause it was too close to the other values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Tested, works well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Tested. Works fine.
frontend/src/concepts/pipelines/content/pipelinesDetails/pipelineRun/PipelineRunTabDetails.tsx
Outdated
Show resolved
Hide resolved
value: asTimestamp(new Date(pipelineRunKF.scheduled_at || pipelineRunKF.created_at)), | ||
key: 'Finished at', | ||
value: | ||
pipelineRunKF.finished_at === '1970-01-01T00:00:00Z' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Define a new constant and use it here: const epoch = new Date(0).toISOString();
pipelineRunKF.finished_at === '1970-01-01T00:00:00Z' | |
pipelineRunKF.finished_at === epoch |
@@ -24,7 +24,7 @@ const PipelineRunTabDetails: React.FC<PipelineRunTabDetailsProps> = ({ | |||
workflowName, | |||
}) => { | |||
const { namespace, project } = usePipelinesAPI(); | |||
|
|||
const epoch = new Date(0).toISOString().slice(0, -5) + 'Z'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry @pnaik1, My eyes deceived me when I compared your original string constant to the output of new Date(0).toISOString()
! I didn't realize that the string values differed in the number of 0's ever so slightly. They still represent the same time however. Go back to using the string value you originally had: 1970-01-01T00:00:00Z
.
The comment about creating a constant is to make it available for others in case they need to deal with this same use case in the future. Create the constant in concepts/pipelines/const.ts
. Also, you can add a comment as to why this value exist. eg. A pipeline run that has not yet finished will have this value set as its 'finished_at' timestamp.
Let's also change the constant name to be more representative of how it's used by pipelines: INVALID_TIMESTAMP
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@christianvogt no worries , just to clarify or summarize the things , now I need to create a string constant value
(const INVALID_TIMESTAMP=1970-01-01T00:00:00Z)
in concepts/pipelines/const.ts ? and add the comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we can't just write a utility to say isEmptyDateKF(resourceKF.finished_at)
and it would just isolate this logic? I find it will be more pragmatic if we just lock away this logic away and stop writing inline functionality. Make it a common utility for all of the DS Pipelines effort.
The implementation of this method can be comparing a static string or doing proper date conversions, it doesn't matter either way as it just needs to get the job done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two solution under consideration
- Using the constant
- Implementing the utility function
@andrewballantyne @christianvogt which one do I need to go with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write a utility, use a constant or whatever you want inside it... stop making custom logic comparisons... if we can't use OOTB ISO format, don't write special code to do it. It's a kubeflow concept, write a utility for it.
a === b
doesn't need to be anything more than a comparison... isoFormat.split.doOtherThing === b
is now custom logic that you should not ever rewrite, so put it into a utility.
DRY with some intentional effort here not to make a need to refactor.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, DaoDaoNoCode, manaswinidas 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 |
Closes: #1543
Description
Removed the
Started at
date from Details tab of pipelineRunWhen pipelineRuns are immediately triggerred the
finished at
first has N/A value later after completion of runs it gets it exact valueScreencast.from.2023-09-21.17-12-08.webm
How Has This Been Tested?
finished at
displays N/A instead of epoch value and later on gets the exact valueTest Impact
N/A
Request review criteria:
Self checklist (all need to be checked):
If you have UI changes:
After the PR is posted & before it merges:
main