We weren't reporting on NotFound, but the right code is NotFetched,
since that is what is returned when proxy fetch is disabled.
Change-Id: I554d5186fb4db0346fb9456fe9fc55091066abda
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320751
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>
Deadlock is rare but we have observed it when multiple versions of the
same module are inserted concurrently.
Change-Id: Idd28bd558009ff053ac198bdd310fa780af66f83
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320750
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>
Increase the maximum number of imports we allow a package to have.
The value was initially 1000, arbitrarily. But there is at least
one package (github.com/mgruener/iso20022tpl/internal/iso20022)
that exceeds the limit.
Change-Id: Ie9c7e449179ae2caad872a494a59fa49484b316a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320749
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>
This change makes removing the title header from the
markdown TOC configurable. For the styleguide we need
to preserve document titles.
Change-Id: If43a1171f44637c98c15330ff1900c4f305511c2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320653
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
The styleguide demonstrates usage of reusable components and
styles on pkg.go.dev.
Change-Id: I7aeb94a9bdc8b7fe12cc2832f8de0be0895ebd97
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320651
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Marked is used to parse markdown files in the JS tests
for the styleguide components.
Change-Id: I9b883b10a5f590977eb2c7f88ca019e1b1b20ed9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320571
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Importing a standard set of icons from the Google Material UI
and splitting image folders by domain for better ease of use
and discovery. A future CL implements a styleguide that relies
on this directory structure to generate sections within the guide.
Change-Id: Ibc08ff5a092d1d119a85fe7c4e44e8faeafe1512
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320570
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
New versions of gcloud.dev and github.com/creack/pty
changed the latest badge to the go to latest badge.
Change-Id: I19e7b24a2198990259fc74026f032d2d1af57aa0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320410
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
It doesn't make a lot of sense to group symbol searches by module, so
don't group these results.
Change-Id: I804382b0dba6871696f328f1fea96cd1f81f11f1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319629
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
An initial version of symbol search is added. This runs separately from
regular search and is not connected to the frontend yet.
For golang/go#44142
Change-Id: I34a21a4a743a07dcfcdfeb64b52a86bc2254f62a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/318870
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>
Data is now inserted into symbol_search_documents.
For golang/go#44142
Change-Id: Icf00cd7c5e57a91465673d1828f961334abc3a48
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/318652
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>
Removes the logic to start headless chrome
in favor of using an externally started
instance.
Change-Id: I86fc81cbfbe7361ecb27e486b73907b37d6c3fd6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319970
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Increase the postgres statement timeout for the session
to 30 minutes from 10 minutes.
Change-Id: Ibbe6764cb50b986aabe94cd53240fe00bb1d8705
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320209
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>
The documentation overview TOC style is updated such that it is slightly
indented, to appear more like a TOC and only split into 2 columns if
there are 5+ items.
Change-Id: I04916c4e20eb505861b02e0b321eea787b57abe6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319151
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
I altered the logic that generates test names to
make them more readable and to make them static
so we can add test retries if it becomes necessary
in the future.
Change-Id: I1226c218015518768ddeaeea4117876060910373
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319972
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
- Drys up e2e test logic and adds additional
tests to mirror the compare pages set.
- Pins some unit page urls to specific versions
to reduce the frequency of updates.
- Parallelizes mobile and desktop tests to improve
performance. In my experience, overall test run takes
on average one minute.
Change-Id: I04ebd109bf2f82c2a570757fe9c124f87c092147
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319971
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
In a CL to follow the test setup will be
refactored making the current snapshots obsolete.
Change-Id: Ib4d42a757496dd951374e9cbed56d5bb6d8b14a7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319973
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
getPackageSymbols is refactored using squirrel, so that it can be
modified for us in other similar queries.
For golang/go#44142
Change-Id: I974c51155d30c59cf61ded0386c5d3b2702188c5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/318651
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>
A table is added to contain information for searching for symbols.
Build contexts are added as a text array instead of as individual rows,
since the only use case for that information is linking users to the
correct URL if the symbol is not present in the default build context.
For golang/go#44142
Change-Id: I759b22e0ced7fec547778aba11a1b5f641530fb8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/318650
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Don't delete old rows from the documentation table.
Change-Id: Idd2e7d5fc02887f0fdcea4c2297b4bd499bd8ad4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319909
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Interactive playgrounds have been live for a while, so legacyExampleTmpl
and EnableInteractivePlayground is removed.
Change-Id: I09c03162cfc7fb52a74f21e08ff9b4ef83f4e8c5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319149
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>
The down migration INDEX idx_symbol_history_sort_version is fixed to
correctly refer to idx_symbol_history_sort_version.
Change-Id: I1c4fff26223326bd9c3f958b9a23adbafffa4cc7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/318649
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>
The search_documents columns package_path_id and module_path_id are now
populated.
For golang/go#44142
Change-Id: I1833bfc821f3a3ebe5b71a562e616d0c6b2dc20a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/318490
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>
UnitSymbol now only contains a map of build contexts that apply to a
symbol meta, so it is renamed to SymbolBuildContexts.
Change-Id: I2a0360aa06c7269fdcb5eb72cb5253cf737a23f3
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319271
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>
UnitSymbol.SymbolMeta is deleted since it is not necessary.
Change-Id: I6965b45fad04dfff564e2af47c8504de475afe21
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319270
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>
git.pirl.io/community/pirl no longer exists, so running
`go test -run TestModuleInfo -record` will always return a 500 for that
path.
In order to update internal/source/testdata/TestModuleInfo.replay for
future tests, this test is deleted.
Change-Id: I8978bb8a725959896c1897e4178a5b8d6f4f51c2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/318969
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>
If a path is stored in the version_map table as a 404, allow the path
to be refetched once the taskIDChangeInterval has passed since the
path was last updated.
Fixesgolang/go#46117
Change-Id: I985f8c095d4c6af1e092cc686322023cc0abd3b6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319050
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
When a module is added for the first time using InsertIndexVersions,
set the status to 0, even if the module already exists in
module_version_states. That way we will prioritize reprocessing this
module, in case its previous status was a non-2xx code.
For golang/go#46117
Change-Id: Ie2c01a84449a0bb2e446a0c1388b315b580d3b12
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/319049
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
The good latest version of a module should never be later than the
cooked latest version. If it is, then pkgsite will show a different
version than the go command will download.
One way this can happen is if a module retracts all tagged versions,
and pseudo-versions were built on top of some of them. For example,
initially it could have versions
v0.1.0
v0.1.0-DATE-HASH (a pseudo-version)
Then v0.1.0 is retracted and a new pseudo-version appears at
head:
v0.1.0 (retracted)
v0.1.0-DATE-HASH
v0.0.0-DATE-HASH (head of default branch)
The go command will get the v0.0.0 version, but technically
the v0.1.0 is later.
For golang/go#43265
Change-Id: I8ff30de4eb2dcdf108205de99af93d2f31772cff
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/318069
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
The e2e tests will only start headless chrome if
it has not already been started. The port for headless
chrome can now be set with an env variable.
Change-Id: I416527901b4401ff85af65922ae7b21a6b8c717e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/318890
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
The bottom border of the last search result
was removed.
Change-Id: I177900cc8f1880f2086b6966b223d68d3d22ab00
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/318510
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
Adds styles to hide blinking cursor in Jump to
modal to prevent flake in unit page test.
Change-Id: I2d78517c475aa9ce25ab935eeb1e88022b8fe7cb
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/318509
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Updates gtm categories for some elements
to lead to better groupings of events.
Change-Id: I8319910afe420470d1f188d9996a34b0b365a26b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/318449
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
When enqueing modules for processing that we haven't seen before,
prefer the ones that arrived earliest, as determined by their index
timestamp.
Besides being "fair," this will satisfy the assumption of the Worker
Processing Lag metric, making that metric more useful.
We don't change the ordering of modules that are being reprocessed.
The arrival order no longer matters at that point, and we want to keep
the pseudo-random ordering provided by the md5 hash to avoid runs of
versions of the same (potentially large) module from gumming up the
workers.
Change-Id: I3c422eda576931110d4dbcd1db9f7199fde67e6f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/317890
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>
All of these changes are under the "search-grouping" experiment.
- Heading is package name instead of import path.
- Version next to package name.
- Import path shown above name, de-emphasized.
- Replace vertical info label dividers with space.
- Remove bold from info labels, add bold to import count.
Change-Id: I3571570a2046a69c0df92617a35269b8d30d16ec
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/317749
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
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>
The derrors package was changed recently, so the snapshots need to be
updated.
Change-Id: I32b14b9f9bb127af0b5489198a4c9c0cf2331be2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/317193
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>