Skip to content

Conversation

@elliotgunton
Copy link
Contributor

@elliotgunton elliotgunton commented Nov 11, 2025

Fixes #15015

Modifications

  • Remove the error return from the workflowArchive GetWorkflow function, just log a debug message instead
  • Add OrderBy(-startedat) to the database query so we can retrieve the latest workflow (via the subsequent One function)

Verification

Tested with make start PROFILE=postgres UI=true and then curl -k http://localhost:2746/api/v1/workflows/argo/<workflow-name> at each stage described in the issue. If there are multiple persisted workflows with the same name (but different uids) then the GetWorkflow endpoint now return the most recently finished workflow, matching non-archived behaviour.

@elliotgunton elliotgunton marked this pull request as ready for review November 11, 2025 15:22
@Joibel Joibel changed the title fix: return latest workflow for retried-persisted workflows fix!: return latest workflow for retried-persisted workflows Nov 11, 2025
Copy link
Member

@Joibel Joibel left a comment

Choose a reason for hiding this comment

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

What happens if you have an archived and a live (in cluster) workflow?

@elliotgunton elliotgunton force-pushed the fix-api-for-retried-persisted-workflows branch from 7949cd0 to 1d93618 Compare November 11, 2025 16:11
@elliotgunton
Copy link
Contributor Author

What happens if you have an archived and a live (in cluster) workflow?

It will not fall into the archived GetWorkflow path here

wf, origErr := wfClient.ArgoprojV1alpha1().Workflows(namespace).Get(ctx, name, options)
// fallback to retrieve from archived workflows
if wf == nil || origErr != nil {

@elliotgunton elliotgunton requested a review from Joibel November 12, 2025 08:45
@Joibel Joibel added the cherry-pick/3.7 Cherry-pick this to release-3.7 label Nov 12, 2025
@Joibel Joibel merged commit e98b6b3 into argoproj:main Nov 12, 2025
43 checks passed
@argo-cd-cherry-pick-bot
Copy link

❌ Cherry-pick failed for 3.7. Please check the workflow logs for details.

Joibel pushed a commit that referenced this pull request Nov 12, 2025
(cherry picked from commit e98b6b3)

Signed-off-by: Elliot Gunton <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Joibel pushed a commit that referenced this pull request Nov 12, 2025
(cherry picked from commit e98b6b3)

Signed-off-by: Elliot Gunton <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Joibel added a commit that referenced this pull request Nov 12, 2025
…pick #15030 for 3.7) (#15032)

Signed-off-by: Elliot Gunton <[email protected]>
Signed-off-by: Alan Clucas <[email protected]>
Co-authored-by: Elliot Gunton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick/3.7 Cherry-pick this to release-3.7

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retried "persisted" workflows are not fetchable from the API

2 participants