Skip to content

feat(sdk): set a service's port and exposure, and follow a published value - #10

Merged
dada-sudo merged 2 commits into
mainfrom
feat/service-port-and-exposure
Nov 12, 2026
Merged

dada-sudo merged 2 commits into
mainfrom
feat/service-port-and-exposure

Conversation

@dada-sudo

@dada-sudo dada-sudo commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Why

A project created from a repository gets a first service with no port, closed to the internet, and a database the resource plan creates is not connected to it. Nothing in the public API could change any of the three, so a client such as the DMS module could create the project, its database and push a version, but the deployment could never go live without a visit to the console.

What

  • CloudApi.setServicePort(serviceId, port | null) → PUT /api/cloud/services/{serviceId}/port
  • CloudApi.setServiceExposure(serviceId, isPublic) → PUT /api/cloud/services/{serviceId}/network
  • CloudApi.followPublishedValue(serviceId, key, { serviceId, publishedKey }) → POST /api/cloud/services/{serviceId}/variables/references: the variable follows what a resource publishes (MONGO_URL, REDIS_URL…); the value never reaches the client.

The three routes already exist on the API (CloudServiceSettingsController, authorized on projects.deploy of the service's project, refused on a preview). This PR only documents them in the public spec and types the calls. The operations live in a new part file, sdk/openapi/services.yaml: the root spec has a 20 000-byte ceiling and "new parts go in their own file".

Refusals documented per operation (400 / 404 / 409 with their codes).

Tests

sdk/test/services.test.ts: method, encoded path and body of each call, an empty 200/204 answer accepted, and refusals surfaced as a CloudApiError with their code. pnpm --dir sdk test: 41 passing; typecheck and lint clean.

Checked against a live API from a local build of this branch: the port, the exposure and the followed value were each accepted, and the service then deployed and answered on its address.

Release

The DMS module needs these calls, so it needs a published version after the merge.

A service a project creation builds from a repository starts without a
port and closed to the internet, and nothing in the public API could change
either: a client had to send its user to the console before a first
deployment could go live.

`setServicePort` and `setServiceExposure` call the two settings routes the
API already serves, `PUT /api/cloud/services/{serviceId}/port` and
`PUT /api/cloud/services/{serviceId}/network`. The operations live in their
own spec file, `openapi/services.yaml`, as the root file's byte ceiling asks.

Co-Authored-By: Claude <noreply@anthropic.com>
@dada-sudo dada-sudo changed the title feat(sdk): set a service's port and its exposure feat(sdk): set a service's port and exposure, and follow a published value Nov 12, 2026
A database the resource plan creates publishes its connection string, and
the app service only gets it through a variable that follows that value.
The public API could set a variable to a value, never make it follow one,
so a client could create the database and not connect the app to it.

`followPublishedValue` calls the route the API already serves,
`POST /api/cloud/services/{serviceId}/variables/references`. The value
itself never reaches the client.

Co-Authored-By: Claude <noreply@anthropic.com>
@dada-sudo
dada-sudo merged commit 79992fb into main Nov 12, 2026
8 checks passed
@dada-sudo
dada-sudo deleted the feat/service-port-and-exposure branch November 12, 2026 04:17
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.

1 participant