Skip to content

Commit 8931430

Browse files
committed
Document the first public v1 migration
1 parent f6258e5 commit 8931430

7 files changed

Lines changed: 118 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@ All notable changes to the Kernel Terraform provider are recorded here.
44

55
## Unreleased
66

7-
Initial v0 release candidate:
7+
First public v1 release candidate:
88

99
- Provider configuration for `api_key`, `base_url`, and `project_id`.
10-
- `kernel_browser_pool` resource for durable browser pool configuration.
11-
- `kernel_project`, `kernel_profile`, `kernel_proxy`, and `kernel_extension` lookup data sources.
12-
- `kernel_browser_pool` import support.
13-
- Unit tests, generated Terraform docs, examples, CI checks, and opt-in acceptance test harness.
10+
- Durable `kernel_project`, `kernel_browser_pool`, and `kernel_extension` resources.
11+
- Lookup-only `kernel_app`, `kernel_browser_pool`, `kernel_project`, `kernel_profile`, `kernel_proxy`, and `kernel_extension` data sources.
12+
- Stable import for every registered resource, including project-qualified browser-pool and extension forms.
13+
- Unit tests, generated Terraform docs, Terraform examples, CI checks, and an opt-in live acceptance matrix.
1414

15-
Intentionally unsupported in v0:
15+
Intentionally deferred from the first public v1 because their durable API, SDK, or sensitive-state contracts are incomplete:
1616

1717
- Runtime browser/session operations such as acquire, release, flush, app invocation, screenshots, logs, live view, and force recovery.
18-
- API key, project, profile, proxy, or extension resources.
18+
- API key, profile, proxy, and deployment resources.
19+
- API key and deployment data sources.
1920
- `force_destroy` browser-pool deletion.
2021
- Terraform Plugin Framework code generation.
22+
23+
Internal v0 configurations can move to v1 without a provider source-address change. Follow [the v1 migration guide](docs/migration-v1.md) before importing existing durable objects.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Resources:
2121
Data sources:
2222

2323
- `kernel_app`
24+
- `kernel_browser_pool`
2425
- `kernel_project`
2526
- `kernel_profile`
2627
- `kernel_proxy`
@@ -160,3 +161,5 @@ single source for current coverage, tag blockers, and the release-run record.
160161
See [docs/architecture.md](docs/architecture.md) for package layout, Terraform semantics, testing strategy, and release planning.
161162

162163
See [docs/concerns.md](docs/concerns.md) for SDK/API/provider concerns and deferred v1 work discovered while building the provider.
164+
165+
See [docs/migration-v1.md](docs/migration-v1.md) before moving an internal v0 configuration or existing Kernel object under v1 management.

docs/architecture.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -346,20 +346,18 @@ Prefer PRs that add one durable behavior at a time, with tests that prove the ne
346346

347347
## Review Gates
348348

349-
Every PR loop has six sequential gates:
349+
Every PR loop has four sequential gates:
350350

351351
1. `deslop`
352352
2. incremental self-review
353353
3. `autoreview`
354-
4. `dave-cheney-go-review`
355-
5. `eblog-code-review`
356-
6. final agreement pass
354+
4. final agreement pass
357355

358356
Loop:
359357

360358
1. Implement the PR scope.
361359
2. Run gofmt, go test, go vet, and relevant Terraform validation.
362-
3. Run all six review gates in order.
360+
3. Run all four review gates in order.
363361
4. Fix every accepted and actionable finding.
364362
5. Rerun tests.
365363
6. Rerun the affected review gates.

docs/migration-v1.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Migrate Internal v0 Configurations To v1
2+
3+
The first public Kernel provider release is v1. Earlier v0 builds and tags were
4+
internal release candidates, so there is no public registry upgrade path or
5+
published v0 state migration.
6+
7+
## Existing Browser Pools
8+
9+
The provider source address remains `kernel/kernel`, and existing
10+
`kernel_browser_pool` state remains the same resource type. Before upgrading:
11+
12+
1. Run `terraform plan` with the current internal provider build and save the output.
13+
2. Upgrade to v1 in a non-production workspace first.
14+
3. Run `terraform plan` again and review every durable field, especially project scope, profile/proxy references, ordered extensions, Chrome policy, viewport, launch settings, and warmup settings.
15+
4. Do not accept a plan that introduces runtime counters, lease state, standby state, or browser-session operations; v1 does not model them.
16+
17+
Browser-pool deletion remains non-forceful. V1 does not terminate leased
18+
browsers to make deletion succeed.
19+
20+
## Adopt Existing Resources
21+
22+
Add valid destination resource blocks before importing. The names and pool size
23+
below are illustrative; reconcile every configured field with the remote object
24+
before applying:
25+
26+
```hcl
27+
resource "kernel_project" "example" {
28+
name = "existing-project-name"
29+
}
30+
31+
resource "kernel_browser_pool" "example" {
32+
name = "existing-pool-name"
33+
size = 1
34+
}
35+
36+
resource "kernel_extension" "example" {}
37+
```
38+
39+
Then import each durable object. Choose only one import form for each
40+
project-scoped resource:
41+
42+
```sh
43+
terraform import kernel_project.example <project-id>
44+
45+
# Browser pool: choose the bare or project-qualified form.
46+
terraform import kernel_browser_pool.example <browser-pool-id>
47+
# or
48+
terraform import kernel_browser_pool.example <project-id>/<browser-pool-id>
49+
50+
# Extension: choose the bare or project-qualified form.
51+
terraform import kernel_extension.example <extension-id>
52+
# or
53+
terraform import kernel_extension.example <project-id>/<extension-id>
54+
```
55+
56+
Use project-qualified import when the object is outside the resolved project
57+
scope: the provider default when configured, otherwise the API key's project
58+
binding. After import, run `terraform plan` and reconcile configuration with
59+
the durable state returned by Kernel before applying changes.
60+
61+
Extension import is metadata-only: it cannot recover the original local archive
62+
path. Managing future content replacement requires Terraform 1.11 or later plus
63+
`source_path` and `source_sha256 = filesha256(source_path)`.
64+
65+
## Newly Available Lookups
66+
67+
V1 adds lookup-only app and browser-pool data sources alongside project,
68+
profile, proxy, and extension lookups. Data sources do not adopt or mutate the
69+
remote object. Exact lookup fails when no object or multiple objects match.
70+
71+
## Deferred Surfaces
72+
73+
Do not translate SDK or API operations into ad hoc Terraform resources while
74+
waiting for deferred v1.x work. API key, profile, proxy, and deployment
75+
resources remain unavailable until their documented durable and sensitive-state
76+
contracts are complete. App invocation, browser sessions, logs, screenshots,
77+
live view, health checks, and recovery operations remain outside Terraform.

docs/release.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@ Use this checklist before publishing a Kernel Terraform provider version.
1313
- Run `go test -short -timeout=2m ./...`.
1414
- Run `go vet ./...`.
1515
- Run the complete [v1 acceptance matrix](acceptance.md) for every registered v1 resource and data source with real credentials before the first public release.
16+
- Configure `KERNEL_ACC_APP_NAME` and `KERNEL_ACC_APP_VERSION` repository variables to identify exactly one running app version in the acceptance project.
17+
- Review the [v1 migration guide](migration-v1.md) and include it in the release notes.
1618
- Use the commands and status table in `docs/acceptance.md` as the single source of truth. The manual `Acceptance` workflow runs all current packages in parallel; add each new package in the same PR as its first live test and keep live tests out of normal PR CI.
1719
- Process-level timeouts can bypass Go test cleanup. After an interrupted or hard-timeout run:
18-
1. In the Kernel dashboard or durable API, find projects, browser pools, and extensions named `kernel-tf-*` that were created during the failed workflow run.
20+
1. In the Kernel dashboard or durable API, find projects, browser pools, extensions, profiles, and proxies named `kernel-tf-*` that were created during the failed workflow run.
1921
2. Delete leaked browser pools first with `force=false`. If deletion conflicts with a lease, wait for the lease to end; do not force-release or recover the browser from Terraform cleanup.
2022
3. Delete leaked extensions after removing any durable browser-pool references to them. Do not mutate pools or running browsers implicitly.
21-
4. Delete a leaked project only after its child resources are gone and the organization still has another active project.
22-
5. Read each canonical resource ID and require a 404 before considering cleanup complete.
23+
4. Delete leaked profiles and managed datacenter proxies after removing durable references. Do not run proxy health checks as cleanup.
24+
5. Delete a leaked project only after its child resources are gone and the organization still has another active project.
25+
6. Do not delete the release-owned app fixture; it is not created by the acceptance run.
26+
7. Read each test-owned canonical resource ID and require a 404 before considering cleanup complete.
2327
- Verify unscoped API calls send no `X-Kernel-Project-Id` header; it is sent only when a resource-level `project_id` or the provider default resolves a project.
2428
- Confirm `terraform-registry-manifest.json` contains protocol `["6.0"]` for Terraform Plugin Framework.
2529
- Confirm the repository license before the first public release. Do not publish a public tag until `LICENSE` exists or the release owner has explicitly documented the licensing decision.

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ Use local development overrides while the provider is unreleased. See the root [
1818
- [basic-browser-pool](basic-browser-pool) creates a minimal durable browser pool.
1919
- [design-preview-browser-pool](design-preview-browser-pool) shows a browser pool shaped for repeated design-preview checks without modeling the browser sessions themselves.
2020
- [extension](extension) uploads an immutable extension archive and tracks exact content changes with `filesha256`.
21-
- [lookups](lookups) shows read-only app, project, profile, proxy, and extension data sources.
21+
- [lookups](lookups) shows read-only app, browser-pool, project, profile, proxy, and extension data sources.
2222
- [project](project) creates a durable Kernel project with an explicit unique name.
2323
- [project-scoped-browser-pool](project-scoped-browser-pool) places a browser pool in an explicit project, overriding the provider-level `project_id` default.

examples/lookups/main.tf

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ variable "project_name" {
1313
description = "Existing Kernel project name for exact lookup."
1414
}
1515

16+
variable "browser_pool_name" {
17+
type = string
18+
description = "Existing Kernel browser pool name for exact lookup."
19+
}
20+
1621
variable "profile_name" {
1722
type = string
1823
description = "Existing Kernel profile name for exact lookup."
@@ -42,6 +47,11 @@ data "kernel_project" "selected" {
4247
name = var.project_name
4348
}
4449

50+
data "kernel_browser_pool" "selected" {
51+
name = var.browser_pool_name
52+
project_id = data.kernel_project.selected.id
53+
}
54+
4555
data "kernel_profile" "selected" {
4656
name = var.profile_name
4757
project_id = data.kernel_project.selected.id
@@ -65,11 +75,12 @@ data "kernel_app" "selected" {
6575

6676
output "kernel_ids" {
6777
value = {
68-
project_id = data.kernel_project.selected.id
69-
profile_id = data.kernel_profile.selected.id
70-
proxy_id = data.kernel_proxy.selected.id
71-
extension_id = data.kernel_extension.selected.id
72-
app_id = data.kernel_app.selected.id
73-
deployment_id = data.kernel_app.selected.deployment_id
78+
project_id = data.kernel_project.selected.id
79+
browser_pool_id = data.kernel_browser_pool.selected.id
80+
profile_id = data.kernel_profile.selected.id
81+
proxy_id = data.kernel_proxy.selected.id
82+
extension_id = data.kernel_extension.selected.id
83+
app_id = data.kernel_app.selected.id
84+
deployment_id = data.kernel_app.selected.deployment_id
7485
}
7586
}

0 commit comments

Comments
 (0)