Skip to content

refactor(sdk,common): standardize common connection keys among transport protocols - #4304

Open
FergusMok wants to merge 7 commits into
apache:masterfrom
FergusMok:fergusmok/refactor/connection-string-key
Open

FergusMok wants to merge 7 commits into
apache:masterfrom
FergusMok:fergusmok/refactor/connection-string-key

Conversation

@FergusMok

Copy link
Copy Markdown

Which issue does this PR address?

Closes #4210

Rationale

Currently the different transport protocols (TCP QUIC and Websocket) use different keys to refer to the same thing.
Standardize the configuration connection keys between them.

Option Current TCP key Current QUIC key Current WebSocket key Post-Standardization key
Reconnection attempts reconnection_retries reconnection_max_retries reconnection_retries reconnection_max_retries
Reconnection cooldown reestablish_after reconnection_reestablish_after reestablish_after reestablish_after
Certificate validation none validate_certificate tls_validate_certificate tls_validate_certificate

What changed?

  1. Changed the connection keys among the different clients. Deprecated connection keys will still work, albeit with a warn log.
    The deprecated keys will be removed in a future release, as mentioned in the issue.
    Current behavior is that if both the new and deprecated keys are passed into connection, the latter will be used.

  2. Updated the relevant documentation and tests

Local Execution

  • Pre-commit hooks ran

AI Usage:

For the addition of docs and tests

@github-actions

Copy link
Copy Markdown

Thanks for the PR. It is labeled S-waiting-on-review and queued for review.

Slash commands (own line, regular comment) move it around the queue:

  • /ready - back to S-waiting-on-review after addressing feedback
  • /author - flip to S-waiting-on-author while you finish changes
  • /request-review @user-or-team - request a reviewer
  • /pin - exempt the PR from the stale bot, /unpin to undo

See CONTRIBUTING.md for details.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Sep 26, 2026
@FergusMok

Copy link
Copy Markdown
Author

/ready

@FergusMok FergusMok changed the title Standardize common connection keys among transport protocols. refactor: Standardize common connection keys among transport protocols. Sep 26, 2026
@justinmclean

Copy link
Copy Markdown
Member

Thanks @FergusMok, and for keeping the old keys working with a deprecation warning

@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.56863% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.79%. Comparing base (15a49d0) to head (499a183).
⚠️ Report is 13 commits behind head on master.

Files with missing lines Patch % Lines
...pes/configuration/auth_config/connection_string.rs 95.36% 0 Missing and 7 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4304      +/-   ##
============================================
- Coverage     87.56%   86.79%   -0.77%     
  Complexity     1575     1575              
============================================
  Files          1284     1283       -1     
  Lines        225457   219877    -5580     
  Branches     188821   183226    -5595     
============================================
- Hits         197413   190837    -6576     
- Misses        23309    24076     +767     
- Partials       4735     4964     +229     
Components Coverage Δ
Rust Core 87.85% <96.15%> (-0.91%) ⬇️
Java SDK 68.68% <ø> (ø)
C# SDK 77.41% <ø> (-0.02%) ⬇️
Python SDK 90.97% <ø> (ø)
PHP SDK 85.67% <ø> (ø)
Node SDK 94.77% <100.00%> (+0.03%) ⬆️
Go SDK 70.14% <ø> (+0.08%) ⬆️
Files with missing lines Coverage Δ
...tion/quic_config/quic_connection_string_options.rs 76.75% <100.00%> (+6.59%) ⬆️
...ypes/configuration/tcp_config/tcp_client_config.rs 100.00% <100.00%> (ø)
...ration/tcp_config/tcp_connection_string_options.rs 87.90% <100.00%> (+1.53%) ⬆️
...cket_config/websocket_connection_string_options.rs 74.80% <100.00%> (+9.96%) ⬆️
core/sdk/src/clients/client.rs 90.99% <ø> (ø)
core/sdk/src/tcp/tcp_client.rs 89.93% <100.00%> (-0.12%) ⬇️
...oreign/node/src/client/client.connection-string.ts 99.18% <100.00%> (+0.07%) ⬆️
...pes/configuration/auth_config/connection_string.rs 95.70% <95.36%> (-0.26%) ⬇️

... and 150 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hubcio hubcio changed the title refactor: Standardize common connection keys among transport protocols. refactor(sdk,common): standardize common connection keys among transport protocols Sep 28, 2026

@hubcio hubcio left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@hubcio hubcio left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

three inline notes below. two things that do not attach to a line: the description says the deprecated key wins when both are passed, but the parsers take the last occurrence, which should_use_last_connection_option_including_aliases asserts - please fix that sentence. optional drive-bys: core/connectors/runtime/src/stream.rs:207,214 and four connector tests still pass reconnection_retries, so each start now logs a deprecation warning, and the quic deprecated aliases arm at connection_string.rs:230 also carries reconnection_max_retries, which is quic's canonical key, not a deprecated one.

"Connection string option 'validate_certificate' is deprecated; use 'tls_validate_certificate'"
);
}
validate_certificate = option_parts[1] == "true";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: any value other than an exact true reads as false, so a typo like tls_validate_certificate=ture turns certificate verification off and lands on SkipServerVerification at quic_client.rs:1198. parse the value with parse::<bool>() and reject the rest, like tcp does at tcp_connection_string_options.rs:97.

also at websocket_connection_string_options.rs:191.

}
},
"validate_certificate" => {
"tls_validate_certificate" | "validate_certificate" => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: the key is tls_validate_certificate now, but the quic field and builder still say validate_certificate (quic_client_config.rs:54, quic_client_config_builder.rs:147), while tcp and websocket say tls_validate_certificate. renaming breaks the api, so either note it on #4210 or leave it for a follow-up.

let mut tls_enabled = false;
let mut tls_domain = "".to_string();
let mut tls_ca_file = None;
let mut tls_validate_certificate = true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

warning: this key defaults to true on tcp and false on quic and websocket (quic_connection_string_options.rs:100, websocket_connection_string_options.rs:215), so one key now means two security postures. the rustdoc covers both, but foreign/cpp/include/iggy.hpp:2067 states it for tcp only.

@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Sep 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author PR is waiting on author response

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use the same connection string key for the same option on every transport

4 participants