Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

fix(flytectl): Update FetchWorkflowLatestVersion to fetch the latest version of a workflow #418

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LeHyperion
Copy link

TL;DR

Fix the FetchWorkflowLatestVersion function in flytectl to return the latest workflow version.

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

The FetchWorkflowLatestVersion function in workflow_fetcher.go has been updated to retrieve the latest workflow version by using the last element in the wVersions slice. This change ensures that the most recent version is fetched when calling this function.

Tracking Issue

fixes 3972

…version of a workflow

The FetchWorkflowLatestVersion function in workflow_fetcher.go has been updated to retrieve the latest version of a workflow by using the last element in the wVersions slice. This change ensures that the most recent version is fetched when calling this function.
@wild-endeavor
Copy link
Contributor

would you be willing to make a few more changes? I think this function is wrong, or the name is wrong. we should loop through the filters, and if there isn't a limit filter we should add a limit of 1 to the existing list of filters, and then we should sort https://docs.flyte.org/en/latest/concepts/admin.html#sorting-syntax. Is this something you could add please?

@LeHyperion
Copy link
Author

would you be willing to make a few more changes? I think this function is wrong, or the name is wrong. we should loop through the filters, and if there isn't a limit filter we should add a limit of 1 to the existing list of filters, and then we should sort https://docs.flyte.org/en/latest/concepts/admin.html#sorting-syntax. Is this something you could add please?

I'm new to contributing, so I appreciate your patience with my inquiries.

  1. Does flytectl have a built-in filter function?
  2. How can I obtain the sorting key?
  3. For retrieving the newest workflow version, is the sequence FetchWorkflowLatestVersion -> Sort by Key-> Filter Limit 1 correct?
  4. Does fetching the latest launch plan follow a similar process?

@wild-endeavor
Copy link
Contributor

Oh no worries, thank you very much @LeHyperion!

  1. Does flytectl have a built-in filter function? so filters are just strings in the service definition, so admin will expect strings to be there but it looks like flytectl does implement its own filter object which is what's used in the FetchWorkflowLatestVersion function.

Looking at this more, I think what's happening is that this filter object is not correct. If we just change it, it should work.

  1. How can I obtain the sorting key? I don't think you need to obtain the sort key. Looking at the api, you should be able to specify the sort in the Filter object.

  2. For retrieving the newest workflow version, is the sequence FetchWorkflowLatestVersion -> Sort by Key-> Filter Limit 1 correct? hmm not sure what you mean. but see the answer to 1. I think that's all that's needed. maybe we make another Filter object to represent latest.

  3. Does fetching the latest launch plan follow a similar process? Yup - could you make it there too?

Thanks again.

@davidmirror-ops
Copy link

@LeHyperion just checking in to see if you need any help with this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Flytectl returns the oldest workflow version when using --latest flag
3 participants