Import extensions with stable project scope - #69
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 07:39
IlyaasK
force-pushed
the
hypeship/extension-delete-framework
branch
from
July 13, 2026 13:34
1441404 to
e8c3978
Compare
IlyaasK
force-pushed
the
hypeship/extension-import
branch
from
July 13, 2026 13:34
d7fb05b to
5b45b85
Compare
IlyaasK
force-pushed
the
hypeship/extension-delete-framework
branch
from
July 13, 2026 14:32
e8c3978 to
c65cc5f
Compare
IlyaasK
force-pushed
the
hypeship/extension-import
branch
2 times, most recently
from
July 13, 2026 15:39
d3ca1f6 to
eac46f5
Compare
IlyaasK
force-pushed
the
hypeship/extension-import
branch
from
July 20, 2026 19:38
eac46f5 to
7ed695b
Compare
IlyaasK
force-pushed
the
hypeship/extension-delete-framework
branch
from
July 21, 2026 14:46
49f7f24 to
3cd8e7e
Compare
IlyaasK
force-pushed
the
hypeship/extension-import
branch
from
July 21, 2026 14:46
7ed695b to
13ba45d
Compare
IlyaasK
force-pushed
the
hypeship/extension-delete-framework
branch
from
July 21, 2026 18:10
3cd8e7e to
e4d77bc
Compare
IlyaasK
force-pushed
the
hypeship/extension-import
branch
from
July 21, 2026 18:10
13ba45d to
663532d
Compare
IlyaasK
force-pushed
the
hypeship/extension-delete-framework
branch
from
July 21, 2026 19:51
e4d77bc to
d168bc8
Compare
IlyaasK
force-pushed
the
hypeship/extension-import
branch
from
July 21, 2026 19:51
663532d to
af1b09e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit af1b09e. Configure here.
| return "", "", false | ||
| } | ||
| return before, after, true | ||
| } |
There was a problem hiding this comment.
Duplicated project-qualified import parser
Low Severity
parseExtensionImportID is functionally the same as browserpool’s parseImportID: same strings.Cut flow, extra-separator rejection, and empty-segment rules. Keeping two copies raises the risk that a future import-edge-case fix lands in only one resource.
Reviewed by Cursor Bugbot for commit af1b09e. Configure here.
IlyaasK
force-pushed
the
hypeship/extension-delete-framework
branch
from
July 21, 2026 20:15
d168bc8 to
6b1210f
Compare
IlyaasK
force-pushed
the
hypeship/extension-import
branch
from
July 21, 2026 20:15
af1b09e to
345affd
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
<extension-id>and project-qualified<project-id>/<extension-id>importssource_pathnullResource scope
This PR adds only the
kernel_extensionimport parser and Terraform Framework import-state adapter. Full resource interface assembly and provider registration remain separate.API contract notes
Extension metadata does not return project identity. Import must therefore persist explicit or provider-resolved scope before Read. Bare imports with no provider default intentionally remain API-key scoped rather than guessing a project.
Terraform state semantics
Import records canonical
idand resolvableproject_id.nameandsource_sha256are unknown until the first metadata Read.source_pathis write-only and remains null. Subsequent immutable configuration changes retain the schema's replacement semantics.Sensitive fields
This slice handles no secret values, archive contents, API keys, credentials, or runtime data.
Import behavior
terraform import kernel_extension.example extension_123terraform import kernel_extension.example project_123/extension_123The qualified form is required to record explicit non-default project scope.
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 pure, deterministic, network-free, and container-free.
Acceptance status
The resource is not registered yet, so live acceptance testing remains deferred to the complete extension lifecycle PR.
Deferred concerns
GitHub issues
This PR does not resolve #24 or #25. Force deletion and code generation remain outside this resource-scoped import change.
Note
Low Risk
New import-only code with no live resource registration; behavior is covered by deterministic unit tests and does not touch auth or data migration paths.
Overview
Adds Terraform Framework import support for
kernel_extensionvia newimportExtensionResourceandparseExtensionImportID.Import IDs accept a bare
<extension-id>or<project-id>/<extension-id>. Bare IDs use the provider’sDefaultProjectID()when set; otherwiseproject_idstays null (API-key scope). Qualified IDs set explicit project scope and override the provider default.Successful import seeds state with canonical
id, resolvedproject_id, unknownname/source_sha256until Read, and null write-onlysource_path. Invalid IDs, nil client, and malformed paths error with no partial state.Unit tests cover ID parsing, project inheritance, and error paths.
Reviewed by Cursor Bugbot for commit 345affd. Bugbot is set up for automated code reviews on this repo. Configure here.