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/build/cmd/gopherbot: reply to unversioned urls with permalink #25345

Open
meirf opened this Issue May 11, 2018 · 4 comments

Comments

Projects
None yet
6 participants
@meirf
Copy link
Contributor

meirf commented May 11, 2018

It seems to be a frequent occurrence that non-versioned github urls with line numbers are included in issues. These links make investigations more time consuming when code inevitably changes.

The problematic pattern is: https://github.com/<repo>/blob/master.+#L\d+
Example: https://github.com/golang/go/blob/master/src/mime/multipart/formdata.go#L78

I would guess that a quarter of these match that pattern.

Let's say there are 3 primary categories of non-versioned code urls with line number(s):

  1. non-Go (mostly on github.com)
  2. Go on github.com
  3. Go on golang.org

3 is very much in our control and is discussed in #14062.
1 and 2 are harder to control. A solution could be gopherbot replying to new issues that match the pattern with a permalink that included the latest commit when the issue was created. (Another solution is to have the new issue template suggest a versioned url for any non-playground code.)

To avoid spam, maybe this would only respond to the body of a new issue - not any comments.

The message could be something like:

@andybons @bradfitz

@gopherbot gopherbot added this to the Unreleased milestone May 11, 2018

@gopherbot gopherbot added the Builders label May 11, 2018

@meirf meirf changed the title x/build/cmd/gopherbot: reply to unversioned urls with permalink gopherbot: reply to unversioned urls with permalink May 11, 2018

@josharian

This comment has been minimized.

Copy link
Contributor

josharian commented May 11, 2018

Related and probably simpler, it’d be nice if gopherbot edited issues/comments to change CL NNNN to [CL NNNN](https://golang.org/cl/NNNN).

@agnivade

This comment has been minimized.

Copy link
Member

agnivade commented May 11, 2018

it’d be nice if gopherbot edited issues/comments to change CL NNNN to CL NNNN.

It already does that if I understand you correctly. See description of https://golang.org/cl/108678.

EDIT: Oh sorry - you meant comments on github issues right ? Not gerrit changes.

@FiloSottile

This comment has been minimized.

Copy link
Member

FiloSottile commented May 11, 2018

I think gopherbot could even just edit the links inline. I can't think of a situation where a user would want a direct link to an unversioned line link.

@FiloSottile FiloSottile changed the title gopherbot: reply to unversioned urls with permalink x/build/cmd/gopherbot: reply to unversioned urls with permalink May 11, 2018

@meirf

This comment has been minimized.

Copy link
Contributor Author

meirf commented May 11, 2018

Oh I didn’t know the github api allowed changing someone else’s post. That’s certainly a more concise alternative, albeit bit creepy to some people. (If you’re changing my urls, what else are you changing?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.