You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gopls/internal/telemetry/cmd/stacks: use authentication token
GitHub imposes a stringent rate limit for unauthenticated requests,
that our current rate of telemetry often exceeds.
This change causes the stacks command to read a GitHub
authentication token from $HOME/.stacks.token and use it if found,
relaxing the rate limit. Instructions for creating a token are
recorded in comments.
Fixesgolang/go#68733
Change-Id: Ia4b73faa1340dfbed4b9b350d2c57f09abf8ca38
Reviewed-on: https://go-review.googlesource.com/c/tools/+/603155
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
log.Printf("no file %s containing GitHub authentication token; continuing without authentication, which is subject to stricter rate limits (https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api).", tokenFile)
68
+
}
69
+
token=string(bytes.TrimSpace(content))
70
+
}
71
+
41
72
// Maps stack text to Version/GoVersion/GOOS/GOARCH string to counter.
42
73
stacks:=make(map[string]map[string]int64)
43
74
vardistinctStacksint
@@ -129,10 +160,10 @@ func main() {
129
160
batch:=stackIDs[:min(6, len(stackIDs))]
130
161
stackIDs=stackIDs[len(batch):]
131
162
132
-
query:="label:gopls/telemetry-wins in:body "+strings.Join(batch, " OR ")
163
+
query:="is:issue label:gopls/telemetry-wins in:body "+strings.Join(batch, " OR ")
0 commit comments