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

[Pre-release] Workflows are shown as not archived after workflow GC #11367

Closed
3 tasks done
toyamagu-2021 opened this issue Jul 15, 2023 · 7 comments · Fixed by #11413
Closed
3 tasks done

[Pre-release] Workflows are shown as not archived after workflow GC #11367

toyamagu-2021 opened this issue Jul 15, 2023 · 7 comments · Fixed by #11413
Labels
P1 High priority. All bugs with >=5 thumbs up that aren’t P0, plus: Any other bugs deemed high priority type/bug

Comments

@toyamagu-2021
Copy link
Member

toyamagu-2021 commented Jul 15, 2023

Pre-requisites

  • I have double-checked my configuration
  • I can confirm the issues exists when I tested with :latest
  • I'd like to contribute the fix myself (see contributing guide)

What happened/what you expected to happen?

AhivedWorkflows are marked Archive: false in UI after workflows GC.

  1. Submit Workflow, then marked as Archived.
    image
  2. After GC, workflows marked as Pending
    image
  3. Workflow are marked as not archived in workflow list page
    image

Should we change this logic?

export function isArchivedWorkflow(wf: Workflow): boolean {
return wf.metadata.labels && wf.metadata.labels[archivalStatus] === 'Archived';
}

Version

master

Paste a small workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.

ANY Workflows

Logs from the workflow controller

N/A

Logs from in your workflow's wait container

N/A
@toyamagu-2021 toyamagu-2021 changed the title Workflow are not saved as workflows.argoproj.io/workflow-archiving-status=Archived Workflows are shown as not archived after workflow GC Jul 15, 2023
@terrytangyuan
Copy link
Member

This should probably be fixed in the backend. Those workflows with labels "Pending" are the ones in the database. They didn't become "Archived" yet since they were still being archived. We should change it to "Archived" before saving in the database.

@toyamagu-2021
Copy link
Member Author

Thanks.
Firstly, I think we should change serverside, but I noticed it may intended behavior as commended below.

// The archived workflow we saved in the database will only have "Pending" as the archival status.
// We want to only keep the workflow that has the correct label to display correctly in the UI.

It is easy to save workflows as Archived in the following function, but I worry break related logic....

func (r *workflowArchive) ArchiveWorkflow(wf *wfv1.Workflow) error {

If you agree with changing the server side, I try to write a PR.

@terrytangyuan
Copy link
Member

terrytangyuan commented Jul 15, 2023

We can simply the logic in the first link you posted to the following: mergedWfs = append(mergedWfs, v[0])

Yes that's good direction.

@alexec
Copy link
Contributor

alexec commented Jul 16, 2023

You can’t label a workflow as Archived until after it is archived because any failure during archiving will result in the workflow never getting archived, then getting deleted forever. Workflows in the archive will always be labeled Pending.

What about a new Archiving status?

@terrytangyuan
Copy link
Member

@alexec I meant that we don't modify the live workflow YAML at all. We only use modify the YAML that's sent to the database. So in the live workflow, the archival status will still reflect the true status. The archived workflow YAML in the database will be have "Archived" label since it's already saved in the database.

@toyamagu-2021 toyamagu-2021 changed the title Workflows are shown as not archived after workflow GC [Pre-release] Workflows are shown as not archived after workflow GC Jul 17, 2023
@toyamagu-2021
Copy link
Member Author

OK, I think we should distinguish the following status for clarification.

  1. Pending: has live manifest and is not archived
  2. Archived: has live manifest and is archived
  3. Retrieved: retrieved from DB (may or a may not be lived)

We should distinguish 2 from 3 for batch deletion on the frontend or convenience.
What do you think about this?
sample PR: toyamagu-2021#3

@terrytangyuan
Copy link
Member

Sounds good to me.

@JPZ13 JPZ13 added the P3 Low priority label Jul 20, 2023
@terrytangyuan terrytangyuan added P1 High priority. All bugs with >=5 thumbs up that aren’t P0, plus: Any other bugs deemed high priority and removed P3 Low priority labels Jul 21, 2023
terrytangyuan pushed a commit that referenced this issue Jul 21, 2023
Signed-off-by: toyamagu2021@gmail.com <toyamagu2021@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority. All bugs with >=5 thumbs up that aren’t P0, plus: Any other bugs deemed high priority type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants