Skip to content

Test app data source against Kernel - #94

Open
IlyaasK wants to merge 73 commits into
hypeship/proxy-data-source-acceptancefrom
hypeship/app-data-source-acceptance
Open

Test app data source against Kernel#94
IlyaasK wants to merge 73 commits into
hypeship/proxy-data-source-acceptancefrom
hypeship/app-data-source-acceptance

Conversation

@IlyaasK

@IlyaasK IlyaasK commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add lookup-only kernel_app acceptance coverage using a release-owned running app version
  • require non-secret KERNEL_ACC_APP_NAME and KERNEL_ACC_APP_VERSION repository variables
  • test exact app/version lookup under explicit and provider-default project scope
  • verify canonical app ID, deployment ID, region, and a no-drift plan
  • add the package to the manual workflow and clear the last registered data-source acceptance blocker

Why this is v1 work

Apps are projections of running durable deployments, not independently mutable resources. This PR proves the registered data source against a controlled release fixture without creating a deployment, invoking an action, reading logs, or exposing environment values.

Verification

Before this change, the app data source was the final registered surface without live coverage. After the change, the manual matrix requires exactly one matching running app version and exercises both project-scope paths.

  • gofmt -l cmd internal
  • go test -short -timeout=2m ./...
  • go vet ./...
  • go mod verify
  • go mod tidy -diff
  • terraform fmt -check -recursive examples
  • bash scripts/check-docs.sh
  • bash scripts/check-markdown-links.sh
  • git diff --check
  • missing-TF_ACC safety run against an unreachable base URL skipped before networking

actionlint was unavailable locally; the workflow expressions were inspected manually and are exercised by hosted GitHub validation.

Live acceptance was not run locally because real credentials and release-owned app fixture selectors are unavailable. One complete manual matrix run remains a v1 tag gate.

Deferred

Deterministic deployment creation remains blocked separately. App invocation, logs, screenshots, live view, environment values, and all other runtime operations remain intentionally unsupported.


Note

Low Risk
Test and CI/documentation changes only; no provider runtime or authentication logic is modified.

Overview
Adds live acceptance coverage for the kernel_app data source, clearing the last registered data-source fixture blocker in the v1 matrix.

A new TestAccAppDataSourceExplicitAndProviderDefaultScope test reads a release-owned running app via KERNEL_ACC_APP_NAME and KERNEL_ACC_APP_VERSION (non-secret repo variables). It asserts explicit project_id and provider-default scope resolve the same id, deployment_id, and region, checks app_name / version, and runs a plan-only no-drift step—without creating deployments or invoking actions.

The manual Acceptance workflow gains an App data source matrix job with app_fixture_required, preflight checks for those variables, and env injection on go test. docs/acceptance.md documents the new env vars, updates the matrix row from fixture-blocked to test present, and lists the ninth package command.

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

IlyaasK and others added 6 commits July 10, 2026 09:35
Set the durable v1 target and release gates before resource implementation begins.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use the latest tagged SDK while keeping provider behavior unchanged.
Expose org-scoped project mutations without automatic retries so Terraform resource work can use the generated SDK safely.
Define the durable project schema and pure SDK conversion boundary before wiring resource lifecycle behavior.
Model definite, successful, and uncertain project creation without exposing a partial Terraform resource. Preserve recoverable identity on ambiguous outcomes and direct operators to import before retrying.
@IlyaasK
IlyaasK marked this pull request as ready for review July 11, 2026 18:52
@IlyaasK
IlyaasK requested review from Sayan- and tnsardesai and removed request for Sayan- and tnsardesai July 11, 2026 18:52
IlyaasK added 8 commits July 13, 2026 09:29
Join all project flatten diagnostics in uncertain create outcomes so operators see every invalid durable field. Add a regression test covering simultaneous missing ID and name values.
Read projects by canonical state ID, remove state only for coded not-found responses, and reject malformed or identity-changing API responses. Cover the pure unregistered lifecycle core with focused tests.
Build SDK error and response fixtures before parallel Create subtests so helper failures use the owning parent test before child execution begins.
Build a name-only SDK patch for changed project plans, skip unchanged names, and reject unknown values before the network boundary.
Apply name-only patches by canonical state ID, skip no-op updates, and validate complete SDK responses before returning new Terraform state.
Implement non-force project deletion with explicit state-preserving diagnostics, idempotent coded-not-found handling, and focused status-boundary tests. Document the API's indistinguishable projects-disabled not-found response as a residual provider risk.
Seed imported project state with the exact non-empty canonical ID and an unknown name so the normal Read lifecycle settles durable state.
Translate Terraform create plans into the reviewed project creation core and persist recoverable identity before uncertain diagnostics. Keep registration deferred until the complete lifecycle is wired.
@IlyaasK
IlyaasK force-pushed the hypeship/proxy-data-source-acceptance branch from 607deeb to 8435357 Compare July 13, 2026 13:35
@IlyaasK
IlyaasK force-pushed the hypeship/app-data-source-acceptance branch from 42e648d to f6258e5 Compare July 13, 2026 13:35
@IlyaasK
IlyaasK force-pushed the hypeship/proxy-data-source-acceptance branch from 8435357 to 3c04dbb Compare July 13, 2026 14:32
@IlyaasK
IlyaasK force-pushed the hypeship/app-data-source-acceptance branch from f6258e5 to 21b0ea2 Compare July 13, 2026 14:32

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 21b0ea2. Configure here.

}
acctest.PreCheck(t)

