-
-
Notifications
You must be signed in to change notification settings - Fork 389
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?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,17 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer, settings *rpc.Configuration) * | |
if maxGRPCRecvMsgSize < 1024 { | ||
feedback.Fatal(i18n.Tr("%s must be >= 1024", "--max-grpc-recv-message-size"), feedback.ErrBadArgument) | ||
} | ||
|
||
// The user agent should include "daemon" for analytics purposes | ||
_, err := srv.SettingsSetValue(cmd.Context(), &rpc.SettingsSetValueRequest{ | ||
Key: "network.user_agent_ext", | ||
ValueFormat: "cli", | ||
EncodedValue: "daemon", | ||
}) | ||
Comment on lines
+71
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What should we do in case this value is not empty?
/cc @cmaglie There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should go with the third option and honor the user setting. If it's okay with you, I'm going to make this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MatteoPologruto I agree. Let's ping also @cmaglie and @Xayton as I don't know if they might have better insight There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed with option 3. |
||
if err != nil { | ||
// Should never happen... | ||
panic("Failed to set default value for network.user_agent_ext: " + err.Error()) | ||
MatteoPologruto marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
}, | ||
Run: func(cmd *cobra.Command, args []string) { | ||
runDaemonCommand(srv, daemonPort, debugFile, debug, daemonize, debugFiltersArg, maxGRPCRecvMsgSize) | ||
|
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.
Actually no, it should infer the user agent from the gRPC client:
arduino-cli/commands/instances.go
Lines 67 to 70 in 6d9c930
I think the Arduino IDE is passing something like
arduino-ide/x.y.z
into this string.We should understand why this string is not propagated.