flyte icon indicating copy to clipboard operation
flyte copied to clipboard

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

Open LeHyperion opened this issue 2 years ago • 5 comments

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:

  1. Run the following command:
flytectl get workflow -p MY_PROJECT -d DEV WORKFLOW_NAME --latest
  1. 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

LeHyperion avatar Aug 18 '23 15:08 LeHyperion

Thank you for opening your first issue here! 🛠

welcome[bot] avatar Aug 18 '23 15:08 welcome[bot]

Should this be wVersions[len(wVersions)-1].Id.Version?

https://github.com/flyteorg/flytectl/blob/145bc5c01db75a21254626ecba0e01d6dbea7851/pkg/ext/workflow_fetcher.go#L52C11-L52C31

LeHyperion avatar Aug 18 '23 16:08 LeHyperion

@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.

eapolinario avatar Aug 18 '23 18:08 eapolinario

Hi @eapolinario here is the PR for the fix. https://github.com/flyteorg/flytectl/pull/418

LeHyperion avatar Aug 21 '23 15:08 LeHyperion

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! 🙏

github-actions[bot] avatar May 18 '24 00:05 github-actions[bot]

@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?

RRap0so avatar Sep 03 '24 06:09 RRap0so