Add ARCHIVED state to LaunchPlanState enum#7056
Open
blaketastic2 wants to merge 2 commits intoflyteorg:masterfrom
Open
Add ARCHIVED state to LaunchPlanState enum#7056blaketastic2 wants to merge 2 commits intoflyteorg:masterfrom
blaketastic2 wants to merge 2 commits intoflyteorg:masterfrom
Conversation
Launch plan versions accumulate over time as each pyflyte register creates new versions. This adds an ARCHIVED state (value=2) so old versions can be marked and filtered out of list queries (e.g. ne(state,2)) without conflating them with INACTIVE, which has meaning in the active/inactive schedule lifecycle. Archiving a launch plan disables any active schedule (same as deactivate) but preserves the ability to launch executions from it. Changes: - flyteidl: Add ARCHIVED=2 to LaunchPlanState enum, regenerate bindings - flyteadmin: Add archiveLaunchPlan handler in UpdateLaunchPlan switch - flytectl: Repurpose --archive flag to set ARCHIVED state (was a deprecated alias for --deactivate) Signed-off-by: Blake Naccarato <[email protected]> Signed-off-by: Blake <[email protected]>
Remove "hidden from list queries by default" language from proto comments and CLI help. Archived launch plans are not automatically excluded from list results — callers must add a ne(state,2) filter. Signed-off-by: Blake Naccarato <[email protected]> Signed-off-by: Blake <[email protected]>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7056 +/- ##
==========================================
- Coverage 56.95% 56.92% -0.04%
==========================================
Files 931 931
Lines 58188 58225 +37
==========================================
+ Hits 33141 33143 +2
- Misses 22005 22040 +35
Partials 3042 3042
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Tracking issue
N/A — this addresses a common operational pain point with no existing tracking issue.
Why are the changes needed?
Every
pyflyte registercreates new launch plan versions, and nothing cleans up old ones. Over time this leads to heavier list queries, more data to page through, and increased memory pressure on Admin.Today the only cleanup mechanism is
UpdateLaunchPlanto set stateINACTIVE, butINACTIVEhas meaning in the active/inactive schedule lifecycle — conflating "old cruft" with "intentionally deactivated" makes filtering unreliable. Users who discover downstream launch plans viaListLaunchPlans(e.g. filtering onworkflow.short_description) get back all versions across all deploys when they only care about the latest.Adding
ARCHIVED(value2) gives operators a distinct state they can set on old versions and filter out (ne(state,2)), enabling a scheduled cleanup pattern: keep the most recent N versions per named entity, archive the rest, never touch the active one.What changes were proposed in this pull request?
flyteidl (proto + generated code):
ARCHIVED = 2to theLaunchPlanStateenum inlaunch_plan.protoflyteadmin:
archiveLaunchPlanmethod toLaunchPlanManager— same behavior asdisableLaunchPlan(disables any active schedule, updates the DB) but sets state toARCHIVEDinstead ofINACTIVEcase admin.LaunchPlanState_ARCHIVEDto theUpdateLaunchPlanswitchflytectl:
--archiveflag to setLaunchPlanState_ARCHIVEDinstead of mapping toINACTIVE. This flag was previously deprecated in [Feature]Remove namespace from all non kustomize configuration #449 as an alias for--deactivatebecause "archive" was misleading when noARCHIVEDstate existed. Now that the state exists,--archivedoes what the name implies.--activate,--deactivate,--archive)deprecatedCommandWarningfunctionNote on
--archivebehavioral change: Prior to this PR,--archivewas a deprecated alias for--deactivate(set state toINACTIVE/0). After this PR,--archivesets state toARCHIVED/2. Anyone relying on the deprecated--archiveflag to deactivate launch plans should switch to--deactivate.How was this patch tested?
TestLaunchPlanCanBeArchivedin flytectl to verify--archivenow setsARCHIVEDstateflyteadminandflytectlcompile cleanlyLabels
ARCHIVEDlaunch plan stateCheck all the applicable boxes