Skip to content

feat: add workspace + terraform cloud config to GenericOptions#82

Merged
liamcervante merged 1 commit into
mainfrom
generic-options-workspace
Jul 15, 2026
Merged

feat: add workspace + terraform cloud config to GenericOptions#82
liamcervante merged 1 commit into
mainfrom
generic-options-workspace

Conversation

@liamcervante

@liamcervante liamcervante commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds two typed, caller-sourced fields to GenericOptions for terraform-family parse options that must not live in the opaque raw_options blob because they're also read outside the plugin.

  • workspace (20) — the terraform CLI workspace to select. Also read outside the plugin (the project's workspace in the cost output / provider input, the runner's cache key + metadata), so it travels typed.
  • terraform_cloud_configuration (21) — new TerraformCloudConfiguration message (organization/workspace/hostname) identifying the TFC/E remote workspace. Typed because it's caller-sourced and the hostname is the key the plugin uses to pair this config with its auth token (a CredentialSet matched by host); organization+workspace then address the remote workspace. Its workspace is the TFC remote workspace, distinct from field 20.

Changes

  • options.proto: string workspace = 20; and TerraformCloudConfiguration terraform_cloud_configuration = 21; on GenericOptions, plus the new message.
  • Regenerated Go + TS bindings (make generate passes: buf lint/format/generate, go build ./gen/go/..., tsc).

Follow-ups (separate PRs)

  • parser: read workspace + TFC config from GenericOptions; neither is in the blob.
  • config: keep terraform.workspace / terraform.cloud.* as top-level typed fields (not folded into the blob).
  • cli / runner: set both from the project config; runner keeps the TFC CredentialSet (host+token).

Add two typed, caller-sourced fields to GenericOptions:

- workspace (20): the terraform CLI workspace to select. Read outside the plugin
  too (cost output / provider input), so it is typed rather than in the
  raw_options blob.
- terraform_cloud_configuration (21): a new TerraformCloudConfiguration message
  (organization/workspace/hostname) identifying the TFC/E remote workspace. Typed
  (not the blob) because it is caller-sourced and the hostname is also read by the
  caller to pair with the token in a credential_set (the plugin matches hostname
  to a credential_set host, then uses organization+workspace to address the remote
  workspace). Its workspace is the TFC remote workspace, distinct from field 20.

Regenerated Go and TS bindings.
@liamcervante
liamcervante force-pushed the generic-options-workspace branch from 6a315f1 to cd2bda4 Compare July 13, 2026 11:39
@liamcervante liamcervante changed the title feat: add workspace to GenericOptions feat: add workspace + terraform cloud config to GenericOptions Jul 13, 2026
@liamcervante
liamcervante requested a review from a team July 15, 2026 06:32
@liamcervante
liamcervante merged commit 81c385d into main Jul 15, 2026
2 checks passed
@liamcervante
liamcervante deleted the generic-options-workspace branch July 15, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants