-
-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add daemon
to the user agent when the CLI is started in daemon mode
#2789
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2789 +/- ##
==========================================
+ Coverage 67.69% 67.71% +0.01%
==========================================
Files 238 238
Lines 22388 22392 +4
==========================================
+ Hits 15156 15163 +7
+ Misses 6036 6034 -2
+ Partials 1196 1195 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments/
It would be cool if we're able to test it.
Maybe we could use a proxy HTTP, and inspect the call that arrives are with the expected User agent. Something similar to: https://github.com/arduino/arduino-cli/blob/master/internal/cli/configuration/network_test.go#L29-L51
1dc53f7
to
b78fdb5
Compare
60ad95e
to
fe84afb
Compare
This allows the extraction of the user-agent in a single place. Also it forces the context passing on all operations that requires access to network.
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)configuration.schema.json
updated if new parameters are added.What kind of change does this PR introduce?
Bug fix
What is the current behavior?
The user agent does not specify if the CLI runs in daemon mode. It is always something like
arduino-cli/git-snapshot (amd64; windows; go1.23.2) Commit:84fc413a
.What is the new behavior?
The user agent obtained from the context metadata is propagated to the
network.user_agent_ext
if it's empty and the CLI runs in daemon mode. The complete user agent isarduino-cli/git-snapshot arduino-ide/2.3.4 grpc-node-js/1.9.5 daemon (amd64; windows; go1.23.4) Commit:f3dc127e
.Does this PR introduce a breaking change, and is titled accordingly?
Other information