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: show the version when a symbol was added to a package #37102

Open
ptman opened this issue Feb 7, 2020 · 39 comments
Open

x/pkgsite: show the version when a symbol was added to a package #37102

ptman opened this issue Feb 7, 2020 · 39 comments

Comments

@ptman
Copy link

@ptman ptman commented Feb 7, 2020

What is the URL of the page with the issue?

pkg.go.dev

What did you expect to see?

The same info as on e.g. https://golang.org/pkg/context/ about which version introduced changes.

@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Feb 7, 2020

@ptman do you mean what version of the package, or version of pkg.go.dev (as in #36810)?

@ptman
Copy link
Author

@ptman ptman commented Feb 7, 2020

@julieqiu in case of golang.org/pkg/ which only shows stdlib packages, it tells which go release (1.7 introduced context). If you can handle package versions for more than stdlib then that would be a welcome addition.

@julieqiu julieqiu changed the title pkg.go.dev: Show version that introduced change pkg.go.dev: show the package version that introduced a change in documentation Feb 19, 2020
@julieqiu julieqiu removed the Documentation label Apr 22, 2020
@julieqiu julieqiu added the UX label Apr 22, 2020
@dmitshur
Copy link
Member

@dmitshur dmitshur commented Apr 22, 2020

For reference, adding this feature to golang.org/pkg for the Go standard library (only) was issue #5778, and it was implemented in CL 85396 and CL 124495.

@julieqiu julieqiu changed the title pkg.go.dev: show the package version that introduced a change in documentation x/pkgsite: show the package version that introduced a change in documentation Jun 15, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jun 15, 2020
@julieqiu julieqiu modified the milestones: Unreleased, pkgsite/dochtml Aug 19, 2020
@julieqiu julieqiu changed the title x/pkgsite: show the package version that introduced a change in documentation x/pkgsite: show the package version when a symbol was added Dec 2, 2020
@julieqiu julieqiu self-assigned this Dec 2, 2020
@julieqiu
Copy link
Contributor

@julieqiu julieqiu commented Dec 2, 2020

See #42933 also for additional context.

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 3, 2021

Change https://golang.org/cl/289249 mentions this issue: migrations: add types and tables for symbol history

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 3, 2021

Change https://golang.org/cl/288755 mentions this issue: internal/godoc/dochtml/internal/render: export OneLineNodeDepth

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 3, 2021

Change https://golang.org/cl/288756 mentions this issue: internal/{godoc/dochtml}: add GetSymbols

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 3, 2021

Change https://golang.org/cl/288757 mentions this issue: internal/godoc/dochtml: add docIsEmpty

@cespare
Copy link
Contributor

@cespare cespare commented Feb 4, 2021

What precisely is a "package version" as mentioned in the issue title?

Is the plan to implement this for the stdlib only, or for third-party code as well?

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 4, 2021
The types symbol_section, symbol_type, and goos_arch are added. The
tables symbols and symbol_history are added.

These will be used to track to package version when a symbol is added to
package.

For golang/go#37102

Change-Id: I6f06d69f5ef09c4a5e3627878f2ba97ec9fb3704
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/289249
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 4, 2021
The docIsEmpty helper function is added, which indicates if a package
doc is empty.

For golang/go#37102

Change-Id: I633e2a842b8e6324ead0c935e3547f340b4f2540
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288757
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 19, 2021
Table symbols was renamed to symbol_names. References in the code are
also changed.

For golang/go#37102

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

@gopherbot gopherbot commented Feb 19, 2021

Change https://golang.org/cl/293954 mentions this issue: internal/postgres: update insertSymbols

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 19, 2021
There are bugs in stdlib.ParsePackageAPIInfo that cases a mismatch
between the data on pkgsite and golang.org/pkg. These exceptions are ignored
when comparing the two data sources.

For golang/go#37102

Change-Id: If51700edeb316cd5bf887fa77c5b89ac7969a1b6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/294269
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 19, 2021
insertSymbols is updated to match the new schema for symbols.

For golang/go#37102

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

@gopherbot gopherbot commented Feb 22, 2021

Change https://golang.org/cl/294689 mentions this issue: internal/postgres: change buildcontext key in getSymbolHistory

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 23, 2021

Change https://golang.org/cl/295269 mentions this issue: migrations: add package_symbols_package_path_id_module_path_id_section_synopsis_key

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 23, 2021
Instead of using a custom string as the key in getSymbolHistory, just
use internal.BuildContext.

For golang/go#37102

Change-Id: I87feabd36a6b33fc9a34bd5cf3ab0012bdbbf012
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/294689
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 23, 2021
…n_synopsis_key

A unique constraint is added to
package_symbols(package_path_id, module_path_id, section, synopsis),
since a given combination should never appear more than once.

For golang/go#37102

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

@gopherbot gopherbot commented Feb 23, 2021

Change https://golang.org/cl/295270 mentions this issue: internal/postgres: change upserts for symbol_names and package_symbols

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 23, 2021
To avoid unnecessary write attempts when inserting symbols information,
run a SELECT query first to get existing symbol names and package
symbols, and only insert rows that we know do not exist.

For golang/go#37102

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

@gopherbot gopherbot commented Feb 24, 2021

Change https://golang.org/cl/295952 mentions this issue: migration: add documentation.id, new_goos, and new_goarch

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 24, 2021

Change https://golang.org/cl/296190 mentions this issue: internal/postgres: update insertDocs

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 24, 2021

Change https://golang.org/cl/296189 mentions this issue: internal/postgres: insert documentation_symbols

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 24, 2021

Change https://golang.org/cl/295953 mentions this issue: migrations: create documentation_symbols

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 24, 2021
new_goos and new_goarch are the same as goos and goarch, but they use
the goos and goarch enum instead of a string.

A trigger is added to populate documentation.id on insert or update.

For golang/go#37102

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

Change-Id: I75fbb6393664ade2ab14f70d8df0e4503c5adea9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/295953
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 25, 2021
insertDocs now inserts new_goos and new_goarch. It returns a map of
pathToDocIDToDoc.

For golang/go#37102

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

@gopherbot gopherbot commented Feb 25, 2021

Change https://golang.org/cl/296249 mentions this issue: internal/postgres: add WithSymbol for GetUnit

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 25, 2021
Data is now written to the documentation_symbols table. An experiment
flag "insert-symbols" is added for writing data to symbol_names,
package_symbols and documentation_symbols.

For golang/go#37102

Change-Id: Id95c754740a7dd5f836bf0766815b274dba6790b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/296189
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 25, 2021
GetUnit now supports the WithSymbol fieldset, which fetches all of the
symbols for the unit.

For golang/go#37102

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

@gopherbot gopherbot commented Mar 5, 2021

Change https://golang.org/cl/298071 mentions this issue: internal/postgres: add GetPackageSymbols

@gopherbot
Copy link

@gopherbot gopherbot commented Mar 5, 2021

Change https://golang.org/cl/298072 mentions this issue: internal/symbol: add IntroducedHistory

gopherbot pushed a commit to golang/pkgsite that referenced this issue Mar 5, 2021
GetPackageSymbols is added, which returns all of the documentation
symbols for a package

For golang/go#37102

Change-Id: Ia342c245d5d0cd3693640fddf00e932b341117c0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/298071
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Mar 5, 2021
The isolation level is changed back to RepeatableRead in InsertModule to
fix issues when inserting into documentation_symbols.

For golang/go#37102

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

@gopherbot gopherbot commented Mar 5, 2021

Change https://golang.org/cl/298989 mentions this issue: internal/postgres: use RepeatableRead in InsertModule

gopherbot pushed a commit to golang/pkgsite that referenced this issue Mar 5, 2021
IntroducedHistory is added, which returns the first version when a
symbol name is added to the package API.

For golang/go#37102

Change-Id: Ia7c60d2a0258aa20d4e6c3ea71446c75d7784623
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/298072
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Mar 5, 2021
The UNIQUE INDEX on
package_symbols_package_path_id_module_path_id_section_synopsis_key is
changed such that the uuid of synopsis is used instead of the synopsis
string.

This is because the synopsis can be very long, whereas
sha256(synopsis::bytea) is fixed at 32 bytes.

For golang/go#37102

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

@gopherbot gopherbot commented Mar 5, 2021

Change https://golang.org/cl/298769 mentions this issue: migrations: use expression index on package_symbols

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
7 participants