shurcooL / home

home is Dmitri Shuralyov's personal website.
https://dmitri.shuralyov.com
MIT License
76 stars 2 forks source link

in activity feed, combine repo path and issue/change prefix into full import path #26

Closed dmitshur closed 5 years ago

dmitshur commented 5 years ago

The activity feed on the index page of dmitri.shuralyov.com shows events, such as:

image

Right now, the following 2 pieces of information are displayed separately:

  1. the repository it happened in ("github.com/golang/go" in the screenshot above)
  2. the title of the issue or change ("x/build/cmd/coordinator: fails ..." in the screenshot above)

I'm working primarily with Go, and the Go project has a well established convention for including the package as a prefix before the title, e.g., "net/http: add StatusTooEarly (425)". (It makes sites like goissues.org possible.) Additionally, many Go packages have vanity import paths that differ from the repository path that they're contained in, which we can find out relatively easily from go.mod files (see commit https://github.com/shurcooL/events/commit/5bd98dd6544e32f15023245a6225fdbbe4cc9ceb).

It's possible to use that information to compute the full import path of the affected Go package. Displaying that will be more readable and streamlined.

Screenshots

Example 1

For example, instead of seeing the repo and prefix on separate lines:

image

We can combine them and show:

image

Example 2

Instead of having to read "proxy:" before seeing that it's the x/net subrepo:

image

We can combine into a more readable "golang.org/x/net/proxy" import path:

image

Example 3

Instead of:

image

We can also include a snippet from the issue description body:

image

Example 4

This applies to third-party Go packages too. Instead of:

image

We can show the correct custom import path of that project:

image

dmitshur commented 5 years ago

This change is implemented and live on dmitri.shuralyov.com now! 🚀

I'm going to take some time before merging the code to master, to make sure everything looks good in production, decide where to place a new package, review and clean it up some more, and then push.