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: latest version should not be +incompatible #37714

Closed
jba opened this issue Mar 6, 2020 · 12 comments
Closed

x/pkgsite: latest version should not be +incompatible #37714

jba opened this issue Mar 6, 2020 · 12 comments

Comments

@jba
Copy link
Contributor

@jba jba commented Mar 6, 2020

When deciding which version of a module is the latest, if there is a version with a go.mod file, prefer it to incompatible versions.

Example: given versions

  • v2.0.0+incompatible
  • v1.2.3
    we would display the first as latest. We should display the second.
@jba jba added the pkgsite label Mar 6, 2020
@jba jba self-assigned this Mar 6, 2020
@gopherbot gopherbot added this to the Unreleased milestone Mar 6, 2020
@jba
Copy link
Contributor Author

@jba jba commented Mar 6, 2020

The go command behaves similarly as of 1.14: https://golang.org/doc/go1.14#incompatible-versions.

@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Mar 10, 2020

/cc @fflewddur for context

@julieqiu julieqiu added the UX label Mar 10, 2020
@julieqiu julieqiu changed the title go.dev: latest version should not be +incompatible x/pkgsite: latest version should not be +incompatible Jun 15, 2020
@zot
Copy link

@zot zot commented Jul 12, 2020

Nice! Looks like this would resolve the long-standing issue with libp2p docs: libp2p/go-libp2p#805

@jamalc jamalc assigned jamalc and unassigned jba Jul 27, 2020
@julieqiu julieqiu assigned AceroM and unassigned jamalc Jul 31, 2020
@julieqiu julieqiu removed the UX label Jul 31, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Aug 7, 2020

Change https://golang.org/cl/247404 mentions this issue: migrations: add migrations for module compatibility sorting

gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 10, 2020
Add the "incompatible" column to both the modules and
module_version_states tables in order to sort modules by compatibility
whenever they are being displayed or processed.

Updates golang/go#37714

Change-Id: I1f7b5dd55563b38af5c54a692b5e70512ef24c0e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/247404
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
@gopherbot
Copy link

@gopherbot gopherbot commented Aug 10, 2020

Change https://golang.org/cl/247757 mentions this issue: internal: add Incompatible field to ModuleInfo

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 12, 2020

Change https://golang.org/cl/248182 mentions this issue: internal/postgres: add incompatible support for module_version_states

gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 13, 2020
This change modifies the InsertModule function to insert modules with an
Incompatible field for the new Incompatible column in the modules table.

A test is added to check the latest version of inserted modules.

Updates golang/go#37714

Change-Id: I7ef04b8709f9499d747d9795531cbc83b5de25ad
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/247757
Reviewed-by: Julie Qiu <julie@golang.org>
@gopherbot
Copy link

@gopherbot gopherbot commented Aug 14, 2020

Change https://golang.org/cl/248497 mentions this issue: internal/postgres: move orderByLatest to path.go

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 14, 2020

Change https://golang.org/cl/248498 mentions this issue: internal/postgres: modify LegacyGetPackage to prefer compatible modules

gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 17, 2020
This change adds support for inserting, sorting and updating
module_version_states.incompatible.

Updates golang/go#37714

Change-Id: I40b0831adef6e78beafee259e972cb0e4d4b90c4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/248182
Run-TryBot: Julie Qiu <julie@golang.org>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
@gopherbot
Copy link

@gopherbot gopherbot commented Aug 18, 2020

Change https://golang.org/cl/249119 mentions this issue: internal/postgres: update GetPathInfo to prefer non-incompatible modules

gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 19, 2020
This change moves orderByLatest to path.go as we transition into a path
based data model. Additionally "incompatible" is added so that we would
prefer non-incompatible modules.

Since there was a lot of duplicated logic for the ORDER BY keyword for
the queries for modules, this change modifies orderByLatest to be a
helper function that returns an ORDER BY sql string used in many
functions to sort modules.

Updates golang/go#37714

Change-Id: I5c8e5264e90442a960328439dcc445397fc4cdbd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/248497
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 19, 2020
This change updates LegacyGetPackage to use orderByLatest in the query
to prefer compatible modules. This change will directly affect a
package's header in the documentation page.

i.e: in the blackfriday package
before: https://i.imgur.com/kS1WF7n.png
after: https://imgur.com/a/smrtQzy

Updates golang/go#37714

Change-Id: I32fde2cf2b33763497dae1021138ace668eb1043
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/248498
Reviewed-by: Julie Qiu <julie@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 19, 2020
Updates GetPathInfo to use orderByLatest in the query to prefer
compatible modules.

Updates golang/go#37714

Change-Id: I89fd654c414f860a2f8a327ff9a8fde07fd35120
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/249119
Run-TryBot: Miguel Acero <acero@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
@gopherbot
Copy link

@gopherbot gopherbot commented Aug 19, 2020

Change https://golang.org/cl/249277 mentions this issue: internal/postgres: update LegacyGetModuleInfo to prefer non-incompatible modules

@gopherbot
Copy link

@gopherbot gopherbot commented Aug 19, 2020

Change https://golang.org/cl/249278 mentions this issue: internal/postgres: update UpsertSearchDocument to prefer non-incompatible modules

gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 19, 2020
…ble modules

Updates LegacyGetModuleInfo to use orderByLatest in the query to prefer
compatible modules.

Updates golang/go#37714

Change-Id: I83bbbf3a8f5753533f3b2d8d5e329e82400951df
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/249277
Run-TryBot: Miguel Acero <acero@google.com>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 19, 2020
…ible modules

Updates UpsertSearchDocument's to use orderByLatest in the query to
prefer compatible modules when inserting into the search_documents
table. This change updates the versions seen in the search results once
the module is reprocessed.

before: https://i.imgur.com/A7boYiC.png
after: https://i.imgur.com/ZLdTuex.png

Updates golang/go#37714

Change-Id: I527e6f157c5ddfe2a73e561f0be78738d97bb2fc
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/249278
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
@zot
Copy link

@zot zot commented Aug 24, 2020

Hey, the https://pkg.go.dev/github.com/libp2p/go-libp2p properly shows the most recent version now!

Awesome!

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