Skip to content

Add evicted/failed pods cleanup template and offline workflow validation - #2

Merged
blue4209211 merged 2 commits into
mainfrom
feat/cleanup-evicted-failed-pods-template
Jun 28, 2026
Merged

Add evicted/failed pods cleanup template and offline workflow validation#2
blue4209211 merged 2 commits into
mainfrom
feat/cleanup-evicted-failed-pods-template

Conversation

@mayankpande88

Copy link
Copy Markdown
Contributor

Summary

Two related changes to the system-template catalog:

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

  2. Offline workflow-semantics validation in scripts/validate.py — the schema check only validated shape. This adds the engine-level rules that runbook-server enforces in internal/model/validation.go and its task registry:

    • every task type is a real engine task type (an unknown/mistyped type is otherwise rejected at sync time as task not found)
    • depends_on resolves to an existing task; no self-dependency
    • no duplicate task ids; no dependency cycles
    • supported trigger types; version == v1; well-formed durations; task-timeout sum within the workflow timeout

    This is the offline counterpart of nbctl workflow validate used in nudgebee-infra. That check is server-side (posts to a live backend, needs a self-hosted runner plus PAT/NBCTL_CONFIG secrets), 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 existing validate.yaml workflow with no new CI file.

Testing

  • python3 scripts/validate.py — all 23 templates pass.
  • python3 scripts/gen_manifest.py --check — manifest current.
  • Negative check: a planted typo'd task type, duplicate id, and dangling depends_on are each reported and fail the run.

Note for reviewers

When the engine registers a new task type, add it to the TASK_TYPES set in scripts/validate.py (source of truth: runbook-server's task registry). This mirrors the existing controlled-vocabulary pattern already used for tags.labels in the schema.

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
blue4209211 merged commit 17c74f8 into main Jun 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants