golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.63k stars 17.61k forks source link

x/telemetry: consolidate gopls's cmd/stacks with watchflakes #69973

Open findleyr opened 4 hours ago

findleyr commented 4 hours ago

This issue is following up on a team discussion. Filing to make sure we capture context.

We've been using golang.org/x/tools/gopls/internal/telemetry/cmd/stacks to produce and de-dupe the issues filed under the gopls/telemetry-wins label.

This command parses, formats, linkifies, and de-dupes stack traces appearing in telemetry data. For "new" stacks, it pops open a window to file a github issue. Recently, @adonovan added predicate-based deduplication, similar to watchflakes.

Now we have stacks coming from more than just gopls: the compile/bug stack counter has been appearing in recent data (example). We should generalize the stacks command. It has been suggested to merge it with watchflakes, since the two serve similar functionality.

Here are some barriers to this automation:

  1. The stacks command does git-clone and build of the various executables as that's the only way to get the correct pclntab required to map the symbol-relative line numbers into absolute CodeSearch URLs
  2. Running the command sometimes results in errors in which two issues "claim" the same stack due to overlapping rules. In this case one or both of the rules should be updated and the tool re-run.
  3. When no existing issue claims the stack, the command opens a browser tab with a populated "New issue" form. At this point the triageur is expected to see if it looks like a real new issue or a dup. If a dup, the existing issue's rule should be updated and the tool re-run. If not, then the user should submit the form to create the new issue.
  4. when creating the new issue, it's a good idea to choose a more specific title and to copy some of the surrounding code (e.g. the call to bug.Report) into the issue body. I suppose that could be done later by the triageur. Or automated with better heuristics and logic.
gabyhelp commented 4 hours ago

Related Issues and Documentation

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