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):
- non-Go (mostly on github.com)
- Go on github.com
- 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
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):
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