Skip to content

Generated endpoint markers and devdock examples#45

Draft
kvz wants to merge 20 commits into
mainfrom
sdk-gen-go
Draft

Generated endpoint markers and devdock examples#45
kvz wants to merge 20 commits into
mainfrom
sdk-gen-go

Conversation

@kvz
Copy link
Copy Markdown
Member

@kvz kvz commented May 25, 2026

Experimental Status

Experimental work: this PR is part of the API2 contract/generated SDK effort and is intentionally kept as a Draft while the generated surface is validated.

Why

API2 is becoming the source of truth for endpoint contracts and SDK generation. This Go SDK companion proves two things cautiously: API2 can delete/rewrite generated Go regions without behavior drift, and checked-in Go examples can exercise that generated surface against devdock as normal consumer code.

What changed

  • Added API2 generated-region markers around existing Go SDK endpoint methods: Assembly status/cancel/list, Assembly notification replay, Template create/get/update/delete/list, and Template Credential create/get/update/delete/list.
  • Added generated high-level feature methods including Client.CreateTusAssembly() and Client.WaitForAssembly() coverage through API2's generator.
  • Added generated model conformance guard coverage for AssemblyInfo / FileInfo fields that the contract says SDK examples need.
  • Added a checked-in, hand-written devdock TUS Assembly example at examples/api2-devdock-tus-assembly/main.go.
  • The generated regions are owned by API2 contracts; fixes should land in API2 and be regenerated here.
  • The examples are deliberately not generated: they are idiomatic consumer proofs. API2 injects scenario JSON and validates the results.
  • The TUS Assembly example now reads generic scenario.preparations[] feature-call input for createTusAssembly instead of the temporary scenario.createTusAssembly compatibility field.

Verification

  • From API2: api2/bin/cli.ts contracts sdks --no-motd --target transloadit --platform go --sdk-root ../go-sdk --rewrite-sdk --compare-existing
  • From API2: core/bin/devdock.ts exec tstrun system/sdk_examples/go-transloadit-examples.test.ts -vv --max-time-per-test 420
  • Go SDK: go test ./examples/api2-devdock-tus-assembly ./examples/api2-devdock-template-lifecycle
  • Go SDK: go test ./... -run 'Test(NewClient|FormFieldValue|AssemblyInfo_TusFields)'

Notes

Full go test ./... still expects live TRANSLOADIT_KEY/TRANSLOADIT_SECRET for integration-style tests. I left those untouched and ran the credential-free subset plus API2's devdock system example lane.

Companion PRs

Transloadit

TUS

Allowed outward links from Transloadit to the related tus companion PRs:

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 25, 2026

Codecov Report

❌ Patch coverage is 13.82979% with 81 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.88%. Comparing base (1878939) to head (3311a27).

Files with missing lines Patch % Lines
assembly.go 0.00% 74 Missing ⚠️
transloadit.go 65.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #45       +/-   ##
===========================================
- Coverage   82.60%   67.88%   -14.73%     
===========================================
  Files           6        6               
  Lines         345      439       +94     
===========================================
+ Hits          285      298       +13     
- Misses         32      112       +80     
- Partials       28       29        +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kvz kvz changed the title Mark generated endpoint methods Generated endpoint markers and devdock examples Jun 2, 2026
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.

2 participants