Skip to content

Expose browser pool profile refresh state - #112

Open
IlyaasK wants to merge 19 commits into
hypeship/browser-pool-refresh-on-profile-update-resourcefrom
hypeship/browser-pool-refresh-on-profile-update-data-source
Open

Expose browser pool profile refresh state#112
IlyaasK wants to merge 19 commits into
hypeship/browser-pool-refresh-on-profile-update-resourcefrom
hypeship/browser-pool-refresh-on-profile-update-data-source

Conversation

@IlyaasK

@IlyaasK IlyaasK commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • expose refresh_on_profile_update as computed durable state on the kernel_browser_pool data source
  • flatten the Kernel SDK response with the existing strict optional-boolean handling
  • preserve known false, return null when omitted, and diagnose malformed API values
  • assert the field for both ID and exact-name lookups in the existing acceptance fixture
  • regenerate the data-source documentation

Why

Browser pools created outside Terraform should expose the same durable profile-refresh policy that the managed resource supports. This keeps read-only lookup behavior consistent with the Kernel API, SDK, and CLI.

Intentionally unsupported

This does not add runtime pool counters, leases, acquire/release/flush operations, force deletion, or any profile mutation behavior.

Verification

  • gofmt -l cmd internal
  • go test -short -timeout=2m ./...
  • go vet ./...
  • terraform fmt -check -recursive examples
  • bash scripts/check-docs.sh
  • bash scripts/check-markdown-links.sh
  • focused tests cover true, known false, omitted, null, non-boolean, Terraform state shape, and both acceptance selectors

The guarded live acceptance matrix passed: https://github.com/kernel/terraform-provider-kernel/actions/runs/30825001264. All seven jobs passed, including browser-pool create/read/update/import/delete and browser-pool data-source lookup by ID and name.

Additional quality verification

  • Gremlins: 44/44 browser-pool data-source mutants killed; targeted refresh semantic mutations: 2/2 killed
  • browser-pool data-source coverage: 93.8%; maximum CRAP score: 15.0
  • Godog refresh data-source suite: 4 scenarios / 12 steps passed

Note

Low Risk
Read-only computed field on a data source; no create/update/delete or auth changes.

Overview
Adds refresh_on_profile_update as a computed read-only attribute on the kernel_browser_pool data source so lookups return the same durable profile-refresh policy as the managed resource.

API values are mapped with the existing flattenOptionalBool rules: known true/false when present, null when omitted, and diagnostics for null or non-boolean payloads. Generated docs and unit/acceptance tests cover schema, flatten behavior, and ID/name lookups.

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

@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-refresh-on-profile-update-resource branch from a342a28 to 20143f3 Compare August 3, 2026 14:31
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-refresh-on-profile-update-data-source branch from bed2926 to 6e85ce8 Compare August 3, 2026 14:36
IlyaasK added 15 commits August 3, 2026 10:52
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.
Lock selector, project scope, and computed attribute semantics after targeted mutation testing exposed missing schema assertions.
Keep schema mutation assertions concise so later browser-pool data source slices can verify their computed-only fields without duplicating type-specific checks.
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.
Assert profile and extension references remain computed-only after semantic mutation testing showed schema-mode changes were not detected.
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.
Expose Kernel's durable refresh_on_profile_update setting through the browser pool resource. Preserve API defaults when omitted, retain explicit false values across profile changes, validate the profile dependency, and cover create/update/read behavior.
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-refresh-on-profile-update-resource branch from 20143f3 to e43bf84 Compare August 3, 2026 14:53
IlyaasK added 2 commits August 3, 2026 10:54
Return refresh_on_profile_update from kernel_browser_pool lookups so imported and externally managed pools expose the same durable policy as the resource. Validate API response types and cover ID/name acceptance state.
Assert the data source exposes refresh_on_profile_update as a computed-only bool so schema drift is caught by unit tests.
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-refresh-on-profile-update-data-source branch from 6e85ce8 to b3a94b8 Compare August 3, 2026 14:54
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-refresh-on-profile-update-resource branch from 09b0ad5 to f4021b9 Compare August 3, 2026 18:25
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