refactor(go,terraform): enhance SDK types for Terraform provider integration#213
Merged
refactor(go,terraform): enhance SDK types for Terraform provider integration#213
Conversation
- CVMInfo: add InProgress, Endpoints, PublicURLs, DiskSize, EncryptedEnvPubkey - SSHKey: add Fingerprint, KeyType, Source, UpdatedAt - UserInfo/CreditsInfo: use pointer types for nullable field handling - ProvisionCVMRequest: add SSHAuthorizedKeys, CustomAppID, Nonce, StorageFS - CommitCVMProvisionRequest: add EncryptedEnv, EnvKeys - ProvisionComposeUpdateRequest: add Name, visibility flags, UpdateEnvVars
c9c0b58 to
ba9ecb4
Compare
Update terraform submodule reference to refactor/use-go-sdk branch which includes CI workflow changes for Go SDK checkout.
Support for backend PR #1041 which made POST /cvms idempotent. Go SDK: - Add error_codes.go with all 30 error code constants (Module 01-06) - Extend APIError with Details, Suggestions, Links fields - Add IsConflict(), IsStructured(), HasErrorCode(), FormatError() - IsRetryable() now returns false for 409 with ErrorCode (deterministic) - Parse structured error fields from API responses in request.go JS SDK: - Add utils/error_codes.ts with ErrorCodes const and ErrorCode type - Add isConflictError() and isAppIdConflictError() helpers - Document idempotency behavior on commitCvmProvision Python SDK: - Add error_codes.py with all error code constants - Add ConflictError for transient 409 (no error_code) - Dispatch 409+error_code to ResourceError, plain 409 to ConflictError - Document idempotency behavior on commit_cvm_provision Terraform: - Use Go SDK structured errors for diagnostic messages - Add diagnosticFromAPIError() helper
Add PublicLogs, PublicSysinfo, PublicTcbinfo, SecureTime, StorageFS fields to ComposeFile so provision requests include all compose settings.
Contributor
📋 Check Results✨ JS SDK - Code FormattingShow format check results🔍 JS SDK - TypeScript Type CheckShow type check output🧪 JS SDK - Test ResultsShow test output📝 JS SDK - Lint CheckShow lint results🌐 JS SDK - Browser CompatibilityShow browser test results🌐 Browser Compatibility ReportBrowser compatibility tests completed across:
The SDK has been verified to work in modern browser environments. Check run: https://github.com/Phala-Network/phala-cloud/actions/runs/23271168272 |
pacoyang
approved these changes
Mar 22, 2026
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
Enhance Go SDK types to support Terraform provider's needs (nullable fields, missing API response fields). This is a prerequisite for terraform-provider-phala#4 which replaces the provider's custom HTTP client with the Go SDK.
Go SDK type changes
CVMInfo: addInProgress,Endpoints,PublicURLs,DiskSize,EncryptedEnvPubkeySSHKey: addFingerprint,KeyType,Source,UpdatedAtUserInfo/CreditsInfo: use pointer types for nullable field handlingProvisionCVMRequest: addSSHAuthorizedKeys,CustomAppID,Nonce,StorageFSCommitCVMProvisionRequest: addEncryptedEnv,EnvKeysProvisionComposeUpdateRequest: addName, visibility flags,UpdateEnvVarsTest plan
cd sdks/go && go build ./... && go test ./...