[tools] gopls/internal/lsp: simplify the telemetry prompt

59 views
Skip to first unread message

Robert Findley (Gerrit)

unread,
Oct 2, 2023, 1:41:27 PM10/2/23
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Hyang-Ah Hana Kim, Go LUCI, golang-co...@googlegroups.com

Robert Findley submitted this change.

View Change

Approvals: Hyang-Ah Hana Kim: Looks good to me, approved Go LUCI: TryBots succeeded
gopls/internal/lsp: simplify the telemetry prompt

Per discussion, update the telemetry prompt to reduce redundancy, and
omit the upload date (which is not necessary for the opt-in model).

Change-Id: I7e4db24076996f40a39e9653633e3e821a688f3b
Reviewed-on: https://go-review.googlesource.com/c/tools/+/532095
Reviewed-by: Hyang-Ah Hana Kim <hya...@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang...@luci-project-accounts.iam.gserviceaccount.com>
---
M gopls/internal/lsp/prompt.go
1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/gopls/internal/lsp/prompt.go b/gopls/internal/lsp/prompt.go
index 1e63337..976f7c6 100644
--- a/gopls/internal/lsp/prompt.go
+++ b/gopls/internal/lsp/prompt.go
@@ -198,8 +198,8 @@
if s.Options().LinkifyShowMessage {
prompt = `Go telemetry helps us improve Go by periodically sending anonymous metrics and crash reports to the Go team. Learn more at [telemetry.go.dev/privacy](https://telemetry.go.dev/privacy).

- Would you like to enable Go telemetry?
- `
+Would you like to enable Go telemetry?
+`
}
// TODO(rfindley): investigate a "tell me more" action in combination with ShowDocument.
params := &protocol.ShowMessageRequestParams{
@@ -258,24 +258,15 @@
}

func telemetryOnMessage(linkify bool) string {
- reportDate := time.Now().AddDate(0, 0, 7).Format("2006-01-02")
- format := `Telemetry uploading is now enabled and may be sent to https://telemetry.go.dev starting %s. Uploaded data is used to help improve the Go toolchain and related tools, and it will be published as part of a public dataset.
-
-For more details, see https://telemetry.go.dev/privacy.
-This data is collected in accordance with the Google Privacy Policy (https://policies.google.com/privacy).
+ format := `Thank you. Telemetry uploading is now enabled.

To disable telemetry uploading, run %s.
`
+ var runCmd = "`go run golang.org/x/telemetry/cmd/gotelemetry@latest off`"
if linkify {
- format = `Telemetry uploading is now enabled and may be sent to [telemetry.go.dev](https://telemetry.go.dev) starting %s. Uploaded data is used to help improve the Go toolchain and related tools, and it will be published as part of a public dataset.
-
-For more details, see [telemetry.go.dev/privacy](https://telemetry.go.dev/privacy).
-This data is collected in accordance with the [Google Privacy Policy](https://policies.google.com/privacy).
-
-To disable telemetry uploading, run [%s](https://golang.org/x/telemetry/cmd/gotelemetry).
-`
+ runCmd = "[gotelemetry off](https://golang.org/x/telemetry/cmd/gotelemetry)"
}
- return fmt.Sprintf(format, reportDate, "`go run golang.org/x/telemetry/cmd/gotelemetry@latest off`")
+ return fmt.Sprintf(format, runCmd)
}

// acquireLockFile attempts to "acquire a lock" for writing to path.

To view, visit change 532095. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: I7e4db24076996f40a39e9653633e3e821a688f3b
Gerrit-Change-Number: 532095
Gerrit-PatchSet: 2
Gerrit-Owner: Robert Findley <rfin...@google.com>
Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
Gerrit-Reviewer: Robert Findley <rfin...@google.com>
Reply all
Reply to author
Forward
0 new messages