Add evicted/failed pods cleanup template and offline workflow validation - #2
Merged
Merged
Conversation
Mirror the net-new "Clean Up Evicted and Failed Pods" system template seeded by api-server migration V760. It deletes Evicted/Failed/Succeeded pods across a namespace (list -> approve -> delete -> verify) to reclaim resources after node-pressure evictions or completed batch runs. Brings the repo back to parity with the migration-seeded template set; V708 and V712 templates were already present.
Add engine-level checks mirroring runbook-server's internal/model/validation.go and the task registry: every task type is a known engine task type (an unknown type is rejected at sync time as "task not found"), depends_on resolves to an existing task, no duplicate task ids, no dependency cycles, supported trigger types, and well-formed durations. This is the offline equivalent of `nbctl workflow validate`: no backend or secrets, so it runs on fork PRs too, unlike the server-side check in nudgebee-infra. It runs through the existing validate.yaml CI via scripts/validate.py, so no new workflow file is needed.
blue4209211
approved these changes
Jun 28, 2026
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.
Summary
Two related changes to the system-template catalog:
New template
cleanup_evicted_and_failed_pods— mirrors the net-new "Clean Up Evicted and Failed Pods" template seeded by api-server migration V760, which was the only migration-seeded template missing from this repo (V708 and V712 were already covered). It lists, then on approval deletes, Evicted/Failed/Succeeded pods across a namespace and verifies the cleanup.Offline workflow-semantics validation in
scripts/validate.py— the schema check only validated shape. This adds the engine-level rules that runbook-server enforces ininternal/model/validation.goand its task registry:typeis a real engine task type (an unknown/mistyped type is otherwise rejected at sync time astask not found)depends_onresolves to an existing task; no self-dependencyversion == v1; well-formed durations; task-timeout sum within the workflow timeoutThis is the offline counterpart of
nbctl workflow validateused innudgebee-infra. That check is server-side (posts to a live backend, needs a self-hosted runner plusPAT/NBCTL_CONFIGsecrets), which does not fit a public repo and would not run on fork PRs. The offline version needs no backend or secrets, so it gates external contributions too, through the existingvalidate.yamlworkflow with no new CI file.Testing
python3 scripts/validate.py— all 23 templates pass.python3 scripts/gen_manifest.py --check— manifest current.depends_onare each reported and fail the run.Note for reviewers
When the engine registers a new task type, add it to the
TASK_TYPESset inscripts/validate.py(source of truth: runbook-server's task registry). This mirrors the existing controlled-vocabulary pattern already used fortags.labelsin the schema.