Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
b23992d
Define v1 provider architecture
IlyaasK Jul 9, 2026
10249d7
Document v1 codegen rejection
IlyaasK Jul 10, 2026
3fff757
Update Kernel Go SDK to v0.76.0
IlyaasK Jul 10, 2026
f42974c
Add durable project client methods
IlyaasK Jul 10, 2026
51e83b5
Add project resource model helpers
IlyaasK Jul 10, 2026
fa79663
Add project create outcome handling
IlyaasK Jul 10, 2026
60b3d6e
Report every malformed project response field
IlyaasK Jul 13, 2026
7129b4b
Add project read state handling
IlyaasK Jul 10, 2026
b8065d0
Fix parallel project test fixtures
IlyaasK Jul 10, 2026
92bed10
Add project update params
IlyaasK Jul 10, 2026
01d3284
Add project update core
IlyaasK Jul 10, 2026
f454542
Add project delete core
IlyaasK Jul 10, 2026
ac4e2c3
Add project import state helper
IlyaasK Jul 10, 2026
e6b75ea
Add project Framework create adapter
IlyaasK Jul 10, 2026
53727b3
Clarify uncertain project create recovery
IlyaasK Jul 13, 2026
0b502c4
Add project Framework read adapter
IlyaasK Jul 10, 2026
c760f76
Add project Framework update adapter
IlyaasK Jul 10, 2026
5dd2ad0
Add project Framework delete adapter
IlyaasK Jul 10, 2026
b80c500
Strengthen project delete diagnostic test
IlyaasK Jul 20, 2026
23f145b
Add project Framework import adapter
IlyaasK Jul 10, 2026
0637e41
Complete project resource interface
IlyaasK Jul 10, 2026
61b7fde
Register project resource
IlyaasK Jul 10, 2026
f31770f
Add project acceptance cleanup
IlyaasK Jul 11, 2026
d3f27d5
Add project lifecycle acceptance test
IlyaasK Jul 11, 2026
84ebe64
Expand manual acceptance matrix
IlyaasK Jul 11, 2026
ea0bc0f
Clarify project acceptance requirements
IlyaasK Jul 21, 2026
af1bc97
Add project resource example
IlyaasK Jul 11, 2026
0edca90
Clarify project example credentials
IlyaasK Jul 21, 2026
f8b15a7
Document extension resource contract
IlyaasK Jul 11, 2026
3bde47d
Add extension resource schema
IlyaasK Jul 11, 2026
598f3b6
Clarify extension replacement semantics
IlyaasK Jul 11, 2026
2daf666
Add durable extension client methods
IlyaasK Jul 11, 2026
f50e1a0
Add extension archive snapshot
IlyaasK Jul 11, 2026
cd520c9
Build extension upload parameters
IlyaasK Jul 11, 2026
17bcad9
Accumulate extension upload diagnostics
IlyaasK Jul 11, 2026
bed4bab
Flatten extension upload responses
IlyaasK Jul 11, 2026
a1248c6
Classify uncertain extension uploads
IlyaasK Jul 11, 2026
493ab3e
Prepare extension uploads from configuration
IlyaasK Jul 11, 2026
2ceae11
Orchestrate extension uploads safely
IlyaasK Jul 11, 2026
4ef6d3d
Wire extension uploads into Terraform Create
IlyaasK Jul 11, 2026
a890eb5
Flatten extension metadata for resource state
IlyaasK Jul 11, 2026
70396df
Read extension metadata safely
IlyaasK Jul 11, 2026
d503c89
Wire extension metadata into Terraform Read
IlyaasK Jul 11, 2026
cb4e287
Delete extensions without implicit cleanup
IlyaasK Jul 11, 2026
6b1210f
Wire extension deletion into Terraform
IlyaasK Jul 11, 2026
345affd
Import extensions with stable project scope
IlyaasK Jul 11, 2026
073a4b8
Register the durable extension resource
IlyaasK Jul 11, 2026
88438e4
Test the extension lifecycle against Kernel
IlyaasK Jul 11, 2026
0e38db9
Document extension upload and import
IlyaasK Jul 11, 2026
9840d0a
Flatten resolved browser pool references
IlyaasK Jul 11, 2026
e569d69
Preserve empty extension configuration intent
IlyaasK Jul 11, 2026
2da6ca9
Add browser pool core data source
IlyaasK Jul 11, 2026
6b2c9bc
Expose browser pool resolved references
IlyaasK Jul 11, 2026
67489e8
Expose browser pool launch configuration
IlyaasK Jul 11, 2026
1bcac42
Expose browser pool warmup configuration
IlyaasK Jul 11, 2026
1b81db1
Expose browser pool viewport
IlyaasK Jul 11, 2026
a0a227d
Expose browser pool Chrome policy
IlyaasK Jul 11, 2026
f868d78
Test browser pool data source against Kernel
IlyaasK Jul 11, 2026
069b7c3
Document proxy resource release gate
IlyaasK Jul 11, 2026
b56f33f
Document deployment resource release gate
IlyaasK Jul 11, 2026
13d3216
Add durable app lookup data source
IlyaasK Jul 11, 2026
7c330ea
Define safe API key state boundaries
IlyaasK Jul 11, 2026
df516af
Define the v1 acceptance release gate
IlyaasK Jul 11, 2026
3910e5c
Verify browser pool data source cleanup
IlyaasK Jul 11, 2026
afaed74
Require coded not-found in destroy check
IlyaasK Jul 11, 2026
b173cc2
Test project data source against Kernel
IlyaasK Jul 11, 2026
ebe2c13
Test extension data source against Kernel
IlyaasK Jul 11, 2026
86b58f3
Test project-qualified extension import
IlyaasK Jul 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 47 additions & 16 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,53 @@ concurrency:
cancel-in-progress: false

jobs:
browser-pool:
name: Browser pool acceptance
durable-resource:
name: ${{ matrix.name }} acceptance
runs-on: ubuntu-latest
# Keep the job timeout above the go test -timeout below: the job budget
# also covers checkout/toolchain setup, and if it fires first it kills the
# test process before t.Cleanup can delete the pools it created.
strategy:
fail-fast: false
matrix:
include:
- name: Browser pool
package: ./internal/resources/browserpool
project_id_required: true
- name: Browser pool data source
package: ./internal/datasources/browserpool
project_id_required: true
- name: Project
package: ./internal/resources/project
project_id_required: false
- name: Project data source
package: ./internal/datasources/project
project_id_required: true
- name: Extension
package: ./internal/resources/extension
project_id_required: true
- name: Extension data source
package: ./internal/datasources/extension
project_id_required: true
# Keep the job timeout above the go test timeout so Go can report the test
# timeout before the runner stops the job. Either hard timeout can bypass
# t.Cleanup, so release operators still inspect for leaked test resources.
timeout-minutes: 40
env:
TF_ACC: "1"
KERNEL_ACC: "1"
KERNEL_API_KEY: ${{ secrets.KERNEL_API_KEY }}
KERNEL_PROJECT_ID: ${{ secrets.KERNEL_PROJECT_ID }}
KERNEL_ALT_PROJECT_ID: ${{ secrets.KERNEL_ALT_PROJECT_ID }}
KERNEL_BASE_URL: ${{ secrets.KERNEL_BASE_URL }}

steps:
- name: Check API key secret
env:
KERNEL_API_KEY: ${{ secrets.KERNEL_API_KEY }}
run: |
: "${KERNEL_API_KEY:?Set the KERNEL_API_KEY repository secret before running acceptance tests.}"

- name: Check project secret
if: matrix.project_id_required
env:
KERNEL_PROJECT_ID: ${{ secrets.KERNEL_PROJECT_ID }}
run: |
: "${KERNEL_PROJECT_ID:?Set the KERNEL_PROJECT_ID repository secret before running project-scoped acceptance tests.}"

- name: Checkout
uses: actions/checkout@v6

Expand All @@ -42,10 +73,10 @@ jobs:
terraform_version: "1.15.5"
terraform_wrapper: false

- name: Check required secrets
run: |
: "${KERNEL_API_KEY:?Set the KERNEL_API_KEY repository secret before running acceptance tests.}"
: "${KERNEL_PROJECT_ID:?Set the KERNEL_PROJECT_ID repository secret before running acceptance tests.}"

- name: Run browser pool acceptance tests
run: go test -count=1 -timeout=30m -v ./internal/resources/browserpool -run TestAcc
- name: Run acceptance tests
env:
KERNEL_API_KEY: ${{ secrets.KERNEL_API_KEY }}
KERNEL_BASE_URL: ${{ secrets.KERNEL_BASE_URL }}
KERNEL_PROJECT_ID: ${{ matrix.project_id_required && secrets.KERNEL_PROJECT_ID || '' }}
KERNEL_ALT_PROJECT_ID: ${{ matrix.project_id_required && secrets.KERNEL_ALT_PROJECT_ID || '' }}
run: go test -count=1 -timeout=30m -v ${{ matrix.package }} -run TestAcc
37 changes: 26 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@ Terraform provider for durable Kernel infrastructure configuration.

This provider manages desired state only. Browser/session runtime operations stay in the Kernel SDK and API.

## Supported In v0
## Supported

Provider configuration:

- `api_key`
- `base_url`
- `project_id`

Resource:
Resources:

- `kernel_browser_pool`
- `kernel_extension`
- `kernel_project`

Data sources:

- `kernel_app`
- `kernel_project`
- `kernel_profile`
- `kernel_proxy`
Expand All @@ -26,8 +29,10 @@ Data sources:
Import:

- `kernel_browser_pool` by canonical browser pool ID
- `kernel_extension` by canonical extension ID, optionally qualified with its project ID
- `kernel_project` by canonical project ID

## Not Supported In v0
## Not Supported

The provider intentionally does not manage:

Expand All @@ -37,8 +42,8 @@ The provider intentionally does not manage:
- logs, screenshots, or live view
- runtime status or standby state
- force-release or recovery operations
- API key or project resources
- extension upload, download, delete, or Chrome Store operations
- API key, profile, proxy, or deployment resources
- extension download or Chrome Web Store download operations

## Quickstart

Expand Down Expand Up @@ -74,11 +79,16 @@ resource "kernel_browser_pool" "example" {
}
```

Import an existing browser pool. The bare form resolves the project like create (provider default, else the API key's binding); use the project-qualified form to import from a different project:
Import existing resources by canonical ID. For browser pools, the bare form
resolves the project like create (provider default, else the API key's binding);
use the project-qualified form to import from a different project:

```sh
terraform import kernel_browser_pool.example <browser-pool-id>
terraform import kernel_browser_pool.example <project-id>/<browser-pool-id>
terraform import kernel_extension.example <extension-id>
terraform import kernel_extension.example <project-id>/<extension-id>
terraform import kernel_project.example <project-id>
```

## Local Development
Expand Down Expand Up @@ -128,22 +138,27 @@ Do not run `terraform init` just to exercise this unreleased provider through `d

Acceptance tests are opt-in because they can create real Kernel resources.

Required environment:
Required for all acceptance tests:

```sh
export TF_ACC=1
export KERNEL_ACC=1
export KERNEL_API_KEY="..."
export KERNEL_PROJECT_ID="..."
```

Run the browser-pool acceptance test:
Browser-pool acceptance tests additionally require:

```sh
go test -v ./internal/resources/browserpool -run TestAccBrowserPoolLifecycle
export KERNEL_PROJECT_ID="..."
```

The acceptance test creates uniquely named browser pools and uses durable `force=false` cleanup. It does not acquire browsers or perform runtime recovery.
The tests create uniquely named durable resources and register independent
cleanup. Extension acceptance creates a small temporary Manifest V3 archive and
tests checksum-driven replacement. Browser-pool deletion remains `force=false`.
The tests do not acquire browsers or perform runtime recovery.

Use the commands in the [v1 acceptance matrix](docs/acceptance.md), which is the
single source for current coverage, tag blockers, and the release-run record.

## Architecture

Expand Down
92 changes: 92 additions & 0 deletions docs/acceptance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# v1 Acceptance Matrix

This document is the live-API release gate for the first public v1. Unit tests
remain the fast default; acceptance tests run only through explicit local opt-in
or the manual GitHub Actions workflow.

## Gate Rules

- Set both `TF_ACC=1` and `KERNEL_ACC=1`.
- Use unique `kernel-tf-*` names for every created fixture.
- Register cleanup as soon as a canonical ID exists.
- Verify deletion with a coded `not_found` response where the API supports it.
- Never acquire, release, flush, invoke, force-release, or recover runtime state.
- Keep live tests out of pull-request CI.
- Record one complete green matrix run against the release commit before tagging.
- Every registered v1 surface must have a live acceptance test and pass against
the release commit. A fixture blocker is a v1 tag blocker, not a release-note
exception. An unregistered deferred resource is not part of the live matrix.

