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: search results show incorrect latest version if the latest version of the module and package do not match #41108

Open
Deseao opened this issue Aug 28, 2020 · 3 comments
Assignees
Labels

Comments

@Deseao
Copy link

@Deseao Deseao commented Aug 28, 2020

The search result list for a query will include a Version and Published in the results that may not match the version that will be loaded when following the link due to the most recent module aware version being numerically lower than the +incompatible version that was released before the package converted to support Go modules.

As an example, searching for stripe results in the top result listing "Version: v70.15.0+incompatible | Published: Apr 14, 2020 | Imported by: 1171 | License: MIT"
If you follow the link, the result page is for v1.0.3 with a publication date of Oct 22, 2014.

@gopherbot gopherbot added this to the Unreleased milestone Aug 28, 2020
@cagedmantis cagedmantis changed the title x/pkgsite search results show incorrect Version labels and Published dates. x/pkgsite: search results show incorrect Version labels and Published dates Aug 30, 2020
@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Aug 30, 2020

@jba jba added NeedsFix and removed NeedsInvestigation labels Aug 30, 2020
@jba jba self-assigned this Aug 30, 2020
@jba
Copy link
Contributor

@jba jba commented Aug 30, 2020

I believe the current state is that the code is in place and deployed, but the search data needs refreshing. Will confirm on Monday.

@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Aug 31, 2020

The first result for https://pkg.go.dev/search?q=stripe is now fixed. github.com/stripe/stripe-go shows v1.0.3, which matches the latest version on https://pkg.go.dev/github.com/stripe/stripe-go.

The second result, github.com/stripe/stripe-go/form, has a bug that needs to be fixed.

Currently, it shows v70.15.0+incompatible. The latest version of github.com/stripe/stripe-go/form is actually v1.0.4-0.20190107233620-02a95e768d9b, which is shown on https://pkg.go.dev/github.com/stripe/stripe-go/form.

The reason is because the isLatestVersion logic in InsertModule only takes into account the module path, not each individual package path:
https://github.com/golang/pkgsite/blob/master/internal/postgres/insert_module.go#L118

Thanks for filing this @Deseao! We'll work on a fix.

@julieqiu julieqiu modified the milestones: Unreleased, pkgsite/search Aug 31, 2020
@julieqiu julieqiu changed the title x/pkgsite: search results show incorrect Version labels and Published dates x/pkgsite: search results show incorrect latest version if the latest version of the module and package do not match Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.