Skip to content

Add state.retention option to prevent big state buckets#6925

Merged
vimtor merged 2 commits into
devfrom
feat/state-retention
Jun 26, 2026
Merged

Add state.retention option to prevent big state buckets#6925
vimtor merged 2 commits into
devfrom
feat/state-retention

Conversation

@vimtor

@vimtor vimtor commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add state.retention to keep the latest completed state snapshots
  • prune matching snapshot, event log, update, and summary history across AWS, Cloudflare, and local homes
  • permanently remove pruned S3 versions while preserving current state, secrets, and retained snapshots

Behavior

state: {
  retention: 30
}

Retention counts completed updates, not days. Omitted retention keeps all history. Pruning runs after an update and failures are non-fatal.

On AWS, retained snapshots become recovery history; noncurrent app checkpoints and stale lock versions are removed. On Cloudflare R2 and local homes, stale history objects are deleted explicitly.

Tests

  • bun run test:cli
  • go test ./pkg/project/...
  • bun run typecheck
  • bun run build:cli
  • git diff --check

bun run build:platform completed TypeScript bundling, but local Docker reported that its driver does not support multi-platform builds; command exited 0.

Supersedes #6669.

@vimtor vimtor changed the title Add state history retention Add state.retention option to prevent big state buckets Jun 24, 2026
@vimtor vimtor marked this pull request as ready for review June 24, 2026 12:15
@mclean25

Copy link
Copy Markdown
Contributor

@vimtor just finished deploying to my test stage I've been using for a long time and it seems to have worked quite well. I got Codex to summarize the before/after and logs in case any of this is useful for you:

CleanShot 2026-06-24 at 16 14 35@2x

@vimtor vimtor merged commit 8bfe1c1 into dev Jun 26, 2026
1 check passed
@vimtor vimtor deleted the feat/state-retention branch June 26, 2026 07:38
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