Add kernel_app data source - #83
Open
IlyaasK wants to merge 1 commit into
Open
Conversation
IlyaasK
marked this pull request as ready for review
July 11, 2026 14:56
IlyaasK
force-pushed
the
hypeship/deployment-resource-contract
branch
from
July 13, 2026 13:35
e299907 to
7316c3c
Compare
IlyaasK
force-pushed
the
hypeship/app-data-source
branch
2 times, most recently
from
July 13, 2026 14:32
ae07bda to
aae651a
Compare
IlyaasK
force-pushed
the
hypeship/deployment-resource-contract
branch
2 times, most recently
from
July 13, 2026 15:39
78f7cc7 to
6698b54
Compare
IlyaasK
force-pushed
the
hypeship/app-data-source
branch
from
July 13, 2026 15:39
aae651a to
3a87f31
Compare
IlyaasK
force-pushed
the
hypeship/deployment-resource-contract
branch
from
July 20, 2026 19:38
6698b54 to
4789f27
Compare
IlyaasK
force-pushed
the
hypeship/app-data-source
branch
from
July 20, 2026 19:38
3a87f31 to
2fdba56
Compare
IlyaasK
force-pushed
the
hypeship/deployment-resource-contract
branch
from
July 21, 2026 14:46
4789f27 to
37400e8
Compare
IlyaasK
force-pushed
the
hypeship/app-data-source
branch
3 times, most recently
from
July 21, 2026 19:51
eac44ec to
eab41e8
Compare
IlyaasK
force-pushed
the
hypeship/deployment-resource-contract
branch
from
July 21, 2026 20:15
ac7a702 to
b56f33f
Compare
IlyaasK
force-pushed
the
hypeship/app-data-source
branch
from
July 21, 2026 20:15
eab41e8 to
13d3216
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
Adds the
kernel_appdata source as a read-only exact lookup for an existing Kernel app version.kernel_appwith the provider.app_nameandversion.Why this is v1 work
The v1 architecture treats apps as read-only lookup targets because Kernel app versions are produced by deployments rather than managed as independently mutable durable objects. Invocation, logs, and other runtime operations remain outside Terraform.
Data-source scope
This PR adds only
kernel_app. It does not add an app resource, deployment lifecycle behavior, app invocation, logs, runtime status, or browser/session operations.API contract
The Kernel SDK app list operation supports exact
app_nameandversionfilters and offset pagination. The API lists app versions attached to running deployments and can return duplicate rows for the same app-version ID, so the data source scans all pages, deduplicates by canonical ID, and diagnoses zero or multiple distinct matches.The API may return
env_vars: nullwhen no environment variables are configured. That is normalized to an empty Terraform set; a missing or malformed field remains an invalid-response diagnostic.Terraform state semantics
Required lookup inputs are
app_nameandversion. Optionalproject_idfollows the established precedence: data-source override, provider default, then API-key project binding.Computed state contains only stable lookup metadata:
iddeployment_idregionactionsas a set of action namesenv_var_keysas a set of namesSet semantics prevent ordering-only diffs. Action schemas, deployment status, and runtime fields are intentionally omitted.
Sensitive field handling
Environment-variable values are never exposed in the schema or Terraform state. Tests use non-placeholder secret values and verify that only names reach state. Action input/output schemas are also omitted.
Import behavior
Not applicable: this is a data source and owns no remote object.
Verification
Before this change, provider registration had five data sources and no
kernel_appschema. After this change, registration exposes six data sources and the framework read test resolves an app while retaining only permitted metadata.Passed locally:
gofmt -l cmd internalgo test -short -timeout=2m ./...go vet ./...go mod verifygo mod tidy -diffterraform fmt -check -recursive examplesbash scripts/check-docs.shbash scripts/check-markdown-links.shgit diff --check hypeship/deployment-resource-contractAcceptance status
No live acceptance test is included. Kernel app versions are created through deployment workflows, so this data source cannot independently arrange its fixture without crossing into the separate deployment resource scope. Fake-client, SDK transport, and Terraform Framework state tests cover the lookup contract. A live lookup remains part of the deployment/app acceptance matrix once deployment fixtures exist.
Deferred concerns
GitHub issues
This PR does not resolve an existing GitHub issue.
Note
Low Risk
Read-only data source with no resource lifecycle; env var values are explicitly excluded from state and covered by tests.
Overview
Adds a
kernel_appdata source so Terraform can resolve a running app version by exactapp_nameandversion, with optionalproject_idusing the same precedence as other lookups.The provider wires in paginated
ListAppPageon the shared client (exact API filters + offset headers). The read path scans all pages, deduplicates by app-version ID, and errors on zero or multiple distinct matches. State exposes only stable metadata—id,deployment_id,region, action names, andenv_var_keys(never env values or action schemas).Docs, the lookups example, and unit tests cover registration, pagination, ambiguity, malformed API fields, and project scoping.
Reviewed by Cursor Bugbot for commit 13d3216. Bugbot is set up for automated code reviews on this repo. Configure here.