OLS-3565 Add oc agentic run cleanup CLI command - #413
Conversation
Cherry-pick from ols-3566-ttl-lifecycle branch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add batch deletion of terminal AgenticRun resources with filters: - --state: comma-separated terminal states (completed,failed,denied,etc) - --older-than: duration filter using status.terminalTime (supports Nd) - --dry-run: list matching runs without deleting - -A: all namespaces scope Deletion errors are reported per-run but do not halt the batch. Runs without status.terminalTime are skipped with a warning when --older-than is used. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 19 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@sriroopar: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
oc agentic run cleanupsubcommand for batch deletion of terminal AgenticRun resources during maintenance windows--state), age (--older-than), and namespace scope (-A)--dry-runmode to preview what would be deleted without actingCLI Interface
--older-thanNdfor days)""(all terminal)--state--namespace/-A--dry-runfalseBehavior
DerivePhase()— consistent with existing CLI commands--older-thanusesstatus.terminalTime; runs without it are skipped with a warningFiles Changed
cli/run/cleanup.gocli/run/cleanup_test.gocli/run/run.goTest plan
make testpasses (all existing + 10 new cleanup tests)make vetpassesgo build ./cmd/oc-agentic/compilesoc agentic run cleanupdeletes all terminal runs--statefilters by terminal state--older-thanfilters bystatus.terminalTime--dry-runlists without deleting-Ascopes to all namespacesterminalTimeare skipped with warning when--older-thanusedDepends on: #412
🤖 Generated with Claude Code