-
-
Notifications
You must be signed in to change notification settings - Fork 388
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.57% 67.55% -0.03%
==========================================
Files 238 238
Lines 22362 22372 +10
==========================================
+ Hits 15111 15113 +2
- Misses 6062 6068 +6
- Partials 1189 1191 +2
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
_, err := srv.SettingsSetValue(cmd.Context(), &rpc.SettingsSetValueRequest{ | ||
Key: "network.user_agent_ext", | ||
ValueFormat: "cli", | ||
EncodedValue: "daemon", | ||
}) |
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.
What should we do in case this value is not empty?
- Should we always override with the
daemon
value - should we append to the previous value
- should we honor the user setting?
/cc @cmaglie
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?
network.user_agent_ext
is set toodaemon
when the CLI runs in daemon mode. The complete user agent isarduino-cli/git-snapshot daemon (amd64; windows; go1.23.2) Commit:84fc413a
.Does this PR introduce a breaking change, and is titled accordingly?
Other information