Skip to content
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

x/tools/gopls/internal/telemetry/cmd/stacks: more automation #71045

Closed
adonovan opened this issue Dec 27, 2024 · 12 comments
Closed

x/tools/gopls/internal/telemetry/cmd/stacks: more automation #71045

adonovan opened this issue Dec 27, 2024 · 12 comments
Labels
gopls Issues related to the Go language server, gopls. telemetry x/telemetry issues Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@adonovan
Copy link
Member

adonovan commented Dec 27, 2024

Needed improvements to stacks command:

See also:

@prattmic may have more ideas since he is now using stacks with the compiler (yay).

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Dec 27, 2024
@gopherbot gopherbot added this to the Unreleased milestone Dec 27, 2024
@gabyhelp
Copy link

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

@adonovan adonovan added telemetry x/telemetry issues gopls Issues related to the Go language server, gopls. and removed gopls Issues related to the Go language server, gopls. labels Dec 27, 2024
@findleyr findleyr modified the milestones: Unreleased, gopls/backlog Dec 27, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/642419 mentions this issue: gopls/internal/telemetry/cmd/stacks: refactor report processing to support different programs

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/642420 mentions this issue: gopls/internal/telemetry/cmd/stacks: support cmd/compile

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/642418 mentions this issue: gopls/internal/telemetry/cmd/stacks: add cmd/compile support to readPCLineTable

gopherbot pushed a commit to golang/tools that referenced this issue Jan 13, 2025
…CLineTable

Building the compiler is actually simpler than gopls, since
GOTOOLCHAIN is all you need. No need to explicitly git clone anything.

Most of this is just minor refactoring to avoid hard-coding gopls
details.

Updates golang/go#71045.

Change-Id: I6a6a636c5d950cec713e358dfd4dddcbd07554fc
Reviewed-on: https://go-review.googlesource.com/c/tools/+/642418
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
gopherbot pushed a commit to golang/tools that referenced this issue Jan 13, 2025
…pport different programs

Only gopls is actually supported for now. This CL is intended to be a
no-op. It consists of two main pieces:

* Refactoring the giant main function into smaller pieces that are
  easier to understand individually.
* Adding a ProgramConfig to describe how to process reports from a
  specific program.

Updates golang/go#71045.

Change-Id: I6a6a636c5b8b56bf72354a8795320eac7de7ef93
Reviewed-on: https://go-review.googlesource.com/c/tools/+/642419
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/642436 mentions this issue: gopls/internal/telemetry/cmd/stacks: paginate issue search

gopherbot pushed a commit to golang/tools that referenced this issue Jan 13, 2025
Updates golang/go#71045.

Change-Id: I6a6a636cc93ecf5342a4577ad4faefc2e2bc0063
Reviewed-on: https://go-review.googlesource.com/c/tools/+/642420
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
gopherbot pushed a commit to golang/tools that referenced this issue Jan 13, 2025
The GitHub API returns at most 100 results per page, but gopls already
has 101 issues, so we are dropping issues and need pagination.

The GitHub search API has a hard limit of 1000 results
(https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#about-search),
which we'll hit eventually.

As an alternative, use the "List repository issues" API
(https://docs.github.com/en/rest/issues/issues?apiVersion=2022-11-28#list-repository-issues).
This allows filtering by label, which is all we need.

Note that the old code was mistakenly searching all of GitHub, not just
golang/go. That is now fixed.

GitHub pagination uses an awkward header format
(https://docs.github.com/en/rest/using-the-rest-api/using-pagination-in-the-rest-api?apiVersion=2022-11-28),
but it is ultimately just ?page=1, ?page=2, etc, so we just keep trying
new pages until we get no more results.

Updates golang/go#71045.

Change-Id: I6a6a636ccc17c9e1b1024369f98965f59456896a
Reviewed-on: https://go-review.googlesource.com/c/tools/+/642436
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/643776 mentions this issue: internal/telemetry/cmd/stacks: test predicates

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/642421 mentions this issue: gopls/internal/telemetry/cmd/stacks: add dry run flag

gopherbot pushed a commit to golang/tools that referenced this issue Jan 22, 2025
This flag avoids updating existing issues. It still requires a GitHub
auth token to determine which issues would get updated. It also still
opens a browser window for new issues.

For golang/go#71045.

Change-Id: I6a6a636c26a402c9ea66160e14cd388b490b74b9
Reviewed-on: https://go-review.googlesource.com/c/tools/+/642421
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
gopherbot pushed a commit to golang/tools that referenced this issue Jan 22, 2025
Factor out parsing and evaluation of #stacks predicates.

Add a test.

For golang/go#71045.

Change-Id: I677e34e555a1f1ebb0722088d55e0c9edd3b3f40
Reviewed-on: https://go-review.googlesource.com/c/tools/+/643776
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/643835 mentions this issue: internal/telemetry/cmd/stacks: anchored literals

gopherbot pushed a commit to golang/tools that referenced this issue Jan 22, 2025
Literals in predicates are re-interpreted as matching at word boundaries.
A literal like "fu+12" will no longer match "fu+123" or "snafu+12".

For golang/go#71045.

Change-Id: Id5b6c8ad536dadebdb9593cbfa13ff8dd81b6645
Reviewed-on: https://go-review.googlesource.com/c/tools/+/643835
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/644115 mentions this issue: internal/telemetry/cmd/stacks: reopen issues

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/644018 mentions this issue: internal/telemetry/cmd/stacks: cmd/compile reopen

gopherbot pushed a commit to golang/tools that referenced this issue Jan 24, 2025
Re-open an issue if it was closed as fixed, but we encounter a new stack
in a later version.

For golang/go#71045.

Change-Id: If6a4fe4091588e42b6f6c47e8705313352dc295e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/644115
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
@jba
Copy link
Contributor

jba commented Jan 27, 2025

I closed this since the two specific items that are mentioned in the top post are completed.
Re-open if there is more to be done.

@adonovan
Copy link
Member Author

Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. telemetry x/telemetry issues Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

5 participants