Skip to content

feat(dart): add TransformationOptions for ingestion transporter configuration#6321

Open
MarioAlexandruDan wants to merge 40 commits into
mainfrom
feat/dart-transformation-options
Open

feat(dart): add TransformationOptions for ingestion transporter configuration#6321
MarioAlexandruDan wants to merge 40 commits into
mainfrom
feat/dart-transformation-options

Conversation

@MarioAlexandruDan
Copy link
Copy Markdown
Contributor

@MarioAlexandruDan MarioAlexandruDan commented Apr 30, 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-379:

Changes included:

  • TransformationOptions.ingestionClientOptions: ClientOptions?: Reuses Dart's existing general-purpose ClientOptions instead of duplicating 8 fields like other languages had to.
  • ClientOptions.transformationOptions: Stored on config so the client constructs in one shot, consistent with how all other Dart client options work.
  • Spec timeouts via RequestOptions in every execute() call: Constructor defaults get silently overridden by callers passing their own ClientOptions, request-level always wins.
  • import 'dart:io' as io: The ingestion spec generates a Platform model that shadows dart:io.Platform at import time.
  • lib/src/extension.dart placeholder in client_ingestion: lib.mustache unconditionally exports this file in every package barrel, missing it breaks the build.
  • DartCTSManager snake_case → camelCase: Ingestion spec uses snake_case; CTS generator passed raw names producing uncompilable Dart constructor calls.
  • param_object.mustache aggregates additionalProperties: Old template generated one entry per extra field; Dart forbids duplicate named args in a single call.
  • runCts.ts dart in both mock validators: replaceAllObjectsWithTransformation calls chunkedPush internally, hitting the pushMock server indirectly.

🧪 Test

- Add TransformationOptions to client_core
- Add transformationOptions field to ClientOptions
- Generate algolia_client_ingestion Dart package
- Add ingestion transporter wiring to SearchClient template
- Implement chunkedPush, saveObjectsWithTransformation,
  partialUpdateObjectsWithTransformation, and
  replaceAllObjectsWithTransformation extensions
- Update pubspec_overrides across docs/tests/playground
@MarioAlexandruDan MarioAlexandruDan self-assigned this Apr 30, 2026
@algolia-bot
Copy link
Copy Markdown
Collaborator

algolia-bot commented Apr 30, 2026

✔️ Code generated!

Name Link
🪓 Triggered by c8cbddcb39a7d4fb605d9faf6bedfeaeb8a24a3f
🍃 Generated commit a745eefa5ec9db706ce6559df0cafa8ac73bab76
🌲 Generated branch generated/feat/dart-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
javascript 3058
php 3016
go 2125
csharp 1558
python 1286
java 1108
ruby 928
swift 690
scala 23

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Apr 30, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

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

@MarioAlexandruDan MarioAlexandruDan force-pushed the feat/dart-transformation-options branch from b15c29b to 44910b3 Compare May 12, 2026 13:04
@MarioAlexandruDan MarioAlexandruDan force-pushed the feat/dart-transformation-options branch from a7ec108 to ee6ec15 Compare May 12, 2026 13:51
@MarioAlexandruDan MarioAlexandruDan force-pushed the feat/dart-transformation-options branch from d1bdb33 to 026e618 Compare May 12, 2026 14:15
@MarioAlexandruDan MarioAlexandruDan marked this pull request as ready for review May 13, 2026 13:07
@MarioAlexandruDan MarioAlexandruDan requested a review from a team as a code owner May 13, 2026 13:07
@MarioAlexandruDan MarioAlexandruDan requested a review from Fluf22 May 13, 2026 13:07
Copy link
Copy Markdown
Collaborator

@Fluf22 Fluf22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the changes you made around server timeouts, I might be missing something

Comment thread templates/dart/api.mustache Outdated
Comment thread templates/dart/api.mustache Outdated
…own defaults, remove unexplained server-timeout fallback
@MarioAlexandruDan MarioAlexandruDan marked this pull request as draft May 18, 2026 07:55
…ut per-endpoint x-timeouts

Also fix Docker build: strip +10 build suffix from java-version since SDKman only accepts 21.0.11-zulu
@MarioAlexandruDan
Copy link
Copy Markdown
Contributor Author

The default is 100 now, and we want to pass maxRetries from the calling method I believe (check Dart jira ticket for maxRetries update)

Related PR: configurable retries on chunked helpers via ChunkedHelperOptions:
#6405

@MarioAlexandruDan MarioAlexandruDan marked this pull request as ready for review May 18, 2026 13:59
Comment thread templates/dart/api.mustache Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👻

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…ry delay

Make ClientOptions timeout fields nullable so each generated client can apply
its own spec defaults via _withDefaults rather than injecting RequestOptions
on every method call. Add RetryStrategy fallbacks for callers that bypass the
generated constructor. Fix _waitForEvent to start at 1500 ms instead of 0 ms.
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