-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
feat: show history about completed runs in each cron workflow #11790
Conversation
Signed-off-by: juijeong8324 <juijeong8324@gmail.com> Signed-off-by: Justice <juijeong8324@gmail.com>
Signed-off-by: juijeong8324 <juijeong8324@gmail.com> Signed-off-by: Justice <juijeong8324@gmail.com>
Co-authored-by: Anton Gilgur <4970083+agilgur5@users.noreply.github.com> Signed-off-by: Justice <juijeong8324@gmail.com>
Signed-off-by: GeunSam2 <rootiron96@gmail.com>
Signed-off-by: GeunSam2 <rootiron96@gmail.com>
…juijeong8324 Fix/docs lint error for juijeong8324
Add artifact-visualization-demo.png at docs/assets Signed-off-by: Justice <juijeong8324@gmail.com>
Signed-off-by: Justice <juijeong8324@gmail.com>
Signed-off-by: YunCow <skypnal12@gmail.com>
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.
Thanks for implementing this!
There are some issues with the implementation right now, as not everything is transferable from the Workflows List. See some comments below
@@ -62,6 +73,16 @@ export const CronWorkflowDetails = ({match, location, history}: RouteComponentPr | |||
|
|||
useEffect(() => setEdited(true), [cronWorkflow]); | |||
|
|||
useEffect(() => { | |||
services.workflows.list(namespace, selectedPhases, selectedLabels, pagination).then(res => { |
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.
Ideally we can filter in the request to not retrieve unnecessary workflows, although that might not be possible
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.
this is possible (and is already done in the Workflows List filter for Cron Workflows).
you can pass in a label with the Cron Workflow name: workflows.argoproj.io/cron-workflow=<name-of-cron-workflow>
That is the only label that should be passed as there is otherwise no label filter here (that is similarly only in the sidebar on the Workflows List page)
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.
also should use async/await per #11740
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.
- Thanks for the feedback, would it be ok to change to async/await and get the data via label names like on the workflows List page?
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.
You can replace selectedLabels
(the 3rd argument to list
) with the cron-workflow
label from above
@@ -25,6 +30,12 @@ export const CronWorkflowDetails = ({match, location, history}: RouteComponentPr | |||
const [name] = useState(match.params.name); | |||
const [sidePanel, setSidePanel] = useState(queryParams.get('sidePanel')); | |||
const [tab, setTab] = useState(queryParams.get('tab')); | |||
const [workflows, setWorkflows] = useState<Workflow[]>([]); | |||
const [{selectedPhases, selectedLabels, paginationLimit}, setSelectedData] = useState<WorkflowListRenderOptions>(JSON.parse(localStorage.getItem('ListOptions/options'))); |
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.
there are no phases or labels here. those are from the sidebar filter in the Workflows List which is not present here.
pagination does not seem to be present either. there seems to be some logic here, but no UI elements for pagination.
also the localStorage
call would not apply here as it is specific to the Workflows list page
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.
- Thanks I was wondering this, would it be a good idea to put a selection or pagination in the detail cron page?
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 don't think filtering is needed right now. pagination would be nice to have, but for a first-pass MVP, I think we can leave out pagination as well.
You may have not noticed, but the main overall Cron Workflows page itself actually doesn't implement pagination yet 😅 : #10846
@@ -183,6 +204,17 @@ export const CronWorkflowDetails = ({match, location, history}: RouteComponentPr | |||
|
|||
return items; | |||
}; | |||
const updateCurrentlySelectedAndBatchActions = (newSelectedWorkflows: Map<string, Workflow>): void => { |
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.
So the checkbox is unused here. No batch actions were added to this page, so it's not useable currently
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.
- The
workflows-row
component has fixed selection and checkboxes. What do you think about creating a newcron-workflows-row
component?
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.
So ideally we would factor out a workflows-row
without checkboxes and then use that in both places.
In particular, this history view you've created could also be useful for Workflow Templates as well, so making it reusable would be useful.
That being said, that requires a bit of refactoring. As a first-pass, we could just make the checkboxes no-op for now and refactor later -- that was why I commented on the function itself and not the UI elements.
I'll leave that decision up to you for if you want to try to tackle a refactor or just leave the checkboxes non-functional for now.
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.
Thanks for the feedback, I've got a few questions and will try to revise it in the direction of your feedback 👍🙇♂️
@@ -62,6 +73,16 @@ export const CronWorkflowDetails = ({match, location, history}: RouteComponentPr | |||
|
|||
useEffect(() => setEdited(true), [cronWorkflow]); | |||
|
|||
useEffect(() => { | |||
services.workflows.list(namespace, selectedPhases, selectedLabels, pagination).then(res => { |
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.
- Thanks for the feedback, would it be ok to change to async/await and get the data via label names like on the workflows List page?
@@ -25,6 +30,12 @@ export const CronWorkflowDetails = ({match, location, history}: RouteComponentPr | |||
const [name] = useState(match.params.name); | |||
const [sidePanel, setSidePanel] = useState(queryParams.get('sidePanel')); | |||
const [tab, setTab] = useState(queryParams.get('tab')); | |||
const [workflows, setWorkflows] = useState<Workflow[]>([]); | |||
const [{selectedPhases, selectedLabels, paginationLimit}, setSelectedData] = useState<WorkflowListRenderOptions>(JSON.parse(localStorage.getItem('ListOptions/options'))); |
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.
- Thanks I was wondering this, would it be a good idea to put a selection or pagination in the detail cron page?
hello 😄 I'll hide the checkbox for now, thanks for the advice The PR got stuck in the commit log, so I'll repromote it again Thanks! |
You can rebase the branch and force push. No need to open a new PR. Or if you create a new branch with the original commits cherry-picked, you can just name it the same as the old branch and force push. |
Uncontributed commits from collaborators got mixed up in the middle, and it was really hard to pick them out 😅 And I deleted the already forked repository. Maybe juijeong8324 will PR it again! |
Gotcha. Ok.
You can always use I've had to teach a lot of engineers how to properly use |
Replaced by / followed up in #11811 |
@yunwoo-yu I noticed in this PR and in #11788 that you used your fork's |
For the next PR, I'll create a separate feat branch and upload it. Thanks 😁 And like you said, I was able to get rid of the merged fact with reflog. I had already deleted the repository so I didn't get to try it, but I'll do it the way you suggested next time. 👍 |
Fixes #11706
Motivation
Modifications
before
![image](https://private-user-images.githubusercontent.com/100748721/266794752-41bc8a9a-a77a-4927-8ad4-dc0fca6462f2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIzNDQ0NDYsIm5iZiI6MTcyMjM0NDE0NiwicGF0aCI6Ii8xMDA3NDg3MjEvMjY2Nzk0NzUyLTQxYmM4YTlhLWE3N2EtNDkyNy04YWQ0LWRjMGZjYTY0NjJmMi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzMwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDczMFQxMjU1NDZaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mNDM5MGI5NDI1ZGY3ZGRlNTBmOTRmM2YyMDc1YjAzNjYzYjM1NmVhM2E0N2ZkNzVmOWE1OWEzNjEzNjNkMDgyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9p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