Skip to content

THRIFT-6109: Format Ruby HTTP transport endpoint labels#3649

Merged
kpumuk merged 1 commit into
apache:masterfrom
kpumuk:rb-http-transport-label
Jul 20, 2026
Merged

THRIFT-6109: Format Ruby HTTP transport endpoint labels#3649
kpumuk merged 1 commit into
apache:masterfrom
kpumuk:rb-http-transport-label

Conversation

@kpumuk

@kpumuk kpumuk commented Jul 20, 2026

Copy link
Copy Markdown
Member

Replace the malformed diagnostic label returned by Thrift::HTTPClientTransport#to_s with an endpoint description that includes the scheme, host, port, and path.

The label distinguishes HTTP from HTTPS while leaving URL userinfo and query parameters out of logs and exception output.

  • Did you create an Apache Jira ticket? THRIFT-6109
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

Copilot AI review requested due to automatic review settings July 20, 2026 22:20
@mergeable mergeable Bot added the ruby Pull requests that update Ruby code label Jul 20, 2026

Copilot AI 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.

Pull request overview

This PR updates the Ruby Thrift::HTTPClientTransport endpoint label (#to_s) to produce a structured, sanitized identifier based on scheme/host/port/path, and extends specs to ensure userinfo/query secrets don’t appear in the label.

Changes:

  • Change Thrift::HTTPClientTransport#to_s to format as scheme(host:port/path) instead of returning the raw URL.
  • Add spec coverage asserting #to_s omits URL userinfo and query parameters.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
lib/rb/spec/http_client_spec.rb Updates/extends specs for HTTPClientTransport#to_s formatting and redaction.
lib/rb/lib/thrift/transport/http_client_transport.rb Updates #to_s to emit a sanitized endpoint label (scheme/host/port/path).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/rb/lib/thrift/transport/http_client_transport.rb
@kpumuk
kpumuk force-pushed the rb-http-transport-label branch from 9d77408 to 4a7c492 Compare July 20, 2026 22:28
Copilot AI review requested due to automatic review settings July 20, 2026 22:28

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread lib/rb/lib/thrift/transport/http_client_transport.rb
@kpumuk
kpumuk force-pushed the rb-http-transport-label branch from 4a7c492 to b0da77d Compare July 20, 2026 22:43
Copilot AI review requested due to automatic review settings July 20, 2026 22:43

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread lib/rb/lib/thrift/transport/http_client_transport.rb
…t label

Client: rb

Co-Authored-By: OpenAI Codex (GPT-5.6) <codex@openai.com>
Copilot AI review requested due to automatic review settings July 20, 2026 22:53
@kpumuk
kpumuk force-pushed the rb-http-transport-label branch from b0da77d to 000abd5 Compare July 20, 2026 22:53

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

lib/rb/lib/thrift/transport/http_client_transport.rb:67

  • to_s currently interpolates @url.host directly. For IPv6 literals, Ruby's URI typically returns the host without brackets (e.g. 2001:db8::1), which makes the host:port portion ambiguous and will not match the new spec expectation https([2001:db8::1]:8443/...). Wrap IPv6 hosts in [] when formatting the endpoint label.
      path = @url.path.to_s
      path = '/' if path.empty?
      "#{@url.scheme}(#{@url.host}:#{@url.port}#{path})"

@kpumuk
kpumuk merged commit 03804e8 into apache:master Jul 20, 2026
94 of 95 checks passed
@kpumuk
kpumuk deleted the rb-http-transport-label branch July 20, 2026 23:35
@Jens-G

Jens-G commented Jul 21, 2026

Copy link
Copy Markdown
Member

Code review

No issues found. Checked for bugs, AGENTS.md compliance, and security implications.

🤖 Generated with Claude Code

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

Labels

ruby Pull requests that update Ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants