Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /ViperJuice_Code-Index-MCP /mcp_server /cli /retention_commands.py
| """CLI commands for release retention / pruning.""" | |
| from __future__ import annotations | |
| from typing import Optional | |
| import click | |
| from mcp_server.artifacts.retention import prune_releases | |
| def retention(): | |
| """Manage release retention for index artifact releases.""" | |
| def prune( | |
| repo: str, | |
| older_than_days: Optional[int], | |
| keep_latest_n: Optional[int], | |
| dry_run: bool, | |
| ) -> None: | |
| """Prune old releases according to retention policy.""" | |
| if older_than_days is None and keep_latest_n is None: | |
| click.echo( | |
| "No retention criteria specified. Use --older-than-days and/or --keep-latest-n.", | |
| err=True, | |
| ) | |
| raise click.Abort() | |
| label = "Candidates" if dry_run else "Deleted" | |
| try: | |
| refs = prune_releases( | |
| repo, | |
| older_than_days=older_than_days, | |
| keep_latest_n=keep_latest_n, | |
| dry_run=dry_run, | |
| ) | |
| except Exception as exc: | |
| click.echo(f"Error: {exc}", err=True) | |
| raise click.Abort() | |
| if not refs: | |
| click.echo(f"{label}: none") | |
| return | |
| click.echo(f"{label} ({len(refs)}):") | |
| for ref in refs: | |
| click.echo(f" {ref.tag_name} created={ref.created_at}") | |
Xet Storage Details
- Size:
- 1.8 kB
- Xet hash:
- 57c53e93d168c0ea8f61c6583bf229e0b5487cd7af9711f2ff517dce9fd6ff6e
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.