Flatten extension upload responses - #59
Open
IlyaasK wants to merge 1 commit into
Open
Conversation
IlyaasK
requested review from
Sayan- and
tnsardesai
and removed request for
Sayan- and
tnsardesai
July 11, 2026 04:32
IlyaasK
force-pushed
the
hypeship/extension-upload-params
branch
from
July 13, 2026 13:34
d0b421f to
b4dddeb
Compare
IlyaasK
force-pushed
the
hypeship/extension-upload-flatten
branch
from
July 13, 2026 13:34
ed9e9a2 to
36b5430
Compare
IlyaasK
force-pushed
the
hypeship/extension-upload-params
branch
from
July 13, 2026 14:32
b4dddeb to
4a377ef
Compare
IlyaasK
force-pushed
the
hypeship/extension-upload-flatten
branch
from
July 13, 2026 14:32
36b5430 to
3f100f2
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.
Reviewed by Cursor Bugbot for commit 3f100f2. Configure here.
IlyaasK
force-pushed
the
hypeship/extension-upload-flatten
branch
from
July 13, 2026 15:39
3f100f2 to
a413a50
Compare
IlyaasK
force-pushed
the
hypeship/extension-upload-params
branch
from
July 20, 2026 19:38
33ccaff to
ae57a67
Compare
IlyaasK
force-pushed
the
hypeship/extension-upload-flatten
branch
from
July 20, 2026 19:38
a413a50 to
5d952a2
Compare
IlyaasK
force-pushed
the
hypeship/extension-upload-params
branch
from
July 21, 2026 14:46
ae57a67 to
5bc835d
Compare
IlyaasK
force-pushed
the
hypeship/extension-upload-flatten
branch
from
July 21, 2026 14:46
5d952a2 to
5508e2a
Compare
IlyaasK
force-pushed
the
hypeship/extension-upload-params
branch
from
July 21, 2026 18:10
5bc835d to
b563e14
Compare
IlyaasK
force-pushed
the
hypeship/extension-upload-flatten
branch
2 times, most recently
from
July 21, 2026 19:51
52798b4 to
efabe6a
Compare
IlyaasK
force-pushed
the
hypeship/extension-upload-flatten
branch
from
July 21, 2026 20:15
efabe6a to
bed4bab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Why this is v1 work
This is the pure success-response boundary needed before wiring
kernel_extensionCreate. Separating flattening keeps malformed-success and drift semantics independently reviewable from API calls and Terraform state persistence.Intentionally unsupported
Verification
gofmt -l cmd internalgo test -count=20 ./internal/resources/extensiongo test -race -count=1 ./internal/resources/extensiongo test -count=1 -short -timeout=2m ./...go vet ./...go mod verifygo mod tidy -diffterraform fmt -check -recursive examplesbash scripts/check-docs.shbash scripts/check-examples.shbash scripts/check-markdown-links.shgit diff --check HEADAll commands passed locally. Tests are pure, deterministic, and network-free.
Acceptance status
No API call or Terraform lifecycle behavior is introduced, so live acceptance testing is not applicable to this pure flatten slice.
Remaining risk
A malformed nominal success means Kernel may already have created the extension. This helper deliberately returns no invented state; the later Create core must preserve any trustworthy canonical ID and report an uncertain commit with lookup/import/delete guidance.
Note
Low Risk
Pure mapping and validation with no Terraform lifecycle or network calls; behavior is covered by unit tests.
Overview
Adds
flattenExtensionUploadas the success-response boundary for upcomingkernel_extensionCreate: it turns a Kernel upload response into durable Terraform state and diagnostics only—no API or lifecycle wiring yet.Validation follows the same Stainless raw-field pattern used elsewhere (e.g. browser pool): required id and checksum, optional name when present in JSON. It errors on missing/invalid fields and on name or checksum drift versus configured values. project_id is taken from the caller when scoped (not from API metadata); source_path is explicitly nulled as write-only; timestamps, size, and runtime fields are ignored.
Unit tests cover happy paths (nullable name, unscoped project), invalid required fields, and drift rejection.
Reviewed by Cursor Bugbot for commit bed4bab. Bugbot is set up for automated code reviews on this repo. Configure here.