Skip to content

Conversation

@Cole-Greer
Copy link
Contributor

@Cole-Greer Cole-Greer commented Nov 29, 2022

Progress towards TINKERPOP-2480

Adds a user agent to gremlin-go which is sent as a request header during the web socket handshake.

User agent follows the form of [Application Name] [GLV Name].[Version] [Language Runtime Version] [OS].[Version] [CPU Architecture]

This behavior is enabled by default but can be disabled by setting the EnableUserAgentOnConnect setting to false.

Note: There are no tests included as part of this PR. My intention is to add integration tests to ensure that the user agent is being sent correctly once TINKERPOP-2819 has been merged. The existing go glv tests are sufficient to show that this change does not introduce any faults into the driver. I have conducted manual tests to ensure that the changes are currently functioning correctly. My thoughts are that with a potential release approaching, it is worthwhile to have the user agent introduced now, with full validation coming soon.

@Cole-Greer Cole-Greer changed the title TINKERPOP-2480 Add User-Agent to Dotnet Driver TINKERPOP-2480 Add User-Agent to Go Driver Nov 29, 2022
@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2022

Codecov Report

Merging #1877 (aa29359) into 3.5-dev (adb3c80) will increase coverage by 0.00%.
The diff coverage is 92.75%.

@@            Coverage Diff             @@
##             3.5-dev    #1877   +/-   ##
==========================================
  Coverage      69.41%   69.41%           
  Complexity      8920     8920           
==========================================
  Files            861      862    +1     
  Lines          40868    40896   +28     
  Branches        5388     5388           
==========================================
+ Hits           28368    28390   +22     
- Misses         10590    10598    +8     
+ Partials        1910     1908    -2     
Impacted Files Coverage Δ
gremlin-go/driver/connection.go 77.77% <ø> (ø)
gremlin-go/driver/user_agent.go 75.00% <75.00%> (ø)
gremlin-go/driver/client.go 79.56% <100.00%> (+0.44%) ⬆️
gremlin-go/driver/driverRemoteConnection.go 86.33% <100.00%> (+0.19%) ⬆️
gremlin-go/driver/gorillaTransporter.go 68.18% <100.00%> (+1.20%) ⬆️
...sal/strategy/optimization/GraphFilterStrategy.java 64.06% <0.00%> (-4.69%) ⬇️
.../traversal/step/map/PageRankVertexProgramStep.java 72.09% <0.00%> (-4.66%) ⬇️
...in/process/traversal/dsl/graph/GraphTraversal.java 90.09% <0.00%> (-0.55%) ⬇️
...nkerpop/gremlin/groovy/engine/GremlinExecutor.java 87.71% <0.00%> (+0.42%) ⬆️
... and 4 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@vkagamlyk
Copy link
Contributor

LGTM
VOTE +1

User agent follows the form of [Application Name] [GLV Name].[Version] [Language Runtime Version] [OS].[Version] [CPU Architecture]

New feature in the go driver to send a user agent header during the web socket handshake for new connections.
This behavior is enabled by default but can be disabled by setting connectionSettings.enableUserAgent to false.

Note: Due to limitations with the language, the OS version cannot be detected in Go. Therefore the OS version will be reported as "NotAvailable".
@vkagamlyk vkagamlyk merged commit 0abbc65 into apache:3.5-dev Dec 5, 2022
@Cole-Greer Cole-Greer deleted the cole/user-agent-go branch January 6, 2023 20:16
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