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: surface module deprecations #41321

Closed
jba opened this issue Sep 10, 2020 · 16 comments
Closed

x/pkgsite: surface module deprecations #41321

jba opened this issue Sep 10, 2020 · 16 comments
Labels
FeatureRequest FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. pkgsite

Comments

@jba
Copy link
Contributor

jba commented Sep 10, 2020

With the acceptance of #40357, there is now a standard way for module authors to deprecate a module major version: by adding a "Deprecated" comment to the go.mod file.

// Deprecated: ARBITRARY TEXT HERE
module M
...

pkg.go.dev should display deprecation notices prominently. We could display a banner with the deprecation comment at the top of every page that is part of the module major version.

Details:

  • The modules table should have a TEXT column named deprecation containing the comment.
  • Only the latest minor version of a module needs a deprecation comment for all the versions of that major version to be considered deprecated. That means that when inserting a module, we may need to update modules.deprecation for multiple rows. Alternatively, we could store it only on the latest version and have the frontend retrieve it whenever any version is accessed. Since we already get the latest version in order to display the Latest badge, this may not add any extra time if we organize the code right.
  • Because the text of the comment is arbitrary, we can't definitively link to the replacement module, if any. But we can heuristically link any word that looks like a module path.
  • We will probably want to use golang.org/x/mod/module.ParseLax to extract the comment from the go.mod file.
@gopherbot gopherbot added this to the Unreleased milestone Sep 10, 2020
@jba jba added pkgsite FeatureRequest NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Sep 10, 2020
@julieqiu julieqiu removed the website label Sep 19, 2020
@julieqiu julieqiu removed the website label Sep 19, 2020
@gopherbot
Copy link

Change https://golang.org/cl/290033 mentions this issue: migrations: add deprecated_comment column to modules table

@gopherbot
Copy link

Change https://golang.org/cl/290097 mentions this issue: internal/fetch: extract "Deprecated" module comment

@gopherbot
Copy link

Change https://golang.org/cl/290098 mentions this issue: internal/postgres: read and write deprecated comment

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 8, 2021
Add a column to the modules table that will hold
the "Deprecated" comment from the go.mod file.

For golang/go#41321

Change-Id: I6bce20ef6a84d6e33ed60811945f90930ae25a09
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/290033
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 9, 2021
When processing a module, parse its go.mod file and extract the
comment that deprecates the module, if there is one.

For golang/go#41321

Change-Id: I24a458ee706e14c3d77fca86413ae2587866a59c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/290097
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 9, 2021
Insert the deprecated comment into the modules table,
and read it back out.

For golang/go#41321

Change-Id: Ib4f2c8ceb70e28940b18f52d25b2a0d05c57648d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/290098
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/295430 mentions this issue: internal/proxydatasource: implement deprecation and retractions

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 24, 2021
When fetching a module at a version, the proxy datasource uses
fetch.RawLatestInfo to get the go.mod file at the raw latest version
of the module, then uses internal.RawLatestInfo.PopulateModule to
determine whether the module version is deprecated or retracted.

Also, add some proxy test modules to facilitate testing.

For golang/go#41321
For golang/go#43265
For golang/go#44437

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

Change https://golang.org/cl/295891 mentions this issue: internal: add experiment for retractions and deprecations

@gopherbot
Copy link

Change https://golang.org/cl/295892 mentions this issue: internal/postgres: add retraction/deprecation info to GetModuleInfo

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 24, 2021
For golang/go#43265
For golang/go#41321

Change-Id: I1e8e6fe0f55d536696e1c58e81726292278fd20c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/295891
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 24, 2021
For golang/go#43265
For golang/go#41321

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

Change https://golang.org/cl/295896 mentions this issue: internal/postgres: add retraction/deprecation info to versions

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 24, 2021
For golang/go#43265
For golang/go#41321

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

Change https://golang.org/cl/296209 mentions this issue: internal: embed ModuleInfo into UnitMeta

@gopherbot
Copy link

Change https://golang.org/cl/296229 mentions this issue: internal/postgres: add retraction/deprecation info to GetUnitMeta

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 25, 2021
UnitMeta had most of the fields of ModuleInfo, but did not embed
it. Now that we have added four more fields to ModuleInfo for
deprecation and retraction, it makes sense to embed it rather than
duplicate those fields.

For golang/go#43265
For golang/go#41321

Change-Id: I20e2b922b49c7873a5535745d644631123de37cd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/296209
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 25, 2021
For golang/go#43265
For golang/go#41321

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

Change https://golang.org/cl/296812 mentions this issue: internal/postgres: truncate raw_latest_versions

@gopherbot
Copy link

Change https://golang.org/cl/296815 mentions this issue: content/static: add deprecated and retracted banners

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 26, 2021
For golang/go#43265
For golang/go#41321

Change-Id: I7bf803b68b1532b968ad1175433275f5a4778078
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/296812
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 26, 2021
When a module is deprecated or retracted, add a banner to the main
page.

Test with an integration test to verify that the
deprecation/retraction information makes it through the entire
pipeline.

For golang/go#43265
For golang/go#41321

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

Change https://golang.org/cl/297509 mentions this issue: internal/frontend: add deprecated/retracted info to versions

@gopherbot
Copy link

Change https://golang.org/cl/297529 mentions this issue: content/static/html: gate deprecated/retracted by experiment

gopherbot pushed a commit to golang/pkgsite that referenced this issue Mar 2, 2021
For golang/go#43265
For golang/go#41321

Change-Id: I1c53af8cd04ec0d3d2b13874cd028a3f97b5101b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/297509
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Mar 2, 2021
For golang/go#43265
For golang/go#41321

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

Change https://golang.org/cl/307489 mentions this issue: content/static/html/helpers: add space to Deprecated banner

gopherbot pushed a commit to golang/pkgsite that referenced this issue Apr 5, 2021
Add a space after the colon in "Deprecated: reason".

For golang/go#41321

Change-Id: I2440c4cc34ec23d4e7eb81e926d815013ff32725
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307489
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
@jamalc
Copy link

jamalc commented Apr 6, 2021

Here is a mockup of how we'll surface deprecations on the version page.

Screen Shot 2021-04-06 at 11 30 52 AM

@gopherbot
Copy link

Change https://golang.org/cl/307849 mentions this issue: content/static: add badges to the version page

gopherbot pushed a commit to golang/pkgsite that referenced this issue Apr 7, 2021
Adds badges for deprecated major versions and
retracted versions on the versions page.

For golang/go#41321
For golang/go#43265

Change-Id: Ia7194cb6ef1efeb67d452844f4e40c39d7a7ffa9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/307849
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
@jba jba closed this as completed Apr 30, 2021
@golang golang locked and limited conversation to collaborators Apr 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. pkgsite
Projects
None yet
Development

No branches or pull requests

4 participants