Read extension metadata safely - #65
Open
IlyaasK wants to merge 1 commit into
Open
Conversation
IlyaasK
requested review from
Sayan- and
tnsardesai
and removed request for
Sayan- and
tnsardesai
July 11, 2026 06:24
IlyaasK
force-pushed
the
hypeship/extension-read-flatten
branch
from
July 13, 2026 13:34
47260c0 to
e55250f
Compare
IlyaasK
force-pushed
the
hypeship/extension-read-core
branch
from
July 13, 2026 13:34
0b96a2c to
d13b0cb
Compare
IlyaasK
force-pushed
the
hypeship/extension-read-flatten
branch
from
July 13, 2026 14:32
e55250f to
b36a0ed
Compare
IlyaasK
force-pushed
the
hypeship/extension-read-core
branch
from
July 13, 2026 14:32
d13b0cb to
0729a85
Compare
IlyaasK
force-pushed
the
hypeship/extension-read-flatten
branch
from
July 13, 2026 15:39
b36a0ed to
fb5840f
Compare
IlyaasK
force-pushed
the
hypeship/extension-read-core
branch
from
July 13, 2026 15:39
0729a85 to
27974c1
Compare
IlyaasK
force-pushed
the
hypeship/extension-read-flatten
branch
from
July 20, 2026 19:38
fb5840f to
aaa65c1
Compare
IlyaasK
force-pushed
the
hypeship/extension-read-core
branch
2 times, most recently
from
July 21, 2026 14:46
425ae2f to
b14832d
Compare
IlyaasK
force-pushed
the
hypeship/extension-read-flatten
branch
from
July 21, 2026 18:10
82bf203 to
8c1c7b0
Compare
IlyaasK
force-pushed
the
hypeship/extension-read-core
branch
2 times, most recently
from
July 21, 2026 19:51
85ea5af to
ecdfa1a
Compare
IlyaasK
force-pushed
the
hypeship/extension-read-flatten
branch
from
July 21, 2026 19:51
8c1c7b0 to
b8baf88
Compare
IlyaasK
force-pushed
the
hypeship/extension-read-flatten
branch
from
July 21, 2026 20:15
b8baf88 to
a890eb5
Compare
IlyaasK
force-pushed
the
hypeship/extension-read-core
branch
from
July 21, 2026 20:15
ecdfa1a to
70396df
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
not_foundWhy this is v1 work
Resource Read must not re-resolve a changed provider default or treat every 404 as proof the extension was deleted. This pure core establishes safe state-scoped metadata behavior before the Terraform Read adapter and complete resource shell are registered.
Intentionally unsupported
Verification
gofmt -l cmd internalgo test -count=20 ./internal/resources/extensiongo test -race -count=1 ./internal/resources/extensiongo test -count=1 -short -timeout=2m ./...go vet ./...go mod verifygo mod tidy -diffterraform fmt -check -recursive examplesbash scripts/check-docs.shbash scripts/check-examples.shbash scripts/check-markdown-links.shgit diff --checkAll commands passed locally. Tests are fake-client based, deterministic, and require no network or container.
Acceptance status
No registered Terraform resource or complete lifecycle is introduced, so live acceptance testing is not applicable to this Read-core slice.
Remaining risk
The API does not return project identity with extension metadata. Existing resources must remain pinned to the scope recorded in Terraform state, and unqualified imports under API-key-bound scope cannot later prove an explicit project without replacement.
Note
Medium Risk
Read governs whether Terraform drops extension resources from state; misclassified 404s would be disruptive, though the change explicitly narrows removal to coded
not_foundand pins scope to storedproject_id.Overview
Adds
readExtension, a provider-core read path for the extension resource that fetches durable metadata via a narrowextensionReaderinterface and maps API results through the existingflattenExtensionReadhelper.Read uses only
idandproject_idalready in Terraform state (including empty project for API-key-bound scope) and refuses to call the API whenidis missing/unknown orproject_idis unknown. On success it returns updated state; it signals removal from state only whenprojectscope.IsNotFoundmatches the API’s coded extensionnot_found, whileproject_not_found, uncoded 404s, access errors, nil responses, and missing client produce diagnostics that keep state (with extension id and resolved scope in error text where relevant).read_test.goexercises success/flattening, not-found classification, pre-flight state validation, and client/empty-response failures with a fake client (and assertskernelclient.ClientssatisfiesextensionReader).Reviewed by Cursor Bugbot for commit 70396df. Bugbot is set up for automated code reviews on this repo. Configure here.