Skip to content

Expose browser pool resolved references - #75

Open
IlyaasK wants to merge 1 commit into
hypeship/browser-pool-data-source-corefrom
hypeship/browser-pool-data-source-resolved-refs
Open

Expose browser pool resolved references#75
IlyaasK wants to merge 1 commit into
hypeship/browser-pool-data-source-corefrom
hypeship/browser-pool-data-source-resolved-refs

Conversation

@IlyaasK

@IlyaasK IlyaasK commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add computed profile_id to kernel_browser_pool
  • add computed ordered extension_ids
  • prefer authoritative top-level resolved IDs from the Kernel Go SDK
  • accept legacy response echoes only when they contain IDs
  • validate omission, nullability, element types, non-empty IDs, and list order
  • update generated Registry documentation

Why this belongs in v1

This extends the read-only browser-pool data source with stable durable identities. It is additive to the v0 provider and intentionally separate from the core lookup/project-scope PR so canonical-reference semantics can be reviewed independently.

API contract and state semantics

Top-level profile_id and extension_ids are authoritative because browser_pool_config may echo name selectors supplied during creation. Authoritative fields always win. For older responses that omit them, fallback succeeds only when the echoed profile/extensions already contain canonical IDs.

profile_id omission means no profile; explicit JSON null is rejected because the SDK field is optional but non-nullable. An authoritative empty extension_ids array becomes an empty computed Terraform list. Extension order is preserved.

Intentionally unsupported in this PR

  • remaining browser-pool durable scalar configuration
  • viewport and Chrome policy
  • runtime counters or leased/session state
  • browser-pool writes
  • live acceptance coverage

No v0 behavior is removed or changed.

Tests run

  • go test -count=20 ./internal/datasources/browserpool
  • go test -race ./internal/datasources/browserpool ./internal/provider
  • go test -short -timeout=2m ./...
  • go vet ./...
  • test -z "$(gofmt -l cmd internal)"
  • go mod verify
  • go mod tidy -diff
  • terraform fmt -check -recursive examples
  • bash scripts/check-docs.sh
  • git diff --check

Tests cover authoritative precedence, legacy ID-only fallback, profile omission, explicit null rejection, empty and ordered extension lists, malformed field types, empty IDs, and selector-name rejection.

Acceptance status

Not run in this PR. Live SDK resolved-reference responses, GET-by-name, and project scoping remain a non-blocking integration risk for the later opt-in acceptance slice.


Note

Low Risk
Additive read-only data source attributes with validation; no writes or changes to existing lookup behavior.

Overview
Adds read-only profile_id and ordered extension_ids to the kernel_browser_pool data source so Terraform can reference stable IDs instead of name selectors echoed in browser_pool_config.

Flattening prefers top-level SDK profile_id / extension_ids when present; otherwise it falls back to legacy nested profile/extension objects only when they include canonical IDs (name-only echoes are rejected). Invalid shapes (null profile, malformed lists, empty IDs) surface as diagnostics.

Docs and unit tests cover authoritative precedence, legacy fallback, omission, and rejection cases.

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

@IlyaasK
IlyaasK requested review from Sayan- and tnsardesai and removed request for Sayan- and tnsardesai July 11, 2026 10:36
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-core branch from ad9b86d to 2a4d9ad Compare July 13, 2026 13:35
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-resolved-refs branch 2 times, most recently from 867f435 to c957fa0 Compare July 13, 2026 14:32
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-core branch from 825994b to e0f20fd Compare July 13, 2026 15:39
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-resolved-refs branch from c957fa0 to 7bfcdff Compare July 13, 2026 15:39
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-resolved-refs branch from 7bfcdff to 9237b28 Compare July 20, 2026 19:38
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-core branch 2 times, most recently from 63f8898 to feef7a2 Compare July 21, 2026 14:46
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-resolved-refs branch from 9237b28 to baf2210 Compare July 21, 2026 14:46
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-core branch from feef7a2 to d1f6e31 Compare July 21, 2026 18:10
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-resolved-refs branch from baf2210 to b19872f Compare July 21, 2026 18:10
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-core branch from d1f6e31 to f5464c6 Compare July 21, 2026 19:51
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-resolved-refs branch 2 times, most recently from 735c9f6 to 6b2c9bc Compare July 21, 2026 20:15
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-core branch from 2da6ca9 to e1a5354 Compare July 31, 2026 19:17
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.
@IlyaasK
IlyaasK force-pushed the hypeship/browser-pool-data-source-resolved-refs branch from 6b2c9bc to 7637450 Compare July 31, 2026 19:21
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