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

Closed
ptman opened this issue Feb 7, 2020 · 115 comments
Closed

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

ptman opened this issue Feb 7, 2020 · 115 comments
Labels
FeatureRequest FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite

Comments

@ptman
Copy link

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.

@ALTree ALTree added the pkgsite label Feb 7, 2020
@julieqiu julieqiu added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 7, 2020
@julieqiu
Copy link
Member

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 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 added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Feb 19, 2020
@julieqiu julieqiu added the UX Issues that involve UXD/UXR input label Apr 22, 2020
@dmitshur
Copy link
Contributor

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
Member

julieqiu commented Dec 2, 2020

See #42933 also for additional context.

@gopherbot
Copy link

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

@gopherbot
Copy link

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

@gopherbot
Copy link

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

@gopherbot
Copy link

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

@cespare
Copy link
Contributor

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 May 5, 2021
A bug in frontend.ParseVersionsDetails and symbol.CompareAPIVersions is
fixed to handle cases when the version is a Go tag.

For golang/go#37102

Change-Id: Iffc444956baa394cd40fad97096220a3721522ba
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/317016
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 May 5, 2021
An integration test is added for these cases:

- A symbol changes across different build contexts
- A symbol is introduced at different versions for different build contexts
- The package symbol for a symbol changes because its parent changes,
  but the name and synopsis are the same

For golang/go#37102

Change-Id: Ieca17042e11b2fd583e2133a3064ab6043a29858
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/316969
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 May 5, 2021
Indexes are added to these columns, since they are used in WHERE clauses
in various queries:

- sort_version
- goos
- goarch

For golang/go#37102

Change-Id: I5e4351cbfb06bac76bd8b5ed5e83421b8f615524
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/317309
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

Change https://golang.org/cl/317429 mentions this issue: internal/postgres: delete Legacy functions

@gopherbot
Copy link

Change https://golang.org/cl/317489 mentions this issue: internal/frontend: support displaying multiple of same type

@gopherbot
Copy link

Change https://golang.org/cl/317490 mentions this issue: internal/symbol: delete LegacyIntroducedHistory

gopherbot pushed a commit to golang/pkgsite that referenced this issue May 6, 2021
For golang/go#37102

Change-Id: Icda2856dd6af29267affd075a95974a3c65c0adc
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/317429
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 May 6, 2021
For golang/go#37102

Change-Id: Ie3554874b515abda558fb58cbd5f28b814476ac8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/317490
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 May 6, 2021
Previously on the versions page, we were not handling the case when
different identifiers are added for the same type for different build
contexts, and which build context was surfaced was based on chance.

To support this case, it is now possible to show multiple of the same
type at the same version. For example,
https://pkg.go.dev/internal/poll?tab=versions at go1.10 will show:

```
type FD — windows/amd64
+ func (fd *FD) ReadMsg(p []byte, oob []byte) (int, int, int, syscall.Sockaddr, error)
+ func (fd *FD) WriteMsg(p []byte, oob []byte, sa syscall.Sockaddr) (int, int, error)

type FD — darwin/amd64, linux/amd64
+ func (fd *FD) SetBlocking() error
+ func (fd *FD) WriteOnce(p []byte) (int, error)
```

For golang/go#37102

Change-Id: I19e6ef12f1f8f9c412aab7cea2782409eecf29f9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/317489
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

Change https://golang.org/cl/333379 mentions this issue: internal/frontend: do not show symbol history for commands

gopherbot pushed a commit to golang/pkgsite that referenced this issue Jul 19, 2021
Since symbols don't appear in documentation for commands, also don't
show its symbol history.

For golang/go#37102

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

Change https://golang.org/cl/338450 mentions this issue: internal: delete ReadSymbolHistory experiment

gopherbot pushed a commit to golang/pkgsite that referenced this issue Jul 30, 2021
The ReadSymbolHistory is deleted, since the symbol_history table
has been fully populated. When either ExperimentSymbolHistoryMainPage
or ExperimentSymbolHistoryVersionsPage is active, data is now
always read from symbol_history instead of a JOIN on
package_symbols and documentation_symbols.

For golang/go#37102

Change-Id: I8ca0aece399217b804a9a6c55bbfec5efe5b3a18
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/338450
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/339490 mentions this issue: tests/api,internal/frontend: add compare script

@gopherbot
Copy link

Change https://golang.org/cl/339492 mentions this issue: tests/api: add compareAll option

@gopherbot
Copy link

Change https://golang.org/cl/339452 mentions this issue: tests/api,internal/symbol: add generate script

@gopherbot
Copy link

Change https://golang.org/cl/339395 mentions this issue: devtools,tests/api: add set up with docker

gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 5, 2021
A script is add which generates the API for a package from its source
code, and writes this data to tests/api/testdata. The script is largely
adapted from cmd/api/goapi.go.

The resulting testdata will be used in following CLs to compare against
the symbol history data on the frontend.

For golang/go#37102

Change-Id: Iae3d9b6f55de94bdd81821f374aaf53276f306b9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/339452
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 Aug 5, 2021
The tests/api/main.go script is updated to compare the frontend symbol
history data with data in tests/api/testdata.

For golang/go#37102

Change-Id: I5eb5fc367343ce386c7a2d2d7a53c0d3fad9da4f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/339490
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 Aug 5, 2021
A -all flag is added to the compare script, which compares all of the
package data in tests/api/testdata.

For golang/go#37102

Change-Id: If10f0896fb3eb30e5cb4eb37da59f904062bcce1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/339492
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 Aug 5, 2021
tests/api/run.sh is added, which runs the symbol history comparison
script in docker.

For golang/go#37102

Change-Id: I11d7f3a61277d6756308f854a78504c3b63ac4fd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/339395
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 Aug 5, 2021
parseRow is updated to support package paths with hyphens.

For golang/go#37102

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

Change https://golang.org/cl/340090 mentions this issue: internal/symbol: support package paths with hyphens

@gopherbot
Copy link

Change https://golang.org/cl/340091 mentions this issue: internal/symbol: retry on go list error

gopherbot pushed a commit to golang/pkgsite that referenced this issue Aug 6, 2021
go list sometimes "go: downloading...", when a module is not in the GOMODCACHE.

This will cause Decode to return the error:
"invalid character 'g' looking for beginning of value", which can fixed by rerunning the script.

Instead, just re-run go list when we see that message in the error.

For golang/go#37102

Change-Id: Ic864a4d475eeb594afa7fda90a7b63d073bae898
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/340091
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>
@julieqiu
Copy link
Member

julieqiu commented Aug 11, 2021

This feature is now live for all packages on pkg.go.dev!

As an example, see https://pkg.go.dev/rsc.io/quote#Go:

Screen Shot 2021-08-11 at 2 50 58 PM

And https://pkg.go.dev/rsc.io/quote?tab=versions:

Screen Shot 2021-08-11 at 2 51 11 PM

If you come across any bugs, please file an issue.

@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite
Projects
None yet
Development

No branches or pull requests

7 participants