## Environment

The current workflow uses:

```sh
export TF_ACC=1
export KERNEL_ACC=1
export KERNEL_API_KEY=...
export KERNEL_PROJECT_ID=...
export KERNEL_ALT_PROJECT_ID=... # optional second project
export KERNEL_BASE_URL=... # optional non-production API
```

Future fixture-backed data-source tests may add narrowly named variables only
when the provider cannot create and clean up the fixture through a durable SDK
operation. Secrets must remain GitHub Actions secrets and must not be printed.

## Current Matrix

| Surface | Repository test status | Acceptance scenario | Required follow-up |
| --- | --- | --- | --- |
| `kernel_project` resource | Test present | Create, rename, no-drift plan, import, delete, and 404 verification. | None. |
| `kernel_browser_pool` resource | Test present | Create, durable update with stable ID, no-drift plan, bare and project-qualified import paths, explicit project scope, non-force delete, and 404 verification. | Keep leased-browser conflict behavior in unit tests; acceptance must not create runtime leases. |
| `kernel_extension` resource | Test present | Upload, checksum state, no-drift plan, bare and project-qualified metadata-only import paths, content replacement with new ID, old-ID disappearance, delete, and 404 verification. | None. |
| `kernel_browser_pool` data source | Test present | A uniquely created pool is read by canonical ID and byte-exact name, including normalized durable configuration, a no-drift plan, and post-destroy coded `not_found` verification. | None. |
| `kernel_project` data source | Test present | A uniquely created project is read by canonical ID and exact name; the provider default resolves the configured project; metadata, no-drift planning, and post-destroy coded `not_found` are verified. | None. |
| `kernel_extension` data source | Test present | A uniquely uploaded extension is read by canonical ID and exact name through explicit and provider-default project scope; metadata, no-drift planning, and post-destroy coded `not_found` are verified. | None. |
| `kernel_profile` data source | Test missing; tag blocker | Unit and fake-client tests only. | Add durable SDK fixture create/delete helpers, then verify ID/name lookup and cleanup. Do not model runtime-written profile contents. |
| `kernel_proxy` data source | Test missing; tag blocker | Unit and fake-client tests only. | Add a durable, non-secret-leaking proxy fixture strategy and verify ID/name lookup, masked metadata, and cleanup. |
| `kernel_app` data source | Fixture blocked; tag blocker | Unit, SDK transport, pagination, ambiguity, project-scope, and Framework state tests only. | Provide a release-owned running deployment fixture or a deterministic durable deployment setup. Verify exact app/version lookup without invocation and without exposing env values. |
| `kernel_api_key` data source | Deferred; unregistered | No provider surface yet. | Wait for a tagged SDK with exact-name filtering, then add masked ID/name lookup acceptance. |
| Profile, proxy, deployment, and API-key resources | Deferred; unregistered | No provider surfaces yet. | Enter the matrix only after their documented API/SDK/state blockers are resolved and implementation lands. |

"Test present" describes code in the repository; it does not claim a run
against the release commit. The release record below supplies that evidence.

## Current Commands

Run the six existing packages independently for fast failure isolation:

```sh
go test -count=1 -timeout=30m -v ./internal/resources/project -run TestAcc
go test -count=1 -timeout=30m -v ./internal/datasources/project -run TestAcc
go test -count=1 -timeout=30m -v ./internal/resources/browserpool -run TestAcc
go test -count=1 -timeout=30m -v ./internal/resources/extension -run TestAcc
go test -count=1 -timeout=30m -v ./internal/datasources/extension -run TestAcc
go test -count=1 -timeout=30m -v ./internal/datasources/browserpool -run TestAcc
```

The manual `Acceptance` workflow runs the same packages as separate matrix jobs
with `fail-fast: false`. Add a package to that workflow in the same PR that adds
its first live test.

## Release Record

Record this information in the v1 release PR or release issue, not in this
repository with secrets:

```text
Commit:
Workflow run URL:
API environment:
Started at:
Completed at:
Package results:
Interrupted or timed-out jobs:
Leaked-resource audit completed:
Unregistered deferred surfaces:
```

An interrupted process can bypass `t.Cleanup`. Follow the ordered cleanup and
404 verification procedure in [Release And Security Checklist](release.md)
before rerunning or tagging.
Loading