mohitduhan19 opened a new pull request, #4504:
URL: https://github.com/apache/iggy/pull/4504

   ## Which issue does this PR address?
   
   Closes #4492
   
   ## Rationale
   
   Java users had to set host, port and credentials by hand, while the Rust, 
Node and C# SDKs accept an `iggy://` connection string.
   
   ## What changed?
   
   `TcpClientBuilder` had no way to build a client from a connection string. It 
now has `fromConnectionString(String)`, which parses `iggy://` and 
`iggy+tcp://` strings with `user:password@host:port` (or `[ipv6]:port`) and the 
`tls=true|false` option, following `parseConnectionString` in the Node SDK, and 
delegates to `blocking().host().port().credentials().tls()`.
   
   Other transports, personal access tokens and any option other than `tls` are 
rejected with an `IggyInvalidArgumentException`, as proposed on the issue, so a 
string that configures more in the Rust SDK never silently behaves differently 
in Java. The parsing lives in a package-private `TcpConnectionString` record so 
it can be unit tested without a server. Error messages and its `toString()` 
never include the password.
   
   ## Local Execution
   
   - Passed: `./gradlew check -x test` in `foreign/java` (Spotless and 
Checkstyle), `TcpConnectionStringTest` (36 tests) and 
`IggyTcpClientBuilderTest` against the `apache/iggy:edge` container, including 
the new `shouldCreateClientFromConnectionString`.
   - Pre-commit hooks ran: `prek run` on the changed files passed (license 
headers, typos, whitespace and the rest). The `java-gradle-check` hook was 
covered by the `./gradlew check -x test` run above.
   
   ## AI Usage
   
   1. Claude (Anthropic).
   2. It wrote the implementation and the tests from the issue description and 
the Node SDK parser.
   3. The build, Checkstyle, Spotless, the unit tests and the integration test 
were run locally on my machine, as listed above. Checkstyle flagged the first 
version of `parse` for complexity, and it was split into smaller methods. 
`./gradlew check -x test` and the parser unit tests were run again after that 
change.
   4. I'll answer review questions on this PR myself.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to