[BUG] Flytectl returns the oldest workflow version when using --latest flag
Describe the bug
Description:
When attempting to retrieve the latest version of a workflow using the --latest flag with flytectl get workflow, I am presented with the oldest version instead of the expected latest version.
Expected behavior
Expected Result: The latest version of the specified workflow should be returned.
Actual Result: The oldest version of the workflow is returned.
Additional context to reproduce
Steps to Reproduce:
- Run the following command:
flytectl get workflow -p MY_PROJECT -d DEV WORKFLOW_NAME --latest
- Observe the returned workflow version.
Environment/Configuration:
- Flytectl version: 0.6.45
Additional Notes: This issue could potentially impact users who rely on fetching the latest version for their operational needs.
Screenshots
No response
Are you sure this issue hasn't been raised already?
- [X] Yes
Have you read the Code of Conduct?
- [X] Yes
Thank you for opening your first issue here! 🛠
Should this be wVersions[len(wVersions)-1].Id.Version?
https://github.com/flyteorg/flytectl/blob/145bc5c01db75a21254626ecba0e01d6dbea7851/pkg/ext/workflow_fetcher.go#L52C11-L52C31
@LeHyperion , since you already did an initial investigation, can you open a PR? It should be fairly simple to build a local copy of flytectl, just follow https://github.com/flyteorg/flytectl/blob/master/docs/source/contribute.rst.
I can help review the change.
Hi @eapolinario here is the PR for the fix. https://github.com/flyteorg/flytectl/pull/418
Hello 👋, this issue has been inactive for over 9 months. To help maintain a clean and focused backlog, we'll be marking this issue as stale and will engage on it to decide if it is still applicable. Thank you for your contribution and understanding! 🙏
@eapolinario or @wild-endeavor found this one with the stale label and created a quick PR to get this out. Any chance you could take a looK?