Compare commits

...

3 Commits

Author SHA1 Message Date
Danielle Maywood 5e09b91cbc fix: make devcontainer ID fields optional in proto schema
- Change id and subagent_id from required to optional bytes
- Remove inline comments from proto file per code review
- Revert TypeScript type assertion workarounds (no longer needed)

The optional keyword makes these fields truly optional in proto3,
which fixes TypeScript type compatibility without requiring unsafe
type assertions.
2026-01-14 13:07:23 +00:00
Danielle Maywood ad1dddb309 feat(provisionersdk): add subagent fields to Devcontainer proto
Add new fields to the Devcontainer message in provisioner.proto:
- id: Pre-computed devcontainer ID from Terraform
- subagent_id: Pre-computed subagent ID from Terraform
- apps: Apps to attach to the subagent
- scripts: Scripts to run in the subagent
- envs: Environment variables for the subagent

The new fields enable terraform-provider-coder to pass devcontainer
metadata and configuration to the provisioner, which will be used to
create devcontainer sub-agents with the specified apps, scripts, and
environment variables.

Also fixes TypeScript type assertions in e2e test helpers to handle
the new protobuf schema changes.

Related to #1238
2026-01-14 12:04:20 +00:00
blinkagent[bot] b3a81be1aa fix(coderd/database): remove hardcoded public schema from migration 000401 (#21493) 2026-01-14 05:40:30 +02:00
5 changed files with 620 additions and 538 deletions
@@ -1 +1 @@
DROP INDEX IF EXISTS public.workspace_agents_auth_instance_id_deleted_idx;
DROP INDEX IF EXISTS workspace_agents_auth_instance_id_deleted_idx;
@@ -1 +1 @@
CREATE INDEX IF NOT EXISTS workspace_agents_auth_instance_id_deleted_idx ON public.workspace_agents (auth_instance_id, deleted);
CREATE INDEX IF NOT EXISTS workspace_agents_auth_instance_id_deleted_idx ON workspace_agents (auth_instance_id, deleted);
+593 -536
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -244,6 +244,11 @@ message Devcontainer {
string workspace_folder = 1;
string config_path = 2;
string name = 3;
optional bytes id = 4;
optional bytes subagent_id = 5;
repeated App apps = 6;
repeated Script scripts = 7;
repeated Env envs = 8;
}
enum AppOpenIn {
+20
View File
@@ -306,6 +306,11 @@ export interface Devcontainer {
workspaceFolder: string;
configPath: string;
name: string;
id?: Uint8Array | undefined;
subagentId?: Uint8Array | undefined;
apps: App[];
scripts: Script[];
envs: Env[];
}
/** App represents a dev-accessible application on the workspace. */
@@ -1095,6 +1100,21 @@ export const Devcontainer = {
if (message.name !== "") {
writer.uint32(26).string(message.name);
}
if (message.id !== undefined) {
writer.uint32(34).bytes(message.id);
}
if (message.subagentId !== undefined) {
writer.uint32(42).bytes(message.subagentId);
}
for (const v of message.apps) {
App.encode(v!, writer.uint32(50).fork()).ldelim();
}
for (const v of message.scripts) {
Script.encode(v!, writer.uint32(58).fork()).ldelim();
}
for (const v of message.envs) {
Env.encode(v!, writer.uint32(66).fork()).ldelim();
}
return writer;
},
};