Skip to content

Commit

Permalink
fixed missing server address in summary
Browse files Browse the repository at this point in the history
  • Loading branch information
klobuczek committed Jan 14, 2025
1 parent 750c5e5 commit 7bbeebc
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 18 deletions.
5 changes: 4 additions & 1 deletion History.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
=== 5.0.7.alpha.2 / 2025-01-13
=== 5.7.0.alpha.4 / 2025-01-14
=== 5.27.0.alpha.0 / 2025-01-13
=== 5.7.0.alpha.3 / 2025-01-13
=== 5.7.0.alpha.2 / 2025-01-13
=== 4.4.19 / 2024-12-16
=== 4.4.6 / 2024-12-16
=== 4.4.16 / 2023-05-03
Expand Down
1 change: 1 addition & 0 deletions ruby/neo4j/driver/internal/async/pool/channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Channel

def initialize(address, connector, logger)
@attributes = Connection::ChannelAttributes.new
@attributes[:server_address] = address
@stream = Connection::Stream.new(connect_to_io_socket(connector, address))
@stream.write(Connection::BoltProtocolUtil.handshake_buf)
@stream.flush
Expand Down
12 changes: 6 additions & 6 deletions ruby/neo4j/driver/internal/internal_relationship.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
module Neo4j::Driver
module Internal
class InternalRelationship < InternalEntity
attr_accessor :start_node_id, :end_node_id, :start_element_id, :end_element_id
attr_accessor :start_node_id, :end_node_id, :start_node_element_id, :end_node_element_id
attr_reader :type

def initialize(id, element_id, start_node_id, start_element_id, end_node_id, end_element_id, type, **properties)
def initialize(id, element_id, start_node_id, start_node_element_id, end_node_id, end_node_element_id, type, **properties)
super(id, element_id, **properties)
set_start_and_end_node_ids(start_node_id, start_element_id, end_node_id, end_element_id)
set_start_and_end_node_ids(start_node_id, start_node_element_id, end_node_id, end_node_element_id)
@type = type.to_sym
end

def set_start_and_end_node_ids(start_node_id, start_element_id, end_node_id, end_element_id)
def set_start_and_end_node_ids(start_node_id, start_node_element_id, end_node_id, end_node_element_id)
@start_node_id = start_node_id
@start_element_id = start_element_id || start_node_id.to_s
@start_node_element_id = start_node_element_id || start_node_id.to_s
@end_node_id = end_node_id
@end_element_id = end_element_id || end_node_id.to_s
@end_node_element_id = end_node_element_id || end_node_id.to_s
end

def to_s
Expand Down
2 changes: 1 addition & 1 deletion ruby/neo4j/driver/internal/util/metadata_extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def extract_result_available_after(metadata)
end

def extract_summary(query, connection, result_available_after, metadata)
server_info = Summary::InternalServerInfo.new(connection.server_agent, connection.server_address, connection.server_version, connection.protocol.version)
server_info = Summary::InternalServerInfo.new(connection.server_agent, connection.server_address.to_s, connection.server_version, connection.protocol.version)
db_info = self.class.extract_database_info(metadata)
Summary::InternalResultSummary.new(
query, server_info, db_info, self.class.extract_query_type(metadata), self.class.extract_counters(metadata),
Expand Down
2 changes: 1 addition & 1 deletion ruby/neo4j/driver/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Neo4j
module Driver
VERSION = '5.7.0.alpha.2'
VERSION = '5.7.0.alpha.4'
end
end
1 change: 1 addition & 0 deletions spec/integration/summary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
expect(summary).not_to have_plan
expect(summary).not_to have_profile
expect(summary).to eq result.consume
expect(summary.server.address).to eq address # address frpm DriverHelper
end
end

Expand Down
16 changes: 7 additions & 9 deletions spec/support/driver_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ module DriverHelper
module Helper
mattr_accessor :single_driver

def uri
"#{scheme}://#{ENV.fetch('TEST_NEO4J_HOST', '127.0.0.1')}:#{ENV.fetch('TEST_NEO4J_PORT', 7687)}"
end
def uri = "#{scheme}://#{address}"

def scheme
ENV.fetch('TEST_NEO4J_SCHEME', 'bolt')
end
def address = "#{host}:#{port}"

def port
uri.split(':').last
end
def host = ENV.fetch('TEST_NEO4J_HOST', '127.0.0.1')

def scheme = ENV.fetch('TEST_NEO4J_SCHEME', 'neo4j')

def port = ENV.fetch('TEST_NEO4J_PORT', 7687)

def basic_auth_token
Neo4j::Driver::AuthTokens.basic(neo4j_user, neo4j_password)
Expand Down

0 comments on commit 7bbeebc

Please sign in to comment.