Skip to content

feat: read plugin parse options from the config plugins blob#185

Merged
liamcervante merged 4 commits into
mainfrom
plugin-raw-options
Jul 17, 2026
Merged

feat: read plugin parse options from the config plugins blob#185
liamcervante merged 4 commits into
mainfrom
plugin-raw-options

Conversation

@liamcervante

@liamcervante liamcervante commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Sends per-project parse options to the parser plugins from the config plugins.<name> blob plus typed GenericOptions, targeting the latest plugins only (the CLI always downloads the latest).

  • raw_options is the project's config plugins.<name> blob, forwarded verbatim (keyed by the consuming plugin; cdk_* resolves to cloudformation). Config generates it and folds hand-written / older configs into it, so there's nothing to rebuild caller-side. Removes the local terraform/cloudformation option structs and builders.
  • Caller-sourced runtime options go via typed GenericOptions, never the blob: env, required attributes (naming policies), the terraform workspace (GenericOptions.Workspace), and the terraform cloud config (GenericOptions.TerraformCloudConfiguration, from terraform.cloud.*).
  • workspace and terraform.cloud.* stay top-level typed config fields — workspace is read directly for the provider ProjectInfo, and the cloud config is passed typed because it's read outside the plugin. Nothing outside the plugin reads the blob.
  • Drops the removed ParseRequest.raw_options_format (always JSON) and folds only the blob bytes into the parser-cache fingerprint.
  • No hydration shim: the config library populates the blob for both generated and hand-written configs.

Dependencies

Built on infracost/proto#82 (GenericOptions.workspace + terraform_cloud_configuration), infracost/config#19 (plugins.<name> + top-level workspace/cloud), and the parser plugin PR (reads the typed options).

Testing

  • go build ./..., go vet ./pkg/scanner/..., golangci-lint run ./pkg/scanner/..., and go test ./pkg/scanner/... all pass.

@liamcervante
liamcervante force-pushed the plugin-raw-options branch 2 times, most recently from f09c240 to f94ca00 Compare July 13, 2026 09:38
…GenericOptions

Adopt the config plugins.<name> blob as the parse-options source for the parser
plugins, targeting the latest plugins only (the CLI always downloads the latest).

- raw_options is now the project's config plugins.<name> blob, forwarded verbatim
  (keyed by the consuming plugin; cdk_* resolves to cloudformation). Config
  generates it and folds hand-written / older configs into it, so there is nothing
  to rebuild caller-side. Drops the local terraform/cloudformation option structs
  and builders.
- Caller-sourced runtime options are sent via typed GenericOptions, never the
  blob: env, required attributes (from naming policies), the terraform workspace
  (GenericOptions.Workspace), and the terraform cloud config
  (GenericOptions.TerraformCloudConfiguration, from terraform.cloud.*).
- Workspace and terraform.cloud stay top-level config fields (read directly for
  the provider ProjectInfo etc.), so nothing outside the plugin reads the blob.
- Drop the removed ParseRequest.raw_options_format field - raw_options is always
  JSON now - and fold only the blob bytes into the parser-cache fingerprint.
- Bump proto and config to the branch commits introducing the plugins blob and
  GenericOptions.workspace.

No hydration shim: the config library populates the blob for both generated and
hand-written configs, so the CLI reads it directly.
@liamcervante
liamcervante marked this pull request as ready for review July 14, 2026 13:47
@liamcervante
liamcervante requested a review from a team July 14, 2026 13:47
@liamcervante
liamcervante merged commit 73ca53a into main Jul 17, 2026
5 checks passed
@liamcervante
liamcervante deleted the plugin-raw-options branch July 17, 2026 08:27
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