feat(coderd): persist workspace agent script dependencies Persist Terraform resource addresses and script dependencies supplied by the provisioner (#30451, #30491), and expose them through the SDK and REST API. - Add migration 000618 with `resource_address` and `dependencies` columns, empty defaults, and a JSON-array constraint. API responses always include the address and omit empty dependency lists. - Preserve `success` and `completion` requirements, including scripts on devcontainer subagents. Legacy scripts and older provisioners remain compatible through empty defaults. - Reject empty prerequisite addresses and unsupported requirements, rolling back the entire job. Invalid stored dependencies return HTTP 500 rather than silently dropping ordering. - Add persistence, validation, rollback, devcontainer, API, and migration coverage; regenerate API docs and TypeScript types. Unordered templates retain their existing execution behavior. Dependency lists remain empty until #30556. Agent manifest wiring and the agent API version bump are deferred to a follow-up. Refs PLAT-548.
6 lines
262 B
SQL
6 lines
262 B
SQL
ALTER TABLE workspace_agent_scripts
|
|
ADD COLUMN resource_address TEXT NOT NULL DEFAULT '',
|
|
ADD COLUMN dependencies JSONB NOT NULL DEFAULT '[]'::jsonb,
|
|
ADD CONSTRAINT workspace_agent_scripts_dependencies_is_array
|
|
CHECK (jsonb_typeof(dependencies) = 'array');
|