Skip to content

Wire extension metadata into Terraform Read - #66

Open
IlyaasK wants to merge 1 commit into
hypeship/extension-read-corefrom
hypeship/extension-read-framework
Open

Wire extension metadata into Terraform Read#66
IlyaasK wants to merge 1 commit into
hypeship/extension-read-corefrom
hypeship/extension-read-framework

Conversation

@IlyaasK

@IlyaasK IlyaasK commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • adapt the extension Read core to Terraform Framework request and response state
  • decode prior state before any client call
  • write refreshed durable state only after a clean Read result
  • remove the resource only when the core confirms coded extension not-found
  • leave pre-populated state untouched on diagnostics
  • cover refresh, removal, diagnostic preservation, and malformed-state no-call behavior

Why this is v1 work

This is the narrow Framework state-transition boundary over the already-reviewed metadata Read core. It keeps registration and incomplete Delete/Import behavior out of the PR.

Intentionally unsupported

  • no registered kernel_extension resource
  • no Delete or Import behavior
  • no archive download or Chrome Web Store operation
  • no browser/session/runtime operation
  • no runtime fields in Terraform state

Verification

  • gofmt -l cmd internal
  • go test -count=20 ./internal/resources/extension
  • go test -race -count=1 ./internal/resources/extension
  • go test -count=1 -short -timeout=2m ./...
  • go vet ./...
  • go mod tidy -diff
  • terraform fmt -check -recursive examples
  • bash scripts/check-docs.sh
  • bash scripts/check-examples.sh
  • bash scripts/check-markdown-links.sh
  • git diff --check

All commands passed locally. Tests are fake-client based, deterministic, and require no network or container.

Acceptance status

The resource remains unregistered and lacks Delete/Import, so live acceptance testing is not applicable to this adapter-only slice.

Remaining risk

The complete resource must preserve these state transitions when Create, Read, Delete, Import, Configure, and provider registration are assembled.


Note

Low Risk
Adapter-only slice with no provider registration; behavior is narrow state transitions over an already-reviewed read core and is fully covered by unit tests.

Overview
Adds a Terraform Plugin Framework Read handler (readExtensionResource) that bridges resource.ReadRequest/ReadResponse to the existing readExtension metadata core.

On read it decodes prior state first, then on success writes refreshed state or removes the resource when the core reports a coded not_found. Diagnostics leave response state unchanged (no partial writes).

New fake-client tests cover successful refresh, not-found removal, error preservation, and malformed state without calling the API.

Reviewed by Cursor Bugbot for commit d503c89. Bugbot is set up for automated code reviews on this repo. Configure here.

@IlyaasK
IlyaasK requested review from Sayan- and tnsardesai and removed request for Sayan- and tnsardesai July 11, 2026 06:40
@IlyaasK
IlyaasK force-pushed the hypeship/extension-read-core branch from 0b96a2c to d13b0cb Compare July 13, 2026 13:34
@IlyaasK
IlyaasK force-pushed the hypeship/extension-read-framework branch 3 times, most recently from ca7698d to 768706f Compare July 13, 2026 15:39
@IlyaasK
IlyaasK force-pushed the hypeship/extension-read-core branch from 0729a85 to 27974c1 Compare July 13, 2026 15:39
@IlyaasK
IlyaasK force-pushed the hypeship/extension-read-core branch from 27974c1 to 425ae2f Compare July 20, 2026 19:38
@IlyaasK
IlyaasK force-pushed the hypeship/extension-read-framework branch from 768706f to 1cbbde5 Compare July 20, 2026 19:38
@IlyaasK
IlyaasK force-pushed the hypeship/extension-read-core branch from 425ae2f to b14832d Compare July 21, 2026 14:46
@IlyaasK
IlyaasK force-pushed the hypeship/extension-read-framework branch from 1cbbde5 to bb43138 Compare July 21, 2026 14:46
@IlyaasK
IlyaasK force-pushed the hypeship/extension-read-core branch from b14832d to 85ea5af Compare July 21, 2026 18:10
@IlyaasK
IlyaasK force-pushed the hypeship/extension-read-framework branch from bb43138 to 55234ad Compare July 21, 2026 18:10
@IlyaasK
IlyaasK force-pushed the hypeship/extension-read-core branch from 85ea5af to ecdfa1a Compare July 21, 2026 19:51
@IlyaasK
IlyaasK force-pushed the hypeship/extension-read-framework branch from 55234ad to 83939e3 Compare July 21, 2026 19:51
@IlyaasK
IlyaasK force-pushed the hypeship/extension-read-framework branch from 83939e3 to d503c89 Compare July 21, 2026 20:15
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.

1 participant