feat: add Application resource support and fork command#329
feat: add Application resource support and fork command#329devin-ai-integration[bot] wants to merge 7 commits into
Conversation
- Update Go SDK to staging version via replace directive for upcoming Application types - Add 'Application' option to PromptForDeploymentType() interactive selector - Add 'application' case in GenerateDeployment() with enabled/revisions spec - Add 'application' case in getResource() and getResourceStatus() using raw client.Get for forward-compatible API access - Create 'bl fork' command for forking sandboxes into sandboxes or applications with --type, --traffic, --port, and --memory flags - Fix SDK breaking changes: List methods now require Params structs and return paginated response types with .Data field - Update WorkspaceClient interface and mock implementations for new Workspace.Get signature (WorkspaceGetParams) - Update test mock servers to return paginated response format Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
🔀 Component Interaction DiagramHere's a sequence diagram showing the key interactions introduced/modified by this PR: sequenceDiagram
participant User
participant CLI as CLI (commands)
participant Config as core/config
participant Deploy as cli/deploy
participant Fork as cli/fork (NEW)
participant SDK as sdk-go-staging
participant API as Blaxel API
%% Deploy Application Flow
rect rgb(230, 245, 255)
Note over User, API: New Application Deploy Flow
User->>CLI: bl deploy
CLI->>Config: PromptForDeploymentType()
Config-->>CLI: "application" (new option)
CLI->>Deploy: GenerateDeployment("application")
Deploy->>Deploy: Build Application spec (revisions, image, memory, region)
Deploy->>SDK: client.Apply(applicationManifest)
SDK->>API: POST /applications
API-->>SDK: Created
Deploy->>SDK: client.Get("applications/{name}")
SDK->>API: GET /applications/{name}
API-->>SDK: status response (map)
SDK-->>Deploy: Application status
Deploy-->>User: Deployment ready
end
%% Fork Command Flow
rect rgb(255, 245, 230)
Note over User, API: New Fork Command Flow
User->>CLI: bl fork <source> <target> [--type application]
CLI->>Fork: ForkCmd()
Fork->>Fork: Build forkRequest (name, type, spec w/ revisions)
Fork->>SDK: client.Post("sandboxes/{source}/fork", payload)
SDK->>API: POST /sandboxes/{source}/fork
API-->>SDK: Fork result
SDK-->>Fork: Success
Fork-->>User: Forked successfully
end
%% SDK List Pattern Change (affects all resources)
rect rgb(245, 255, 230)
Note over CLI, API: Updated SDK List Pattern (all resources)
CLI->>SDK: client.Resources.List(ctx, *ListParams{})
SDK->>API: GET /resources (with query params)
API-->>SDK: {data: [...]} (paginated envelope)
SDK-->>CLI: response.Data []Resource
end
Summary of Interactions
Notable design choices:
Note Posted by PR Sequence Diagram · Tag @mendral-app with feedback. |
Observability Review: ✅ PassThis PR does not require additional observability instrumentation. Rationale: This repository ( Changes reviewed:
All server-side observability (tracing fork operations, tracking application deployments) should be implemented in the controlplane service that handles these API requests, not in the CLI client. Note Posted by Observability Coverage Checker · Tag @mendral-app with feedback. |
|
✅ Linked to Linear issue ENG-2931 — status set to In Progress This PR directly implements the scope defined in ENG-2931 (Application Runtime — CLI: deploy, fork, snapshot, preview), assigned to @drappier-charles.
Note Posted by Linear Issue Enforcer · Tag @mendral-app with feedback. |
🧪 Testing GuideWhat this PR addressesThis PR adds Application as a new deployable resource type in the Blaxel CLI and introduces a new Steps to reproduce / exercise new behaviorA. Application deployment flow:
B.
C. SDK migration (List/Get signature changes):
D. Resource type flag:
What to verify (expected behavior)
Note Posted by PR Testing Guide · Tag @mendral-app with feedback. |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ploy spec - Create applicationService with raw HTTP wrappers for New/Update/Get/Delete - Register Application operations in RegisterResourceOperations - Use config.Memory and config.Port in application deployment spec - Add Memory and Port fields to Config struct for blaxel.toml parsing Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ger and type flag Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…us monitoring Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ookup Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Needs attention
The latest commit (6f4dd33) correctly refactors the skipBuild image lookup to handle the revisions-based spec for applications — no new bugs. The replace directive to sdk-go-staging (flagged twice previously) remains the only blocking concern before merge.
Tag @mendral-app with feedback or questions. View session
Fixes ENG-2931
Summary
Adds
Applicationas a deployable resource type and introduces abl forkcommand for forking sandboxes.SDK update:
go.moduses areplacedirective to pointgithub.com/blaxel-ai/sdk-go→github.com/blaxel-ai/sdk-go-staging(commit97c3065). This staging SDK introduces breaking changes to List/Get signatures (paginated response envelopes, required*Paramsstructs). All call sites and tests are updated accordingly.Application support (deploy flow):
PromptForDeploymentType()now offers "Application"GenerateDeployment()builds an Application spec withenabled: trueand a single revision containing the image + 2048MB memorygetResource()/getResourceStatus()fetch applications via rawclient.Get("applications/<name>")since the staging SDK doesn't yet expose typed Application servicesbl forkcommand (cli/fork.go):POSTs to
sandboxes/<source>/fork. For--type application, wraps revision params in aspec.revisions[]envelope; for sandboxes, passes them flat.SDK compat fixes:
WorkspaceClientinterface, all*.List(ctx)→*.List(ctx, *ListParams{}),*result→result.Dataiteration, mock server responses wrapped in{"data": [...]}.Link to Devin session: https://app.devin.ai/sessions/ebad1673c91847e39d5a2a52e0609acd
Requested by: @drappier-charles
Note
Adds Application as a deployable resource type with CRUD operations, revisions-based spec, and a
bl forkcommand. Updates all SDK call sites for breaking paginated response changes from a staging SDK dependency.Written by Mendral for commit 6f4dd33.