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/pkgsite: remove github.com/golang/perf (the correct one is golang.org/x/perf) #68703

Closed
mark-pictor-csec opened this issue Aug 1, 2024 · 8 comments
Assignees
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation NeedsFix The path to resolution is known, but the work has not been done. pkgsite
Milestone

Comments

@mark-pictor-csec
Copy link

Go version

N/A

Output of go env in your module/workspace:

N/A

What did you do?

Visit https://pkg.go.dev/github.com/golang/perf/cmd/benchstat

What did you see happen?

Documentation is for v0.0.0-20190306144031-151b6387e3f2, from 2019. Documented flags include -html, which does not exist in the latest version.

What did you expect to see?

Documentation matches the binary installed via go install golang.org/x/perf/cmd/benchstat@latest.
The flag was removed in perf rev 02c5517, from January 2023.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Aug 1, 2024
@gopherbot gopherbot added this to the Unreleased milestone Aug 1, 2024
@gabyhelp
Copy link

gabyhelp commented Aug 1, 2024

Related Issues and Documentation

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

@mknyszek mknyszek added the NeedsFix The path to resolution is known, but the work has not been done. label Aug 1, 2024
@mknyszek
Copy link
Contributor

mknyszek commented Aug 1, 2024

CC @aclements maybe?

@prattmic
Copy link
Member

prattmic commented Aug 1, 2024

https://pkg.go.dev/github.com/golang/perf/cmd/benchstat is the documentation for github.com/golang/perf, not golang.org/x/perf. Only the latter is the correct module path.

The psuedoversion v0.0.0-20190306144031-151b6387e3f2 is at https://go.googlesource.com/perf/+/151b6387e3f2aa5908e4a6074f06be9ecc34f004, before there was a go.mod file, so I suppose this package was importable via github.com/golang/perf.

cc @golang/pkgsite is there anything we can do here to avoid confusion? Perhaps just remove github.com/golang/perf entirely?

@thepudds
Copy link
Contributor

thepudds commented Aug 1, 2024

This is probably similar to #68357 (though I didn’t double check the details, so sorry if not).

@mark-pictor-csec
Copy link
Author

When I submitted, it hadn't occurred to me that there were two different URLs for benchstat docs.
https://pkg.go.dev/golang.org/x/perf/cmd/benchstat
https://pkg.go.dev/github.com/golang/perf/cmd/benchstat

For pkg.go.dev/golang.org/x/perf/..., is the package crawler actually using the golang.org url or does it still go to github.com/golang/perf/... like the other?

My thinking is, if the package crawler detects all of the following:

  • $url and $url2 are both for code in the same git repo, and
  • only one of the two has a module, and
  • the one with the module is newer
    ... then manipulate the page in some way that results in users going to the better version.

This manipulation could take the form of a banner newer version at new import path [link] and/or, as mentioned in #68357 (comment), via meta tags telling search engines to go away. (IMO adding both would be best, so that if I get to the old version in spite of a search engine, I can still get to the newest/best version).

I think this approach would work on both #68357 and on this issue.

@prattmic
Copy link
Member

prattmic commented Aug 1, 2024

For pkg.go.dev/golang.org/x/perf/..., is the package crawler actually using the golang.org url or does it still go to github.com/golang/perf/... like the other?

golang.org/x/... uses the <meta name="go-import"> mechanism to redirect to the actual git repository. However, the official git repo for golang.org/x/perf is https://go.googlesource.com/perf, not https://github.com/golang/perf.

So while I think your proposed approach would work for most vanity import paths, it wouldn't work here.

@mknyszek mknyszek changed the title x/perf: benchstat documentation is outdated pkgsite: x/perf/cmd/benchstat documentation is outdated Aug 7, 2024
@prattmic prattmic changed the title pkgsite: x/perf/cmd/benchstat documentation is outdated x/pkgsite: x/perf/cmd/benchstat documentation is outdated Aug 7, 2024
@hyangah
Copy link
Contributor

hyangah commented Aug 8, 2024

Let's remove github.com/golang/perf from pkgsite.

@hyangah hyangah changed the title x/pkgsite: x/perf/cmd/benchstat documentation is outdated x/pkgsite: remove github.com/golang/perf (the correct one is golang.org/x/perf) Aug 8, 2024
@hyangah hyangah self-assigned this Aug 8, 2024
@hyangah
Copy link
Contributor

hyangah commented Aug 8, 2024

Removed

@hyangah hyangah closed this as completed Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation NeedsFix The path to resolution is known, but the work has not been done. pkgsite
Projects
Development

No branches or pull requests

7 participants