Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions apps/api/openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@
"name": {
"type": "string"
},
"selector": {
"description": "CEL expression to scope this version to matching release targets",
"type": "string"
},
"status": {
"$ref": "#/components/schemas/DeploymentVersionStatus"
},
Expand Down Expand Up @@ -788,6 +792,10 @@
"name": {
"type": "string"
},
"selector": {
"description": "CEL expression to scope this version to matching release targets",
"type": "string"
},
"status": {
"$ref": "#/components/schemas/DeploymentVersionStatus"
},
Expand Down Expand Up @@ -2398,6 +2406,10 @@
"name": {
"type": "string"
},
"selector": {
"description": "CEL expression to scope this version to matching release targets",
"type": "string"
},
"status": {
"$ref": "#/components/schemas/DeploymentVersionStatus"
},
Expand Down Expand Up @@ -2565,6 +2577,10 @@
"name": {
"type": "string"
},
"selector": {
"description": "CEL expression to scope this version to matching release targets",
"type": "string"
},
"status": {
"$ref": "#/components/schemas/DeploymentVersionStatus"
},
Expand Down
4 changes: 4 additions & 0 deletions apps/api/openapi/schemas/deploymentversions.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ local openapi = import '../lib/openapi.libsonnet';
name: { type: 'string' },
tag: { type: 'string' },
createdAt: { type: 'string', format: 'date-time' },
selector: { type: 'string', description: 'CEL expression to scope this version to matching release targets' },
metadata: {
Comment on lines 19 to 23
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

selector was added to the jsonnet schemas, but apps/api/openapi/openapi.json is what the API server imports/uses for request validation and Swagger (apps/api/src/server.ts). That bundled spec currently has no selector on DeploymentVersion, so regenerate/rebuild the OpenAPI JSON output and commit it to keep runtime validation/docs in sync.

Copilot uses AI. Check for mistakes.
type: 'object',
additionalProperties: { type: 'string' },
Expand All @@ -39,6 +40,7 @@ local openapi = import '../lib/openapi.libsonnet';
name: { type: 'string' },
tag: { type: 'string' },
createdAt: { type: 'string', format: 'date-time' },
selector: { type: 'string', description: 'CEL expression to scope this version to matching release targets' },
metadata: {
type: 'object',
additionalProperties: { type: 'string' },
Expand All @@ -60,6 +62,7 @@ local openapi = import '../lib/openapi.libsonnet';
name: { type: 'string' },
tag: { type: 'string' },
createdAt: { type: 'string', format: 'date-time' },
selector: { type: 'string', description: 'CEL expression to scope this version to matching release targets' },
metadata: {
type: 'object',
additionalProperties: { type: 'string' },
Expand Down Expand Up @@ -94,6 +97,7 @@ local openapi = import '../lib/openapi.libsonnet';
status: openapi.schemaRef('DeploymentVersionStatus'),
message: { type: 'string' },
createdAt: { type: 'string', format: 'date-time' },
selector: { type: 'string', description: 'CEL expression to scope this version to matching release targets' },
metadata: {
type: 'object',
additionalProperties: { type: 'string' },
Expand Down
8 changes: 8 additions & 0 deletions apps/api/src/types/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,8 @@ export interface components {
[key: string]: string;
};
name: string;
/** @description CEL expression to scope this version to matching release targets */
selector?: string;
status: components["schemas"]["DeploymentVersionStatus"];
tag: string;
};
Expand Down Expand Up @@ -1255,6 +1257,8 @@ export interface components {
[key: string]: string;
};
name: string;
/** @description CEL expression to scope this version to matching release targets */
selector?: string;
status: components["schemas"]["DeploymentVersionStatus"];
tag: string;
};
Expand Down Expand Up @@ -1826,6 +1830,8 @@ export interface components {
[key: string]: string;
};
name?: string;
/** @description CEL expression to scope this version to matching release targets */
selector?: string;
status?: components["schemas"]["DeploymentVersionStatus"];
tag?: string;
};
Expand Down Expand Up @@ -1883,6 +1889,8 @@ export interface components {
[key: string]: string;
};
name?: string;
/** @description CEL expression to scope this version to matching release targets */
selector?: string;
status?: components["schemas"]["DeploymentVersionStatus"];
tag: string;
};
Expand Down
14 changes: 12 additions & 2 deletions apps/web/app/api/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,8 @@ export interface components {
[key: string]: string;
};
name: string;
/** @description CEL expression to scope this version to matching release targets */
selector?: string;
status: components["schemas"]["DeploymentVersionStatus"];
tag: string;
};
Expand Down Expand Up @@ -1255,6 +1257,8 @@ export interface components {
[key: string]: string;
};
name: string;
/** @description CEL expression to scope this version to matching release targets */
selector?: string;
status: components["schemas"]["DeploymentVersionStatus"];
tag: string;
};
Expand Down Expand Up @@ -1826,6 +1830,8 @@ export interface components {
[key: string]: string;
};
name?: string;
/** @description CEL expression to scope this version to matching release targets */
selector?: string;
status?: components["schemas"]["DeploymentVersionStatus"];
tag?: string;
};
Expand Down Expand Up @@ -1883,6 +1889,8 @@ export interface components {
[key: string]: string;
};
name?: string;
/** @description CEL expression to scope this version to matching release targets */
selector?: string;
status?: components["schemas"]["DeploymentVersionStatus"];
tag: string;
};
Expand Down Expand Up @@ -3143,6 +3151,8 @@ export interface operations {
limit?: number;
/** @description Number of items to skip */
offset?: number;
/** @description Sort order for results */
order?: "asc" | "desc";
};
header?: never;
path: {
Expand Down Expand Up @@ -5595,8 +5605,8 @@ export interface operations {
};
};
responses: {
/** @description Accepted response */
202: {
/** @description Resource created successfully */
201: {
headers: {
[name: string]: unknown;
};
Expand Down
4 changes: 4 additions & 0 deletions apps/workspace-engine/oapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,10 @@
"name": {
"type": "string"
},
"selector": {
"description": "CEL expression to scope this version to matching release targets",
"type": "string"
},
"status": {
"$ref": "#/components/schemas/DeploymentVersionStatus"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ local openapi = import '../lib/openapi.libsonnet';
status: openapi.schemaRef('DeploymentVersionStatus'),
message: { type: 'string' },
createdAt: { type: 'string', format: 'date-time' },
selector: { type: 'string', description: 'CEL expression to scope this version to matching release targets' },
},
Comment on lines 109 to 113
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec adds selector to DeploymentVersion, but the generated artifacts are not updated: apps/workspace-engine/oapi/openapi.json and apps/workspace-engine/pkg/oapi/oapi.gen.go currently omit this field. Re-run the oapi generation step and commit the regenerated outputs so the server/client models match the spec.

Copilot uses AI. Check for mistakes.
},
}
25 changes: 16 additions & 9 deletions apps/workspace-engine/pkg/db/deployment_versions.sql.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/workspace-engine/pkg/db/models.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions apps/workspace-engine/pkg/db/queries/deployment_versions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ SELECT * FROM deployment_version WHERE deployment_id = $1 ORDER BY created_at DE
LIMIT COALESCE(sqlc.narg('limit')::int, 5000);

-- name: UpsertDeploymentVersion :one
INSERT INTO deployment_version (id, name, tag, config, job_agent_config, deployment_id, metadata, status, message, workspace_id, created_at)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, COALESCE(sqlc.narg('created_at')::timestamptz, NOW()))
INSERT INTO deployment_version (id, name, tag, config, job_agent_config, deployment_id, metadata, status, message, selector, workspace_id, created_at)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, COALESCE(sqlc.narg('created_at')::timestamptz, NOW()))
ON CONFLICT (deployment_id, tag) DO UPDATE
SET name = EXCLUDED.name, config = EXCLUDED.config, job_agent_config = EXCLUDED.job_agent_config, metadata = EXCLUDED.metadata, status = EXCLUDED.status, message = EXCLUDED.message, workspace_id = EXCLUDED.workspace_id,
SET name = EXCLUDED.name, config = EXCLUDED.config, job_agent_config = EXCLUDED.job_agent_config, metadata = EXCLUDED.metadata, status = EXCLUDED.status, message = EXCLUDED.message, selector = EXCLUDED.selector, workspace_id = EXCLUDED.workspace_id,
created_at = CASE WHEN sqlc.narg('created_at')::timestamptz IS NOT NULL THEN EXCLUDED.created_at ELSE deployment_version.created_at END
Comment on lines 8 to 13
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This query change adds a new selector parameter/column, but the committed sqlc outputs are not regenerated: apps/workspace-engine/pkg/db/deployment_versions.sql.go and apps/workspace-engine/pkg/db/models.go currently have no Selector field/param and still generate SQL without the column. Run go generate ./pkg/db (sqlc) and commit the updated generated files so callers can set/read selector.

Copilot uses AI. Check for mistakes.
RETURNING *;

Expand Down
1 change: 1 addition & 0 deletions apps/workspace-engine/pkg/db/queries/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ CREATE TABLE deployment_version (
status deployment_version_status NOT NULL DEFAULT 'ready',
message TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
selector TEXT,
workspace_id UUID REFERENCES workspace(id),
CONSTRAINT deployment_version_uniq UNIQUE (deployment_id, tag)
);
Expand Down
23 changes: 13 additions & 10 deletions apps/workspace-engine/pkg/oapi/oapi.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading