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

Open
jba opened this issue Sep 10, 2020 · 0 comments
Open

x/pkgsite: surface module deprecations #41321

jba opened this issue Sep 10, 2020 · 0 comments

Comments

@jba
Copy link
Contributor

@jba 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
@gopherbot gopherbot added the go.dev label Sep 18, 2020
@julieqiu julieqiu removed the go.dev label Sep 19, 2020
@gopherbot gopherbot added the go.dev label Sep 19, 2020
@julieqiu julieqiu removed the go.dev label Sep 19, 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
3 participants
You can’t perform that action at this time.