postgres.GetPackageSymbol and symbol.IntroducedHistory are factored into
a single GetSymbolHistory function, in preparation for optimizing this
logic.
For golang/go#37102
Change-Id: I04f726ae6f9731ee2e099b47e414aeaef90d5779
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/312049
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
The Package.Render method is only used on the worker to get the
synopsis and other doc-related information. Ever since we started
rendering doc on the frontend, the worker has ignored the rendered
documentation.
So stop rendering the doc, and rename the method to DocInfo to reflect
that.
One minor consequence is that we no longer flag packages with
excessively large doc as having a bad status. As far as the worker is
concerned, they are fine; the error will manifest on the frontend (and
we will serve a "documentation too large" page). This is all good: we
only used a distinct status in this case so we could reprocess if our
limits changed, but these modules no longer need reprocessing.
For golang/go#40850
Change-Id: I3c7c49f0beb7a6d8a37daabdce75f83ef108eddb
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/312270
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>
Reviewed-by: Julie Qiu <julie@golang.org>
Code in motion.
The file names for the snapshots were long and
repeated a lot of words. Simpler test layouts
and a standardized naming convention will make
the snapshots easier to identify and the tests more
consistent across files.
A test's filename already contains the name of the
page referenced in the enclosed tests. The snapshot
filenames are test filename concatenated with the
describe and test block names they appear within.
Having the outer describe block is redundant for tests
like homepage.ts.
Similar tests that diverge between mobile and
desktop have the suffix (mobile) and (desktop).
Tests runs can target test cases by regex. This
will make it easier to run tests for a specific
page layout.
Change-Id: I8dbd706cd017a07b8a35be9155d15ac8aab95fdd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/312090
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Adds snapshot tests for various features on the unit page.
- accessibility tree
- readme expand and collapse
- directories expand and collapse
- jump to without identifiers
- jump to identifier
- documentation outline
Change-Id: I491b6305fb09923ed65db4db87622e9452a06420
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/311970
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
middleware.ElapsedStat wasn't being called on GetVersionsForPath and
GetPackageSymbols, which is now fixed.
Change-Id: Ie6b9003eca509448a4bb2e5aa127ca1f32777ab5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/311929
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
All tests that affect the documentation table are updated so that
experiment do-not-insert-new-documentation is active.
Change-Id: I3672a7b18e50bc1cbe4820efe0e6e13ff9687596
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310811
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Trust: Julie Qiu <julie@golang.org>
Tests will break for this CL, because the tables have changed but tests
are still reading from new_documentation. Tests will pass once
CL 310313 has been merged, which should be merged at the same time as
this CL.
Change-Id: I260ef5b5812a6d7c081a3f3b67e1d4778c557920
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310376
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Now that interactive playgrounds have been rolled out
the legacy code can be removed.
Change-Id: I6bab20a24364ba996197ac4bc4553c779e4fab1d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/311849
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Added an event listener for any uncaught exceptions
and asserted in tests that no exceptions occur.
Change-Id: I719687e21135ccd0c1d6613a472084cd7bd9b84e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/311377
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>
Switching the Google logo png for the svg gives us
a 90% file size reduction. Removing lazy-load
attribute will lead to less flaky tests and is not
necessary now that we are using an svg logo.
Change-Id: Idb1a983dcb79d71f0e1cb6a55bd1e0f7734ac886
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/311470
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>
The unit page was updated to strip the protocol
from the repository url.
Change-Id: I6b2019211c51ec2373f9caa8393689081c7cb93a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/311374
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 the --rm flag to automatically clean up
docker containers after script runs. Removes
the -it flag for docker_nodejs as it causes
an error in CI.
Change-Id: If8cae56bc9dbe691ff216053e222b43e5591623a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/311373
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Jamal Carvalho <jamal@golang.org>
Using run_npm instead of npm directly in bash scripts.
This will default to local npm when available but use
docker-ized npm when the npm command is not found on
the host machine.
Change-Id: I08c0e69c5f18a29059eaf4787bc03d8eba99562b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/311349
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>
Refactors some tests to reuse page contexts. This
speeds up the overall test run by about 25%.
Change-Id: Id3e16d4b82c19119a1767788f4c9520e59c779af
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/311310
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Use BASE_URL to detect when a request should be
modified to include the authorization header.
This prevents an issue where BASE_URL might be
discovery.appspot.com instead of pkg.go.dev.
Change-Id: I508a041b631e6be593ae36bb8b3a36bbf6285bcd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310532
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>
Adds visual tests and test stubs for the unit page.
Change-Id: I1e7eb1df23390e4e54bf32ebde54ca15a7adfdfa
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310932
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>
The content on the search page varies too much to
have a stable test. Updates the spec to replace
variable content with constant values limiting
the test to layout and style checks only.
Change-Id: I107c925c99fbeeaf3325975420d32a23fd3b343b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310931
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
To accommodate a few licenses, we had a copy of the entire BSD.lre
file from licensecheck with two minor tweaks. This caused scanner
creation time to go from about 2 seconds to about 8 seconds.
The first of these tweaks is no longer applicable (I checked with the
entire contents of the prod DB).
The second arose from a single license, the LICENSE file in
github.com/ThePiachu/Golang-Koblitz-elliptic-curve-DSA-library, and
various forks and copies of it.
I made this license and minor variants its own LRE file and removed
BSD.lre.
We still accept the same licenses, and now scanner creation time is
back around 2 seconds.
Change-Id: Icc4af86744c5842ff03e4ca524943244f7b9b9a1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/311029
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
A new template function for stripping scheme from URL applied to repository
URL in the Details block.
Fixesgolang/go#40943
Change-Id: Ie767e90c3763e8792544b5df62ce79a5cf00374f
GitHub-Last-Rev: a2b0ca2c73
GitHub-Pull-Request: golang/pkgsite#26
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310229
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
The e2e tests will prefer a locally installed npm binary and
use a prebuilt headless chrome docker image. This will speed up
test runs for devs with npm installed but still leave the option
to opt out of installing node directly on the host machine.
Jest now uses a custom test environment that initializes global
variables, starts chrome, and adds authorization headers to
requests.
Change-Id: Ie43952ada6fd3e4df0fd522c84691186ef0d7f80
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310314
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
ExperimentDoNotInsertNewDocumentation is added to getDocIDsForPath, so
that we can deprecate new_documentation in a future CL.
Change-Id: I53b35d4e629974c70aec43ed0b4f124d46085dd6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310312
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>
We want to rename new_documentation to documentation, and drop the
current documentation table.
INSERTs into new_documentation are added as a first step.
Change-Id: I2f4038890436946b2c140c108faa4740e16abe4e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310375
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>
When redirecting from pkg.go.dev to beta.pkg.go.dev, a utm_source is
added to the URL. This is now removed in removeUTMSource.
Change-Id: Iae4f7cfe4c6356672a6a6916d182e9c68e342132
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310129
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 container for the mobile outline was part of
a template used in the dochtml package making it
difficult to extend from the frontend. Limiting
the dochtml sidenav-mobile template to the minimum
necessary html will allow us to add the readme
headings to the mobile outline. This change moves
the non-dochtml html to a new file to do just that.
For golang/go#43325
Change-Id: Ieef429034e7082215bd2cdb75bbf88f30683cf96
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310371
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>
The structure of the headings in the readme is now reflected
in the readme outline up to three levels of depth.
For golang/go#43325
Change-Id: Iee639fea299e93bfd5223dac3a50b663ce0ca89b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310131
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
The baseline for the identifier name and "add in <version" text are now
aligned.
Change-Id: I2995c8ab3942a8b333bdf7e9bc353d927460919d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310130
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
The Jump to modal does not contain any jump-able items
on pages without documentation symbols. We plan to explore
adding identifiers from the readme and directories sections
in future updates to the modal.
For golang/go#44718
Change-Id: I71ea5caf2aee1960dec41f89f86ce861f944242a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/309489
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
The processReadme function now returns a nested table
of contents extracted from the readme file based on
the hierarchy of headings in the document.
If the document has only a single top level heading
and that heading has children it is assumed to be a
title and removed from the table of contents.
For golang/go#43325
Change-Id: I5b67a7e356820477851e6c34493e2517f889b02f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/309393
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
In the new versions page, the deprecation badge is always shown. It is
now only shown when the module is actually deprecated.
Change-Id: I21bb99f553a9161ee02ad329e137d823cd08722b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/309829
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>