feat(provisionersdk): add script dependency proto fields Add optional `resource_address` and `dependencies` fields to `Script` for transporting resolved script ordering. Dependencies identify a prerequisite by Terraform address and require `SUCCESS` (successful exit) or `COMPLETION` (finish regardless of outcome). - Bump provisionerd API from v1.19 to v1.20, regenerate Go/TypeScript bindings, and update the CLI golden output. - Reuse the existing resource tree for workspace-agent and devcontainer scripts; no changes to `GraphComplete` or the provisionerd runner. - Add round-trip tests for both script types and verify unset fields preserve existing wire encoding. The fields remain unused in this PR. Follow-up provisioner changes populate them; PLAT-548 reads and persists them in coderd. **Release requirement:** Ship with the PLAT-545 integration stack, targeting 2.39, so no daemon advertises v1.20 without sending ordering. Hold or revert this PR before the release cut if that stack misses it. Refs PLAT-547.
124 lines
5.4 KiB
Go
124 lines
5.4 KiB
Go
package proto
|
|
|
|
import "github.com/coder/coder/v2/apiversion"
|
|
|
|
// Version history:
|
|
//
|
|
// API v1.2:
|
|
// - Add support for `open_in` parameters in the workspace apps.
|
|
//
|
|
// API v1.3:
|
|
// - Add new field named `resources_monitoring` in the Agent with resources monitoring.
|
|
//
|
|
// API v1.4:
|
|
// - Add new field named `devcontainers` in the Agent.
|
|
//
|
|
// API v1.5:
|
|
// - Add new field named `prebuilt_workspace_build_stage` enum in the Metadata message.
|
|
// - Add new field named `running_agent_auth_tokens` to provisioner job metadata
|
|
// - Add new field named `resource_replacements` in PlanComplete & CompletedJob.WorkspaceBuild.
|
|
// - Add new field named `api_key_scope` to WorkspaceAgent to support running without user data access.
|
|
// - Add `plan` field to `CompletedJob.TemplateImport`.
|
|
//
|
|
// API v1.6:
|
|
// - Add `module_files` field to `CompletedJob.TemplateImport`.
|
|
// - Add previous parameter values to 'WorkspaceBuild' jobs. Provisioner passes
|
|
// the previous values for the `terraform apply` to enforce monotonicity
|
|
// in the terraform provider.
|
|
// - Add new field named `expiration_policy` to `Prebuild`, with a field named
|
|
// `ttl` to define TTL-based expiration for unclaimed prebuilds.
|
|
// - Add `group` field to `App`
|
|
// - Add `form_type` field to parameters
|
|
//
|
|
// API v1.7:
|
|
// - Added DataUpload and ChunkPiece messages to support uploading large files
|
|
// back to Coderd. Used for uploading module files in support of dynamic
|
|
// parameters.
|
|
// - Add new field named `scheduling` to `Prebuild`, with fields for timezone
|
|
// and schedule rules to define cron-based scaling of prebuilt workspace
|
|
// instances based on time patterns.
|
|
// - Added new field named `id` to `App`, which transports the ID generated by the coder_app provider to be persisted.
|
|
// - Added new field named `default` to `Preset`.
|
|
// - Added various fields in support of AI Tasks:
|
|
// -> `ai_tasks` in `CompleteJob.WorkspaceBuild`
|
|
// -> `has_ai_tasks` in `CompleteJob.TemplateImport`
|
|
// -> `has_ai_tasks` and `ai_tasks` in `PlanComplete`
|
|
// -> new message types `AITaskSidebarApp` and `AITask`
|
|
//
|
|
// API v1.8:
|
|
// - Add new fields `description` and `icon` to `Preset`.
|
|
//
|
|
// API v1.9:
|
|
// - Added new field named 'has_external_agent' in 'CompleteJob.TemplateImport'
|
|
//
|
|
// API v1.10:
|
|
// - Added new field `tooltip` in `App`
|
|
//
|
|
// API v1.11:
|
|
// - Added new fields `task_id` and `task_prompt` to `Manifest`.
|
|
// - Added new field `app_id` to `AITask`
|
|
//
|
|
// API v1.12:
|
|
// - Added new field `template_version_id` to `provisioner.Metadata`
|
|
// - Added new field `exp_reuse_terraform_workspace` to `provisioner.Job.WorkspaceBuild`
|
|
// - Added fields `template_version_id`, `template_id`, and `exp_reuse_terraform_workspace` to `provisioner.Config`
|
|
//
|
|
// API v1.13:
|
|
// - Removed experimental fields `exp_reuse_terraform_workspace`. Caching moved into Coderd
|
|
//
|
|
// API v1.14:
|
|
// - Added new field `template_version_modules_file` to Metadata
|
|
// - Added `FailedFile` type for file upload failures.
|
|
// - Add `DownloadFile` capability for provisioner daemons to fetch files from coderd.
|
|
// - Moved type `UploadFileRequest` -> `provisioner.FileUpload`
|
|
//
|
|
// API v1.15:
|
|
// - Removed `stop_modules` from CompleteJob. Was a duplicate of start_modules
|
|
// - Add `id`, `subagent_id`, `apps`, `scripts` and `envs` to `provisioner.Devcontainer`
|
|
//
|
|
// API v1.16:
|
|
// - Added `merge_strategy` field to `provisioner.Env` message
|
|
//
|
|
// API v1.17:
|
|
// - Added `user_secrets` field to `AcquiredJob.WorkspaceBuild`, carrying user
|
|
// secret values from coderd to provisioner daemons.
|
|
// - Added `UserSecretValue` message and `user_secrets` field to `PlanRequest`,
|
|
// carrying user secret values from provisioner daemons to provisioners
|
|
// during plan.
|
|
//
|
|
// API v1.18:
|
|
// - Removed `user_secrets` from `AcquiredJob.WorkspaceBuild` (field 12) and
|
|
// `PlanRequest` (field 7), along with the `UserSecretValue` message. The
|
|
// `coder_secret` Terraform integration is being removed; user secrets are
|
|
// still delivered to running workspaces via the agent manifest path, which
|
|
// is independent of this proto.
|
|
//
|
|
// API v1.19:
|
|
// - Removed `ai_tasks` (field 6) and `has_ai_tasks` (field 12) from
|
|
// provisionerd.proto `CompletedJob.WorkspaceBuild` and
|
|
// `CompletedJob.TemplateImport`.
|
|
// - Removed `ai_tasks` (field 8), `has_ai_tasks` (field 7), `ai_task_count`
|
|
// (field 6), `task_id` (field 22), `task_prompt` (field 23), and the
|
|
// `AITask` / `AITaskSidebarApp` messages from provisioner.proto. Coder
|
|
// Tasks is being removed.
|
|
//
|
|
// API v1.20:
|
|
// - Added `resource_address` (field 10) and `dependencies` (field 11) to
|
|
// `provisioner.Script`, with the `ScriptDependency` message and the
|
|
// `ScriptDependencyRequirement` enum. They carry each script's full
|
|
// Terraform address and its resolved `coder_script_order` prerequisites
|
|
// from the provisioner to coderd. `dependencies` is empty when the script
|
|
// has no prerequisites. `resource_address` is empty only for the legacy
|
|
// agent startup and shutdown scripts.
|
|
const (
|
|
CurrentMajor = 1
|
|
CurrentMinor = 20
|
|
)
|
|
|
|
// CurrentVersion is the current provisionerd API version.
|
|
// Breaking changes to the provisionerd API **MUST** increment
|
|
// CurrentMajor above.
|
|
// Non-breaking changes to the provisionerd API **MUST** increment
|
|
// CurrentMinor above.
|
|
var CurrentVersion = apiversion.New(CurrentMajor, CurrentMinor)
|