projectID := requireAppFixtureEnv(t, acctest.EnvProjectID)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong fixture error for project

Low Severity

requireAppFixtureEnv is used to load KERNEL_PROJECT_ID, but its failure text always says the variable must identify the release-owned app fixture. A missing project ID therefore surfaces a misleading message instead of the project-scoped wording used in other data source acceptance tests.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 21b0ea2. Configure here.

IlyaasK added 4 commits July 13, 2026 11:24
Separate recovery guidance for creates with and without recoverable state, and normalize empty SDK errors so Terraform always reports an actionable reason.
Refresh validated durable state, remove only confirmed missing projects, and preserve pre-populated Terraform state on diagnostics or malformed input.
Translate Framework update requests into the tested project update core while preserving prior state on diagnostics and no-op plans.
Decode prior project state, delegate to the non-force delete core, and preserve Terraform ownership by returning diagnostics on malformed state or API failure.
@IlyaasK
IlyaasK force-pushed the hypeship/proxy-data-source-acceptance branch from 3c04dbb to aef4842 Compare July 13, 2026 15:39
@IlyaasK
IlyaasK force-pushed the hypeship/app-data-source-acceptance branch from 21b0ea2 to 269fe20 Compare July 13, 2026 15:39
IlyaasK added 25 commits July 21, 2026 16:13
Add a Terraform 1.11-compatible extension example that tracks exact archive bytes with filesha256, publish the same snippet and import forms in generated Registry docs, and update the example index. This gives users a validated durable upload workflow without bundling a binary archive.
Prefer the API's authoritative resolved profile ID and ordered extension IDs over echoed selectors, validate their raw response shape before writing Terraform state, and retain only an ID-based compatibility path for older responses. This prevents name selectors from becoming non-canonical durable state.
When Kernel resolves a pool's extension IDs to an empty list, retain Terraform's prior distinction between an omitted attribute and an explicitly empty list. Validate the authoritative response first so malformed data still fails visibly, and cover both convergence paths.
Expose exact browser pool lookup by ID or name with predictable project scoping. Keep the first slice limited to canonical identity, name, and durable size so runtime state cannot enter Terraform.
Read canonical profile and ordered extension IDs from the SDK response, with strict validation and ID-only fallback for legacy echoes. Keep runtime fields outside Terraform state.
Read proxy and launch-mode fields into durable data-source state. Reject explicit null or malformed SDK values and preserve known false booleans through Terraform serialization.
Read start URL, timeout, and fill rate into durable data-source state. Validate SDK response types and ranges while preserving omitted values and known zero.
Read viewport configuration into a typed Terraform object. Reject malformed dimensions and preserve omitted viewport and refresh-rate values without partial state.
Normalize SDK Chrome-policy JSON into stable Terraform string state. Keep loose maps at the response boundary and preserve absent or null policy compatibility.
Add opt-in acceptance coverage for ID and exact-name lookup, durable state flattening, no-drift planning, project overrides, and cleanup. Run it only from the manual acceptance matrix.
Record the missing tagged proxy rename surface and the write-only password/import design required before Terraform can safely manage proxies.
Define the durable deployment lifecycle, partial-state recovery, write-only secret handling, import limits, and the API/SDK contracts required before implementation. Omit deployment force because the API currently forwards but does not consume it.
@IlyaasK
IlyaasK force-pushed the hypeship/app-data-source-acceptance branch from 959e321 to dcbf871 Compare July 21, 2026 20:15
@IlyaasK
IlyaasK force-pushed the hypeship/proxy-data-source-acceptance branch 4 times, most recently from 15f7e92 to f41e8d5 Compare July 29, 2026 19:06
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