Conversation
3 tasks
Replace the standalone `flyte alias` group with subcommands on the existing verbs, matching how triggers are managed: flyte update alias NAME TASK_NAME --to VERSION flyte get alias TASK_NAME [NAME] [--history] flyte delete alias NAME TASK_NAME `get alias` takes TASK_NAME first so NAME can be optional for listing, the same shape as `flyte get trigger`. History is a `--history` flag rather than its own subcommand. project/domain are now passed through to TaskAlias explicitly. Adds CLI tests for all three commands. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: davidmirror-ops <david.espejo@union.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Adds the client and CLI for task aliases — mutable named pointers to immutable task versions. Backend is in the Union cloud repo; the contract is in the companion
flyteorg/flyteproto PR.An alias like
prodlets an external caller launch a task without knowing which version is promoted, and lets an operator move that pointer without redeploying.What changed
alias=as a third version selector, sitting exactly whereversion=andauto_version=already do — not a new concept, a new way to name one:Exactly one of the three is required; the alias is sent on the wire and resolved server-side, so the caller never learns a version.
flyte.remote.TaskAliaswithset/get/listall/history/delete.setreturns(alias, previous_version)so callers can renderprod: v1.4.0 -> v1.7.0without a second lookup.A
flyte aliascommand group:setis deliberately one command for both directions — pointing at an older version is a rollback and needs no rebuild or redeploy._protocols.pyswitches to lazy annotations. Protocol bodies are evaluated at class-creation time, so namingSetTaskAliasRequestin a type hint turned an import-timeAttributeErrorinto a hard failure for anyone on aflyteidl2that has not shipped the alias messages — including every task container, which installs a releasedflyteidl2.from __future__ import annotationsfixes it. Worth a look on review: it means this module tolerates an older idl than it was built against, which is the safer default for all of these Protocols, not just the new ones.How this was tested
pytest tests/cli— 462 pass.ruff check/ruff formatclean.--helprenders. An earlier revision usedcls=common.GroupBaseon the group, which puts--project/--domainon the group callback and madeflyte alias set --helpfail withalias() got an unexpected keyword argument 'project'; the group now matches theget/delete/updateconvention and the options come fromCommandBaseon each subcommand.prodat it, launch by alias with a payload, deploy r2 and r3, confirmprodstill resolves to r1, promote to r3, roll back, read history. All steps pass, with the payload arriving intact (processed 'first' on r1). Full output in the cloud PR's test plan.TaskAlias.set_byreading asubjectfield that does not exist —EnrichedIdentityis aoneofof User/Application, now rendered the wayTaskDetailsalready rendersdeployed_by.Dependency
Needs a
flyteidl2release carrying the alias messages;pyproject.tomlcurrently pinsflyteidl2==2.0.44. Merge after the proto PR lands and the pin is bumped.https://github.com/unionai/cloud/pull/18303
flyteorg/flyte#8013