feat: native hosting sdk - #48
Draft
rkdud007 wants to merge 8 commits into
Draft
Conversation
Callers can now configure hosting when they create a repository, change it later, and drive deployments end to end: createRepo accepts a deployment block, updateRepo patches the default branch or the deployment settings, and Repo gains createDeployment, listDeployments, and getDeployment. Deployment lifecycle routes are canonical and unversioned, so the fetcher learns an apiRoot mode and PATCH support. Nullable build settings (framework, root/build/install/output directory, serverless function region) preserve omitted-versus-null patch semantics, environment variable names are sent verbatim, and region codes are validated to at most four characters. Minted tokens add deployment:write only when env changes are present; lifecycle calls use deployment:write or deployment:read. Create responses surface the idempotency key, the replay flag, and the Location header.
Callers can now configure hosting when they create a repository, change it later, and drive deployments end to end: create_repo accepts a deployment dict, update_repo patches the default branch or the deployment settings, and Repo gains create_deployment, list_deployments, and get_deployment. Deployment lifecycle routes are canonical and unversioned, and both path segments are percent-encoded. Nullable build settings preserve omitted-versus-None patch semantics, environment variable names are sent verbatim, and region codes are validated to at most four characters. Minted tokens add deployment:write only when env changes are present; lifecycle calls use deployment:write or deployment:read. Create responses surface the idempotency key, the replay flag, and the Location header. Also fix two strict-mypy errors in repo.py: parameterize the AbstractAsyncContextManager annotation and drop a stale type-ignore.
Callers can now configure hosting when they create a repository, change it later, and drive deployments end to end: CreateRepo accepts DeploymentSettings, UpdateRepo patches the default branch or the deployment settings, and Repo gains CreateDeployment, ListDeployments, and GetDeployment. DeploymentStringSetting keeps the three patch states apart: an unset field is omitted, SetDeploymentString sends a value, and ResetDeploymentString sends an explicit null. Deployment lifecycle routes are canonical and unversioned, so the fetcher learns an apiRoot mode and PATCH support. Environment variable names are sent verbatim, and region codes are validated to at most four characters. Minted tokens add deployment:write only when env changes are present; lifecycle calls use deployment:write or deployment:read. Create responses surface the idempotency key, the replay flag, and the Location header.
Add the deployment:read and deployment:write scopes, the PATCH /repo route, the repository deployment settings object, and the deployment lifecycle endpoints to the code-storage agent skill. Lifecycle routes live under the API origin as canonical /api/repos paths rather than the versioned /api/v1 base, so the skill gains a CODE_STORAGE_API_ORIGIN variable and curl examples covering idempotent creation, pagination, and percent-encoded repo names.
createDeployment returns a receipt while the build runs in the background, so every caller hand-rolls a getDeployment loop to learn the outcome. waitForDeployment wraps that polling: it resolves with the deployment once the status is ready, throws DeploymentFailedError carrying status/errorCode/errorMessage when the deployment ends in error or canceled, and stops with a timeout error after a configurable deadline (2s interval, 10m timeout by default).
CreateDeployment returns a receipt while the build runs in the background, so every caller hand-rolls a GetDeployment loop to learn the outcome. WaitForDeployment wraps that polling: it returns the deployment once the status is ready, fails with a typed DeploymentFailedError carrying Status/ErrorCode/ErrorMessage when the deployment ends in error or canceled, and stops with a timeout error after a configurable deadline (2s interval, 10m timeout by default). Caller context cancellation propagates.
create_deployment returns a receipt while the build runs in the background, so every caller hand-rolls a get_deployment loop to learn the outcome. wait_for_deployment wraps that polling: it returns the deployment once the status is ready, raises DeploymentFailedError carrying status/error_code/error_message when the deployment ends in error or canceled, and raises TimeoutError naming the last observed status after a configurable deadline (2s interval, 10m timeout by default).
Show the new polling helper in each SDK README's deployment section and note it in the code-storage skill's deployment lifecycle chapter. Also align the custom repo id example across the three READMEs: the deployment settings snippets now use my-custom-repo like the existing custom-id examples, instead of owner/site, which read as if the id carried owner/repo structure. The id is one opaque string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.