feat: add Application resource support#158
Conversation
🤖 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:
|
|
✅ Linked to Linear issue ENG-2932 — status set to In Progress
Linear reference Note Posted by Linear Issue Enforcer · Tag @mendral-app with feedback. |
🔀 Component Interaction DiagramHere's a sequence diagram showing the key interactions introduced by this PR: sequenceDiagram
participant User as User Code
participant AI as ApplicationInstance<br/>(Async/Sync)
participant Config as ApplicationCreate<br/>Configuration
participant API as API Endpoint Functions<br/>(create/get/list/update/delete)
participant HTTP as HTTPX Client
participant CP as Controlplane API
Note over User, CP: CREATE Flow
User->>AI: ApplicationInstance.create(config)
AI->>Config: Normalize input (dict/config/Application)
Config-->>AI: ApplicationCreateConfiguration
AI->>AI: Build Application model (Metadata + ApplicationSpec)
AI->>API: create_application(client, body)
API->>HTTP: POST /applications
HTTP->>CP: HTTP Request
CP-->>HTTP: 200 Application / 409 Error
HTTP-->>API: Response
API-->>AI: Application or Error
AI-->>User: ApplicationInstance (wrapped)
Note over User, CP: GET Flow
User->>AI: ApplicationInstance.get(name)
AI->>API: get_application(name, client)
API->>HTTP: GET /applications/{name}
HTTP->>CP: HTTP Request
CP-->>HTTP: 200 Application / 404 Error
API-->>AI: Application or Error
AI-->>User: ApplicationInstance (wrapped)
Note over User, CP: UPDATE Flow (via Descriptor)
User->>AI: instance.update(changes)
AI->>AI: _AsyncUpdateDescriptor.__get__()
AI->>API: get_application (fetch current state)
API->>HTTP: GET /applications/{name}
HTTP-->>API: Current Application
AI->>AI: Merge changes with current state
AI->>API: update_application(name, client, merged_body)
API->>HTTP: PUT /applications/{name}
HTTP->>CP: HTTP Request
CP-->>API: Updated Application
API-->>AI: Application
AI-->>User: New ApplicationInstance
Note over User, CP: CREATE_IF_NOT_EXISTS Flow
User->>AI: ApplicationInstance.create_if_not_exists(config)
AI->>API: create_application(client, body)
API->>HTTP: POST /applications
HTTP->>CP: HTTP Request
alt Success (200)
CP-->>AI: Application
AI-->>User: ApplicationInstance
else Conflict (409)
CP-->>AI: Error (APPLICATION_ALREADY_EXISTS)
AI->>API: get_application(name, client)
API->>HTTP: GET /applications/{name}
CP-->>AI: Existing Application
AI-->>User: ApplicationInstance (existing)
end
Summary of the FlowThis PR adds full CRUD support for the Application resource, following the existing SDK patterns (similar to
Key design choices:
Note Posted by PR Sequence Diagram · Tag @mendral-app with feedback. |
🧪 Testing GuideWhat this PR addressesAdds full Application resource lifecycle management to the SDK via new Steps to exercise the new behavior
What to verify (expected behavior)
Note Posted by PR Testing Guide · Tag @mendral-app with feedback. |
|
Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it. |
1 similar comment
|
Devin is archived and cannot be woken up. Please unarchive Devin if you want to continue using it. |
- Regenerate controlplane client from cdrappier/application-runtime-pr2-api branch spec - Add Application models (Application, ApplicationSpec, ApplicationList) and API functions (CRUD + list revisions) - Create ApplicationInstance (async) and SyncApplicationInstance (sync) helper classes - Support create, get, list, delete, update, and create_if_not_exists operations - Export from blaxel.core.application and re-export from blaxel.core Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Check for Error responses in _delete_application_by_name and _delete_application_by_name_sync, raising ApplicationAPIError instead of silently returning Error typed as Application. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…plication-runtime-pr3-app Regenerated SDK with latest OpenAPI definitions including: - Application resource endpoints (CRUD + list revisions) - Sandbox fork/snapshot endpoints - Updated list models with cursor pagination fields Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… spec Regenerated the auto-generated API client (api/ and models/) from the latest controlplane feature/app-runtime branch OpenAPI spec. Includes new Application, Snapshot, Fork, Schedule, DrivePermission, and CustomDomain types. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
aa4559e to
1073527
Compare
- Regenerate controlplane client from cdrappier/application-runtime-pr2-api branch spec - Add Application models (Application, ApplicationSpec, ApplicationList) and API functions (CRUD + list revisions) - Create ApplicationInstance (async) and SyncApplicationInstance (sync) helper classes - Support create, get, list, delete, update, and create_if_not_exists operations - Export from blaxel.core.application and re-export from blaxel.core Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Check for Error responses in _delete_application_by_name and _delete_application_by_name_sync, raising ApplicationAPIError instead of silently returning Error typed as Application. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…plication-runtime-pr3-app Regenerated SDK with latest OpenAPI definitions including: - Application resource endpoints (CRUD + list revisions) - Sandbox fork/snapshot endpoints - Updated list models with cursor pagination fields Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… spec Regenerated the auto-generated API client (api/ and models/) from the latest controlplane feature/app-runtime branch OpenAPI spec. Includes new Application, Snapshot, Fork, Schedule, DrivePermission, and CustomDomain types. 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>
1073527 to
556cf3b
Compare
… into cdrappier/app-runtime
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
LGTM
The previous review comment about the duplicate allowed_domains block in proxy_config.py has been fixed in 7b40792. The application helper logic is correct — the enabled is not None guard properly distinguishes "not specified" from "explicitly set to False" in the update merge. The remaining changes are standard auto-generated client code additions.
Tag @mendral-app with feedback or questions. View session
Fixes ENG-2932
Summary
Adds
ApplicationInstanceandSyncApplicationInstanceCRUD helpers for the new Application resource, following the same pattern asDriveInstance/VolumeInstance.Step 1 – Client regeneration: Regenerated the controlplane client from the
cdrappier/application-runtime-pr2-apibranch spec. This pulls inApplication,ApplicationSpec,ApplicationListmodels andcreate/get/list/delete/update_application+list_application_revisionsAPI functions, plus other new models from the updated spec (pagination, firewall, HIPAA, etc.).Step 2 – Application helper (
src/blaxel/core/application/):Key design choices:
ApplicationCreateConfigurationacceptsname,display_name,labels,image,region,enabledlist()handles the paginatedApplicationListresponse (extracts.data)_AsyncDeleteDescriptor/_SyncUpdateDescriptor) for class-level and instance-level callsStep 3 – Exports: Re-exported
ApplicationInstance,SyncApplicationInstance,ApplicationCreateConfiguration,ApplicationAPIErrorfromblaxel.core.Link to Devin session: https://app.devin.ai/sessions/7bcfb61fc2a0401587b0faa456cbe08d
Requested by: @drappier-charles
Note
Adds
ApplicationInstanceandSyncApplicationInstanceCRUD helpers for the new Application resource, regenerates the controlplane client with new models (ApplicationExtension, ChangelogEntry, SandboxFork/Snapshot, CustomDomainSpecDomainType, etc.), and fixes the previously-flagged duplicateallowed_domainsblock inproxy_config.py.Written by Mendral for commit 7b40792.