Skip to content

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

Merged
MarioAlexandruDan merged 36 commits into
mainfrom
feat/go-transformation-options
May 19, 2026
Merged

feat(go): add TransformationOptions for ingestion transporter configuration#6293
MarioAlexandruDan merged 36 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 2d023d6cffe83040df024eb48c288b8ab9aa0c05
🍃 Generated commit bec020c709cccb8aa909aecd6528de466d4afae0
🌲 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 2547
javascript 2293
csharp 2116
php 1848
python 1439
java 1164
ruby 999
swift 456
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
@MarioAlexandruDan MarioAlexandruDan enabled auto-merge (squash) May 19, 2026 11:56
@MarioAlexandruDan MarioAlexandruDan merged commit d996f98 into main May 19, 2026
36 checks passed
@MarioAlexandruDan MarioAlexandruDan deleted the feat/go-transformation-options branch May 19, 2026 12:00
algolia-bot added a commit that referenced this pull request May 19, 2026
…ration (#6293) (generated) [skip ci]

Co-authored-by: Mario-Alexandru Dan <marioalexandrudan@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
algolia-bot added a commit to algolia/algoliasearch-client-go that referenced this pull request May 19, 2026
…ration (generated)

algolia/api-clients-automation#6293

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Mario-Alexandru Dan <marioalexandrudan@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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