Skip to content

feat: validate sandbox environment resource limits and enhance form validation - #976

Merged
thesujai merged 8 commits into
mainfrom
feat/validation-for-length
Oct 8, 2026
Merged

thesujai merged 8 commits into
mainfrom
feat/validation-for-length

Conversation

@thesujai

@thesujai thesujai commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

…

Summary

Closes #

Changes

How was this tested?

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, python/trueforge_sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
Stricter request validation may reject manifests that previously succeeded (invalid env names, oversized resources), and resource ceilings depend on deployment config.

Overview
Adds server-side caps on sandbox environment CPU, memory, and disk via SANDBOX_ENVIRONMENT_*_MAX (defaults 32 cores / 64 GiB RAM / 256 GiB disk). PUT create/update now fails validation when manifest.resources exceed those limits, and the 400 response text mentions resource allocation failures.

Tightens sandbox manifest validation in Zod (mirrored in OpenAPI): environment variable keys and secret env names must match ^[A-Za-z_][A-Za-z0-9_]*$, with min/max lengths on env values; domain_allow_list and the networking secrets list get max length/item limits. Resource defaults in the schema now reference shared constants instead of hard-coded numbers.

Documents the new env vars in .env.example and records patch releases for @truefoundry/trueforge / UI in the changeset.

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

@changeset-bot

changeset-bot Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 74f1d25

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@truefoundry/trueforge Patch
@truefoundry/trueforge-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread packages/trueforge/src/schemas/sandboxEnvironment.ts 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.

Stale Bugbot comment from a previous run.

Comment thread packages/trueforge/src/schemas/sandboxEnvironment.ts Outdated
Comment thread packages/trueforge-ui/src/atoms/environments/EnvironmentFormFields.tsx Outdated
Comment thread python/trueforge_sdk/src/trueforge_sdk/types/sandbox_environment_resources.py Outdated
Comment thread packages/trueforge/src/schemas/sandboxEnvironment.ts
Comment thread packages/trueforge/src/schemas/sandboxEnvironment.ts Outdated
Comment thread packages/trueforge/src/schemas/sandboxEnvironment.ts Outdated
Comment thread packages/trueforge/src/schemas/sandboxEnvironment.ts
Comment thread packages/trueforge/src/config.ts Outdated
Comment thread packages/trueforge-ui/src/atoms/environments/EnvironmentFormFields.tsx Outdated
Comment thread packages/trueforge-ui/src/atoms/environments/EnvironmentFormFields.tsx Outdated
Comment thread packages/trueforge/src/apis/sandboxEnvironments.ts Outdated
@thesujai
thesujai enabled auto-merge (squash) October 8, 2026 03:34

@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 using default effort and found 2 potential issues.

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 2c97e34. Configure here.

Comment thread packages/trueforge/src/schemas/sandboxEnvironment.ts
Comment thread .github/fern/openapi/openapi.json
@thesujai
thesujai disabled auto-merge October 8, 2026 05:45
@thesujai
thesujai merged commit e25945d into main Oct 8, 2026
16 checks passed
@thesujai
thesujai deleted the feat/validation-for-length branch October 8, 2026 05:45
truefoundry-saas added a commit that referenced this pull request Oct 8, 2026
* feat: validate sandbox environment resource limits and enhance form validation (#976)

* feat: validate sandbox environment resource limits and enhance form validation

* test: remove sandbox environment validation tests

Co-authored-by: Cursor <cursoragent@cursor.com>

* Regenerate OpenAPI document and SDKs

* feat: add configurable resource limits for sandbox environments and update UI validation

* Regenerate OpenAPI document and SDKs

* feat: update sandbox environment resource limits and enhance validation in schemas and UI

* Regenerate OpenAPI document and SDKs

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: trueforge-dev-bot[bot] <trueforge-dev-bot[bot]@users.noreply.github.com>

* feat: enable sandbox environments by default and remove related featu… (#1002)

* feat: enable sandbox environments by default and remove related feature flag

* refactor: remove sandbox environments feature flag and enable environments UI by default

(cherry picked from commit 95f5c5c)

* fix: point Environments secrets Learn more at sandbox session docs (#969)

* feat: update sandbox documentation and link to secret management details

* fix: update Daytona API key permissions in sandbox documentation

* fix: remove redundant mention of secret rotations in sandbox documentation

(cherry picked from commit 6b42368)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: trueforge-dev-bot[bot] <trueforge-dev-bot[bot]@users.noreply.github.com>
Co-authored-by: Sujai Kumar Gupta <120925871+thesujai@users.noreply.github.com>
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.

3 participants