Skip to content

feat(go): add TransformationOptions for ingestion transporter configuration#6293

Open
MarioAlexandruDan wants to merge 33 commits into
mainfrom
feat/go-transformation-options
Open

feat(go): add TransformationOptions for ingestion transporter configuration#6293
MarioAlexandruDan wants to merge 33 commits into
mainfrom
feat/go-transformation-options

Conversation

@MarioAlexandruDan
Copy link
Copy Markdown
Contributor

@MarioAlexandruDan MarioAlexandruDan commented Apr 24, 2026

🧭 What and Why

Part of the effort to standardize transformationOptions across all 11 language SDKs. Depends on the JS + Foundation ticket for CTS infrastructure.

🎟 JIRA Ticket API-374:

Changes included:

  • TransformationOptions fields are flat: Go has no general-purpose ClientOptions primitive, so duplicating 6 fields directly avoids a single-use wrapper.
  • ClientOption func(SearchConfiguration) functional option: Go's idiomatic way to pass optional construction-time config; WithTransformationOptions(opts) fits naturally alongside other future With options.
  • SetTransformationOptions also exposed as a method: Lets callers configure after construction without rebuilding the client, consistent with SetClientApiKey.
  • DefaultHeader direct assignment, not merge: In Go, auth headers are injected per-request from cfg.AppID/cfg.ApiKey, not stored in DefaultHeader, so replacing it doesn't wipe credentials.
  • transformation_options.mustache registered only for search client: Only the search client needs the transporter helpers; conditional registration avoids generating a useless file for every other client.

🧪 Test

@algolia-bot
Copy link
Copy Markdown
Collaborator

algolia-bot commented Apr 24, 2026

✔️ Code generated!

Name Link
🪓 Triggered by 77cd42381d9650fba5ded6b77442564d1643410d
🍃 Generated commit 96ccc364fe00dc35c51e0e2402c3382daaef6b1c
🌲 Generated branch generated/feat/go-transformation-options
📊 Benchmark results

Benchmarks performed on the method using a mock server, the results might not reflect the real-world performance.

Language Req/s
go 2331
javascript 2290
php 2036
csharp 1516
python 1233
java 1105
ruby 905
swift 512
scala 23

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 24, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

TIP This summary will be updated as you push new changes.

@MarioAlexandruDan MarioAlexandruDan self-assigned this Apr 24, 2026
MarioAlexandruDan and others added 4 commits April 24, 2026 16:56
- Update generated configuration.go: replace TransformationConfiguration
  with TransformationOptions, deprecate config-level SetTransformationRegion
- Update generated client.go: add opts ...ClientOption to NewClient,
  fix NewClientWithConfig to use SetTransformationOptions (no host leak),
  add SetTransformationOptions and deprecated SetTransformationRegion on client
- Update generated search_test.go: three *WithTransformation CTS tests now
  use SetTransformationOptions with explicit ingestion hosts
- Move hand-written tests from tests/client/ to tests/manual/ (correct
  package picked up by runCts.ts manual runner), add more test coverage
- Fix generation.config.mjs: drop stale client-specific exclusion

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MarioAlexandruDan MarioAlexandruDan force-pushed the feat/go-transformation-options branch from a16159f to 8218d07 Compare April 27, 2026 12:16
@MarioAlexandruDan MarioAlexandruDan force-pushed the feat/go-transformation-options branch from 8218d07 to 3922821 Compare April 27, 2026 12:20
@MarioAlexandruDan MarioAlexandruDan force-pushed the feat/go-transformation-options branch from 3922821 to a00567b Compare April 27, 2026 12:31
@MarioAlexandruDan MarioAlexandruDan marked this pull request as ready for review April 29, 2026 13:03
@MarioAlexandruDan MarioAlexandruDan requested a review from a team as a code owner April 29, 2026 13:03
Comment thread templates/go/configuration.mustache Outdated
Comment thread tests/output/go/tests/manual/transformation_options_test.go
@MarioAlexandruDan MarioAlexandruDan marked this pull request as draft May 11, 2026 12:52
@MarioAlexandruDan MarioAlexandruDan marked this pull request as ready for review May 11, 2026 14:01
Comment thread templates/go/client.mustache
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.

3 participants