fix(flytectl): Update FetchWorkflowLatestVersion to fetch the latest version of a workflow
TL;DR
Fix the FetchWorkflowLatestVersion function in flytectl to return the latest workflow version.
Type
- [X] Bug Fix
- [ ] Feature
- [ ] Plugin
Are all requirements met?
- [X] Code completed
- [X] 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
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?
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.
- Does flytectl have a built-in filter function?
- How can I obtain the sorting key?
- For retrieving the newest workflow version, is the sequence FetchWorkflowLatestVersion -> Sort by Key-> Filter Limit 1 correct?
- Does fetching the latest launch plan follow a similar process?
Oh no worries, thank you very much @LeHyperion!
- 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.
-
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
Filterobject. -
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.
-
Does fetching the latest launch plan follow a similar process? Yup - could you make it there too?
Thanks again.
@LeHyperion just checking in to see if you need any help with this?