Skip to content

feat: per-team events TTL limit (tier + addons)#3181

Merged
jakubno merged 3 commits into
mainfrom
feat/team-events-ttl-limit
Jul 3, 2026
Merged

feat: per-team events TTL limit (tier + addons)#3181
jakubno merged 3 commits into
mainfrom
feat/team-events-ttl-limit

Conversation

@jakubno

@jakubno jakubno commented Jul 2, 2026

Copy link
Copy Markdown
Member

Allow customization for teams to extend ttl for events

jakubno added 2 commits July 2, 2026 11:17
Add events_ttl_days to tiers with extra_events_ttl_days addon column,
summed into the team_limits view. The limit flows through team limits
into SandboxConfig (proto field 26) so the orchestrator stamps it on
every published sandbox event; the events store TTL was switched to
read it in a previous change. Dashboard exposes the limit and uses it
for the sandbox record retention-expired check instead of a hardcoded
7 days.
@cursor

cursor Bot commented Jul 2, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches billing-tier limits, DB view migration, and event retention in ClickHouse; incorrect TTL wiring could drop or over-retain customer event data.

Overview
Adds configurable per-team sandbox events retention derived from tier defaults plus addon extensions, and threads that limit through storage, orchestration, and the dashboard API.

Data model & limits: A migration adds events_ttl_days on tiers (default 7) and extra_events_ttl_days on addons, and extends the team_limits view to expose events_ttl_days. Auth and dashboard team queries/types now include EventsTtlDays / EventsTTLDays on team limits.

Runtime path: Sandbox create sends EventsTtlDays on orchestrator SandboxConfig. The orchestrator stamps EventsTTLDays on published lifecycle events from stored config. ClickHouse delivery clamps TTL with shared DefaultEventsTTLDays / MaxEventsTTLDays (365) instead of a hardcoded 365 cap.

Dashboard API: Team list returns eventsTtlDays. Sandbox record splits retention: fixed 7-day retentionExpired for monitoring/logs vs team-based eventsRetentionExpired for events (capped at max TTL). OpenAPI and generated types reflect the new fields and narrowed retentionExpired wording.

Reviewed by Cursor Bugbot for commit 0571b6d. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 6.66667% with 14 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/orchestrator/pkg/server/sandboxes.go 0.00% 14 Missing ⚠️

📢 Thoughts on this report? Let us know!

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The code changes introduce compilation errors because the packages/shared/pkg/events package is not updated in this pull request to define the events.DefaultEventsTTLDays constant and the EventsTTLDays field on the SandboxEvent struct.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread packages/dashboard-api/internal/handlers/sandbox_record.go Outdated
Comment thread packages/orchestrator/pkg/server/sandboxes.go
Comment thread packages/dashboard-api/internal/handlers/sandbox_record.go Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c0f658955

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/dashboard-api/internal/handlers/sandbox_record.go Outdated
Comment thread packages/dashboard-api/internal/handlers/sandbox_record.go Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0571b6d. Configure here.

Comment thread packages/dashboard-api/internal/handlers/sandbox_record.go

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0571b6d822

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/dashboard-api/internal/handlers/sandbox_record_test.go

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0571b6d822

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/dashboard-api/internal/handlers/sandbox_record_test.go
@jakubno jakubno merged commit f76b2cb into main Jul 3, 2026
52 checks passed
@jakubno jakubno deleted the feat/team-events-ttl-limit branch July 3, 2026 06:22
charlie-e2b pushed a commit that referenced this pull request Jul 7, 2026
🤖 I have created a release *beep* *boop*
---


## 1.0.0 (2026-07-07)


### Features

* Adding client-proxy and clickhouse to e2b-artifacts
([#3210](#3210))
([5686d88](5686d88))
* **api:** LD-gated ClickHouse read switcher
([#3061](#3061))
([29e74ca](29e74ca))
* **clickhouse:** implement multi-cluster fan-out for events and stats
([#2925](#2925))
([39594c6](39594c6))
* **migrations:** add webhook deliveries table to ClickHouse
([#2741](#2741))
([f55a5bd](f55a5bd))
* **orchestrator:** LD-gated ClickHouse write fan-out feature flag
([#3152](#3152))
([f046fcf](f046fcf))
* **orch:** re-enable memory.peak per-FD reset (cgroups v2)
([#2430](#2430))
([5d9ac5f](5d9ac5f))
* per-team events TTL limit (tier + addons)
([#3181](#3181))
([f76b2cb](f76b2cb))


### Bug Fixes

* push clickhouse-migrator image to both latest and commit SHA tags
([#2954](#2954))
([3b780d5](3b780d5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: e2b-release-please[bot] <298072688+e2b-release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants