Add profile data source - #14
Conversation
|
Created a monitoring plan for this PR. What this PR does: Adds a Intended effect:
No production API telemetry applies — this is a Terraform provider change that is dormant until users upgrade their provider version and adopt the new data source. Risks:
Status updates will be posted automatically on this PR as monitoring progresses. |
7f11cd1 to
87e666f
Compare
1b53792 to
3c197fe
Compare
87e666f to
2b6927d
Compare
fb46981 to
e074c1b
Compare
2b6927d to
999e100
Compare
e074c1b to
720e1a2
Compare
999e100 to
026d2cf
Compare
720e1a2 to
7f03669
Compare
026d2cf to
855072b
Compare
7f03669 to
e800b1a
Compare
855072b to
2324adc
Compare
e434b60 to
a987861
Compare
KERNEL-1458 Ship v0 Terraform provider for browser pools
tldrShip a v0 Kernel Terraform provider for Framer that manages browser pools only. Keep broader durable Kernel resources, including profiles, projects, and API keys, deferred until after the browser-pool MVP is working and reviewed. ProblemFramer asked for Terraform-managed Kernel infrastructure, and the immediate useful surface is browser pools. The provider should model durable desired state, not runtime browser/session operations. Recent API/SDK contract work has already been done to make this viable. CustomerFramer. v0 scope
Deferred / follow-up scope
Plan and repo
Terraform provider PR contextMerged foundation:
Open v0 stack should stay browser-pool focused:
Potential follow-up data-source work after v0:
API changes made for Terraform/provider correctness
SDK release context
Acceptance criteria
|
1732b67 to
ef1bca7
Compare
a987861 to
9d3991d
Compare
ef1bca7 to
c05ef4a
Compare
eed77b3 to
f68f78e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f68f78e. Configure here.
aa9269d to
6dda104
Compare
f68f78e to
58ecf85
Compare
6dda104 to
8e8be50
Compare
58ecf85 to
26b807a
Compare
8e8be50 to
905f042
Compare
26b807a to
6a48f02
Compare
905f042 to
f78a750
Compare
6a48f02 to
80cc052
Compare
f78a750 to
b05c00b
Compare
80cc052 to
7bb01f5
Compare
b05c00b to
7c0b29f
Compare
405847e to
9bac0d1
Compare
tnsardesai
left a comment
There was a problem hiding this comment.
reviewed — clean PR. generic Page[T], the shared datasources helpers, and the profile/project name-lookup split all read well, and the profile test suite covers the tricky paths (nullable name, id-mismatch guard, ambiguous name). build + tests pass locally.
Nits
internal/datasources/helpers.go— the newdatasourcespackage has no direct test file (go testreports[no test files]);ResolveIDNameSelector/ValidResponseString/ValidResponseTimeare only covered transitively through project/profile. consider a small table test now that they're shared surface area.
9bac0d1 to
b97c471
Compare
Adds the profile data source plus the shared internal/datasources helpers and generic Page[T]/lookupNextOffset pagination. Also switches the project data source name lookup to ProjectService.Get (the API resolves id-or-name, kernel/kernel#2455) instead of a list-and-scan, and drops the now-unused ListProjectPage client method + ProjectPage page type. Pagination error-branch coverage moves to ListProfilePage.
b97c471 to
74bbda8
Compare
|
Thanks @tnsardesai — nit addressed, plus the three Bugbot findings on this PR are now resolved (replies on each thread). Nit — no direct tests for the shared Also folded in on this head: profile scan hardening (filter-first + match-only validation + dedupe-by-id), a name-collision guard on the project Get path, and authoritative |

What changed
kernel_profiledata source withidor exactnamelookup.internal/kernelclientwrapper.X-Has-Moreis inconsistent withX-Next-Offset.kernel_profilewith the provider and adds focused unit tests.Intentionally unsupported
last_used_atorupdated_atin Terraform state because profile runtime load/save paths can change them.project_idfor profile selection;kernel_profilerequires explicitidorname.Tests run
GOCACHE=/private/tmp/terraform-provider-kernel-go-cache go test ./internal/datasources/... ./internal/kernelclient ./internal/providerGOCACHE=/private/tmp/terraform-provider-kernel-go-cache go test ./...GOCACHE=/private/tmp/terraform-provider-kernel-go-cache go vet ./...git diff --check project-data-sourcegit diff --check project-data-source..HEADgofmt -lon changed Go filesReview gates
All five review gates passed after accepted fixes were applied and tests were rerun:
Note
Medium Risk
New data source and changed project name-lookup behavior affect how users resolve projects and profiles; pagination and API response validation are security-relevant for correct targeting but are well-tested.
Overview
Adds
kernel_profileso Terraform can read durable profile metadata byidor exactname, with optionalproject_idscoping and onlycreated_atin state (no runtimeupdated_at/last_used_at).Introduces shared
internal/datasourceshelpers for id/name selectors and validating API JSON fields;kernel_projectnow uses them and resolves name lookups with a singleGetProjectcall instead of paginated list scans, with a guard when a configured name collides with another project’s id.kernelclientgainsListProfilePageand generic pagination that honorsX-Has-Moreover staleX-Next-Offset;ListProjectPageis removed.projectscope.ResolveDataSourceerrors on unknownproject_idduring data source reads.Reviewed by Cursor Bugbot for commit 74bbda8. Bugbot is set up for automated code reviews on this repo. Configure here.