mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-11 11:16:55 +00:00
feat: guide missing external network creation during deploy (#1645)
* feat: guide missing external network creation during deploy Detect missing external networks before Compose runs, prompt or auto-create safe bridge networks, and keep unsupported declarations blocked with trusted deploy provenance. * test: align deploy context and settings fixtures with missing-network gate Update caller spies, EffResource expectations, StacksSection save keys, and git-source spy cleanup so CI matches the new deployStack context and auto-create setting. * fix: drop unused renderError binding in missing-network resolver Satisfies no-unused-vars so backend ESLint CI passes; callers already key only on model presence. * fix: use HTTP-safe clipboard helper in missing-network dialog navigator.clipboard fails on plain HTTP LAN hosts; route copy actions through copyToClipboard so Docker and Compose copy buttons work on self-hosted instances. * fix: simplify missing-network dialog actions and copy label Drop the Compose snippet escape hatch, move secondary actions under More, and rename the terminal copy action to Copy create command so the footer is a clear Cancel / Create decision.
This commit is contained in:
@@ -1419,6 +1419,36 @@ paths:
|
||||
when the health gate is disabled on the node.
|
||||
"403":
|
||||
$ref: "#/components/responses/Forbidden"
|
||||
"409":
|
||||
description: |
|
||||
Deploy blocked before Compose ran. Common codes include a stack
|
||||
operation already in progress, a scan-policy block, or missing
|
||||
external networks (`code: missing_external_networks`).
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
code:
|
||||
type: string
|
||||
example: missing_external_networks
|
||||
kind:
|
||||
type: string
|
||||
enum: [prompt, unsupported, unavailable, create_failed]
|
||||
networks:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
createdNames:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
remainingNames:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
"500":
|
||||
description: Deployment failed.
|
||||
content:
|
||||
@@ -1434,6 +1464,77 @@ paths:
|
||||
description: Whether the stack was automatically rolled back.
|
||||
failure:
|
||||
$ref: "#/components/schemas/FailureClassification"
|
||||
"503":
|
||||
description: |
|
||||
Deploy blocked because Sencho could not render the Compose model or
|
||||
read Docker networking state to verify required external networks.
|
||||
|
||||
/api/stacks/{stackName}/missing-external-networks:
|
||||
get:
|
||||
operationId: getMissingExternalNetworks
|
||||
tags: [Stacks]
|
||||
summary: List missing external networks for a stack
|
||||
description: |
|
||||
Returns whether declared `external: true` networks are missing on the
|
||||
target node, whether automatic creation is enabled, and per-network
|
||||
safety metadata. Requires `stack:read`. Used by interactive deploy
|
||||
preflight when the node advertises `guided-external-network-preflight`.
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/stackName"
|
||||
- $ref: "#/components/parameters/nodeId"
|
||||
responses:
|
||||
"200":
|
||||
description: Missing-external-network envelope.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required: [status, autoCreateEnabled, stackName, networks, declaredExternalCount]
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
enum: [ok, render_unavailable, runtime_unavailable]
|
||||
autoCreateEnabled:
|
||||
type: boolean
|
||||
stackName:
|
||||
type: string
|
||||
declaredExternalCount:
|
||||
type: integer
|
||||
networks:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
required: [name, keys, declarations, safe, unsupportedFeatures, creationSpec]
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
keys:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
declarations:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
safe:
|
||||
type: boolean
|
||||
blockReason:
|
||||
type: string
|
||||
unsupportedFeatures:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
creationSpec:
|
||||
type: object
|
||||
nullable: true
|
||||
"403":
|
||||
$ref: "#/components/responses/Forbidden"
|
||||
"404":
|
||||
description: Stack not found.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
|
||||
/api/stacks/{stackName}/down:
|
||||
post:
|
||||
|
||||
Reference in New Issue
Block a user