Repository navigation
Conversation
9f1d1c6 to
4487856
Compare
ferschubert-hm
left a comment
There was a problem hiding this comment.
Minor fixes requested.
|
|
||
| const opts = { method: 'POST' }; | ||
| return vantage.fetch( url, opts ).then( resp => { | ||
| return vantage.requestRaw( `stack/applications/${stack}/deploys`, { method: 'POST', query: { stream: true, force, build: buildId || undefined } } ).then( resp => { |
There was a problem hiding this comment.
This now sends force=false on every deploy, on the dashboard backend, force is registered without 'type' so WordPress passes the string "false" through unchanged. Suggest force: force || undefined, the same pattern as build. Otherwise all deployes will be forced.
| method: 'PATCH', | ||
| headers: { 'Content-Type': 'application/json' }, | ||
| body: JSON.stringify({ contact: argv.contact }), | ||
| body: { contacts: [{ email: argv.contact }] }, |
There was a problem hiding this comment.
The backend's update_data calls set_maintenance_contact_emails() with this list, so it replaces all contacts. With a single string --contact (line 158), maintenance set on an instance with several contacts silently drops all but one.
Could --contact add only / append instead of replace?
There was a problem hiding this comment.
MM i made it fetch the existing ones and add the new contact in, fixed in 88e7083
Maintenance updates previously sent
{ contact: ... }, while Vantage requires{ contacts: [{ email: ... }] }. Maintenanceset --contactnow reads the existing list and appends a new email, preserving current contacts and treating existing emails as a no-op. The CLI also selects response types at call sites and serializes request bodies before TypeScript can check their shape.This change fixes maintenance updates and introduces endpoint contracts inferred from the request path and HTTP method. All CLI REST calls use the typed client; query parameters and JSON bodies are checked before serialization, responses are inferred, and the untyped transport is private. Raw responses retain typed status handling, headers and download access. Shared response types continue to come from the Vantage frontend snapshots.
Checking the backend contracts also corrects uploads imports to send
path, log searches to sendsearch, and query arrays to use PHP-compatible bracket encoding. Deploy requests omitforceunless explicitly enabled, avoiding the backend interpreting the stringfalseas truthy. Both review fixes are entirely in the CLI. Existing command names and options are preserved. OAuth retains a separate typed form request, and signed backup downloads remain binary transfers. These contracts provide static checking rather than runtime validation of server responses.Targets
main.Validation: