Граф коммитов

3379 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Amsterdam 876c3ba54c go.mod: upgrade pgx
Upgrade github.com/jackc/pgx/v4 to an as-yet-unreleased version that
includes a relevant bug fix (https://github.com/jackc/pgx/pull/975).

Change-Id: I946a94c9a145e2f94efeb0b98fea9ab7f939fb25
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/305449
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>
2021-03-29 18:09:28 +00:00
Lubomir I. Ivanov 403c5e6fe8 content/static/html/helpers: add anchors for section ids
Package pages are missing the paragraph symbol / anchor
for some items.

Add this symbol / anchor to allow linking to the tags
that have the "section-sourcefiles", "section-directories",
"section-readme", "section-documentation" ids.

Fixes golang/go#45210

Change-Id: I37538bcb30dbaa1cca335119775ff56b54c084fb
GitHub-Last-Rev: e058e6f11d
GitHub-Pull-Request: golang/pkgsite#24
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304649
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Julie Qiu <julie@golang.org>
2021-03-29 16:34:05 +00:00
Jonathan Amsterdam 9984e30f7e internal/postgres: include less in error message
The error messages from UpsertModuleVersionState included a large data structure.
Just include the module path and version.

Change-Id: I1e68f387c7cf2f3aacf959b443e738e6852fb02d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304929
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>
2021-03-25 20:58:44 +00:00
Julie Qiu 96346d2cc7 migrations: drop symbol_history table
The symbol_history table is no longer being used and is dropped.

Change-Id: Ib7b399869b7e46d37a727a3cea1c631ca218ab1f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304750
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>
2021-03-25 20:33:54 +00:00
Jonathan Amsterdam 233fac44be internal/queue: check for unknown module path
ScheduleFetch checks that it is not given "unknownModulePath".

Change-Id: Ie2ae0bde75ad10103b9ea8fb526aa7f09c285733
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304889
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-25 19:59:34 +00:00
Julie Qiu 101343b2dd internal/postgres: remove documentation delete
The documentation rows for a given module no longer need to be deleted.

Instead, we are planning to recreate the documentation table by
inserting into new_documentation.

Change-Id: Ia32957fb7947e793d8f8972091d16995d70db04a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304749
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>
2021-03-25 19:57:07 +00:00
Jonathan Amsterdam b80d4dd39a internal/database: add CopyUpsert
Add the CopyUpsert method, which uses an efficient
Postgres protocol to insert rows.

For this to work, we need the connection underlying a sql.Tx value.
Since sql.Tx doesn't expose its connection, we create one explicitly
in DB.transact.

Change-Id: Ie48ce7a4318f4531d4756f779943188a6f0fb6cd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304631
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>
2021-03-25 11:02:39 +00:00
Jonathan Amsterdam 030d6bd4c0 internal/database: wrap OpenCensus sql driver
The datbase/sql package provides a way to get at the underlying driver's
connection. We will need that feature to access pgx's fast CopyFrom
method.

Unfortunately, we do not use the pgx driver directly. Instead, we wrap
it in an OpenCensus driver for tracing and metrics. And that
OpenCensus driver's connection does not allow us to dig into _it_ to
retrieve the pgx connection that it wraps.

Hence this dance: we must write our own driver and connection
implementations.  The driver return the connection, and the connection
holds both the underlying (pgx) connection and the OpenCensus
connection, to which it delegates.

This CL is a no-op; everything behaves as before. But it lays the
groundwork for a subsequent CL that will use pgx's CopyFrom.

Change-Id: I5bf308aa23f07f20d1f6410ebb04cd6b9a5e0922
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304630
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>
2021-03-25 11:02:03 +00:00
Jonathan Amsterdam 3f0673e901 internal/database: fix benchmark
Drop the table only if it exists.

Change-Id: Id2d772fade7ab2624c6a155d0985f09284c734e4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304629
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2021-03-25 11:01:33 +00:00
Jamal Carvalho eaf8a10d50 e2e: add basic tests for additional pages
Adds e2e tests for additonal routes on pkgsite.
Tests are all made suitable to be run against the
staging environment.

Change-Id: Ia549e487490eb0bd47049ba306143db45905726a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304590
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>
2021-03-25 04:14:35 +00:00
Jamal Carvalho 2577ce4663 devtools,e2e: use a single browser instance for e2e tests
Each e2e test file was starting and closing its
own instance of Chrome. To speed up the tests
we are now sharing a single instance of across
test files and properly exiting after the tests
have completed.

Change-Id: Ia7ad4acaf961cf89a177e293e971c94b43b76d05
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304589
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>
2021-03-25 04:10:40 +00:00
Jamal Carvalho 28de4e97f3 internal: update page check and server tests
Fixes pagecheck for the recently rolled out
sticky header and enables the sticky header
experiment in the server tests.

Change-Id: I140bc22ed2c37304883d177228b59bda5c65441f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304511
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2021-03-24 21:38:43 +00:00
Jamal Carvalho 559e9db775 content/static: add test id to unit header title
Change-Id: I9bc8b3bd9a04aedb3ab3330a8ea66b6544eddfb6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304510
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2021-03-24 21:38:26 +00:00
Jamal Carvalho 4e9e4e94bc content/static: scroll to top on header double click
Adds a feature to scroll the page to the top when any
whitespace on the header is double clicked. Useful as
an alternative to the home key for quickly going back
to the top of the page.

Change-Id: Ibd59e4aeb18850f672dd1628b18b2071c8c3cbf2
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304270
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-03-24 18:21:15 +00:00
Jamal Carvalho c06d85d27e content/static: fix breakpoints in the sticky header
Fixes breakpoints for the detail items
in the transition from full height to sticky
for mobile size viewports.

Change-Id: I90ec4bea0403a6efc79957bb7429d103c1386093
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304269
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>
2021-03-24 18:20:22 +00:00
Jonathan Amsterdam c164d91528 internal/frontend: improve importers count display
On the imported-by tab, incorporate both the number of importers we
actually display and the number we get for search into a single
phrase.

Change-Id: Ia9b84cbc20d01dfd253455e2d391fe4c9d0cd0d3
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303789
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-03-24 17:58:25 +00:00
Julie Qiu c7657e622c internal/postgres: sort symbols to prevent deadlocks
Before inserting into symbols, package_symbols and documentation_symbols,
sort to prevent deadlocks.

For golang/go#37102

Change-Id: Ibcf5e6bc9f30320499ea0ea28db4a67f3a67d4e8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304509
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>
2021-03-24 17:54:40 +00:00
Jonathan Amsterdam 9407fc7d39 internal/worker: check modulePath arg to FetchAndUpdateState
Check that the module path is not internal.UnknownModulePath.

Change-Id: I3a204f27a1d82becec8fbdb95290ccc00b308ccb
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304389
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>
2021-03-24 16:44:12 +00:00
Julie Qiu 4500feebb3 cmd/internal/testing/stdlibsymbol: fix build error
The type for frontend.Symbol has changed since tests passed for
CL 300173, which caused build errors that are fixed.

Change-Id: I71264a14dddaf9ef7a417091db9455bd9b9455ee
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/304089
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>
2021-03-23 18:43:30 +00:00
Julie Qiu 6932bddeab cmd/internal/testing/stdlibsymbol: add stdlib versions page test
A script is added which tests the output of the stdlib versions page
with data from the api/goN.txt files.

For golang/go#37102

Change-Id: Ie3e5388f502e2d11fc0388ee64f27493978d97a6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/300173
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>
2021-03-23 18:10:33 +00:00
Jonathan Amsterdam 2a054455ff internal/frontend: rewrite img links to GitHub blobs
GitHub will translate a .../blob/... URL in a README to the
corresponding .../raw/... URL. We need to do the same.

Fixes golang/go#45168

Change-Id: Ib5b9a2c33d2b3da324f16f55790ee7b228f39d7f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303790
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>
2021-03-23 17:42:50 +00:00
Julie Qiu a71032c7d6 internal/frontend: do not redirect on unseen paths
When a request is made to a path that we haven't seen before, we should
always return a 404 with the option to fetch that path. A bug is fixed
which previously redirected unknown versions of a path to the most
recent version.

Fixes golang/go#45107

Change-Id: Ic5180d2e40790eadbc07434cc0ffe25179b35194
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303771
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>
2021-03-23 17:28:11 +00:00
Jamal Carvalho 62f2d74c6e write js files as a step in all.bash
When the frontend server is run in dev mode it
builds the JavaScript out files unminified which can
leave behind unstaged files with unwanted changes.
Currently, all.bash checks that the minified
JavaScript files match the output from compiling
the TypeScript files. This change updates the script
to write the files on run to clean up the content/js
folder after running the frontend in dev mode.

Change-Id: I6bed05613bae97430fc6c8a47a611eb673d1fb43
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303770
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>
2021-03-22 22:43:22 +00:00
Jamal Carvalho 6d7d2e59a5 content,internal: readme outline fixes
Heading nodes that contained only non-text content
would show as whitespace in the outline. This change
updates the outline generation logic to use text
extracted from non-text nodes when a heading contains
no plaintext.

A first pass through nodes in a heading looks for text
and writes found text to a buffer. If the buffer is
empty after the second pass, other nodes are used to
generate the heading label text.

Text breaking needed for documentation causes issues with
text in tables in the readme. Moved the word break styles
to the UnitDoc class.

For golang/go#45164

Change-Id: I0fa005d43c605f972d669966c80369c4fdaea85d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303749
Trust: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-22 20:28:10 +00:00
Jonathan Amsterdam 1cd3d47301 content/static/html/helpers: remove not-at-latest check
The experiment was removed from the codebase, but checks in the
templates were not.

Change-Id: I993b96f77fba0cd4dbda97390c7bff9f8adac649
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303709
Trust: Julie Qiu <julie@golang.org>
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-22 19:34:19 +00:00
Julie Qiu a3e1bfccb3 migrations: drop unused documentation columns
There are several unused columns on the documentation table which are
now dropped.

The documentation table will be replaced by the new_documentation table
after reprocessing, but for now dropping the trigger on id and id_bigint
should make inserts/updates faster for reprocessing.

Change-Id: I137b7fc7a3d6a9c576a0d65da1581ac5efb7f34f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303450
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>
2021-03-22 19:24:23 +00:00
Julie Qiu 218b58c1e9 internal/postgres: change reference to documentation
References to the documentation table in GetPackageSymbols and
getUnitSymbols are changed to new_documentation.

Change-Id: I25adef39f1fcb038fd1b05bb08de8ba75df84d62
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303689
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>
2021-03-22 19:23:58 +00:00
Julie Qiu df6bf7d4a4 migrations: add documentation indexes
Indexes are added to new_documentation and documentation_symbols for
columns that are frequently accessed with a WHERE clause.

Change-Id: I8be193b039d8d519492e284b0b7dd29a2fb5532a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303449
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>
2021-03-22 18:55:08 +00:00
Jonathan Amsterdam 0cbd65a06c internal/worker: call ReInsertLatestVersion
After processing a module, call ReInsertLatestVersion.

Skip the call if this is the cooked latest version of an alternative
path. The same check is made inside ReInsertLatestVersion, but using
the module_version_states table, and the module being processed has
not yet been inserted into that table.

For golang/go#44710

Change-Id: Icd0d0c0045ccadf3e97d32c63146262a3b442577
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303649
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2021-03-22 17:54:59 +00:00
Jonathan Amsterdam d3c0706885 internal/postgres: add imports_unique to ReInsertLatestVersion
The ReInsertLatestVersion method now changes imports_unique as well as
search_documents.

For golang/go#44710

Change-Id: Ie5dcfe8e362313be76f0ad4958882e37fc725e44
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303313
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-03-22 15:45:56 +00:00
Jonathan Amsterdam 7d0f1a13d0 internal/source: handle blitiri.com.ar import paths
The source for these import paths is served by the git-arr web
viewer, which doesn't yet handle tags. Until it does, serve
the source from master.

For golang/go#44607

Change-Id: I94047a887ea6f1038ae812864ad343876b74ff8e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303609
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>
2021-03-22 15:43:39 +00:00
Jonathan Amsterdam 8be65e0688 internal/postgres: add ReInsertLatestVersion
New latest-version info can retract the current latest good version,
resulting in an older version becoming the new latest good version.

Add a function that updates the search_documents table when
that happens.

A later CL will also update imports_unique, and will call this
function from the worker.

For golang/go#44710

Change-Id: I09569e27d384ed7defb06a4e81facdb96c22caeb
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303312
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>
2021-03-22 15:40:40 +00:00
Jamal Carvalho 2fd373d266 content/static: consolidate header into single component
Maintaining two separate header components is cumbersome and
the fixed header requires accessibility hacks to remove it
from the accessibility tree. We can use the sticky position
css attribute with some simple transitions to achieve the
same effect. This change will simplify header maintenance
and create a more unified experience for mouse and keyboard users.

Fixes golang/go#45132
Fixes golang/go#44909
Fixes golang/go#42817

Change-Id: Icbfa4efc3de09c534b7823c57e2e481711eac31b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303412
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>
2021-03-19 20:31:59 +00:00
Julie Qiu be1e890ad1 internal/postgres: insert into new_documentation
Data is now inserted into the new_documentation table, which will
replace the documentation table once reprocessing is done. The
documentation_id rows for documentation_symbols now reference
new_documentation.

Tests for symbols which were deleted in CL 303116 are added back.

TestFrontendMainPage/main_page_hello_-_multi_GOOS_JS_page is flaky and
will be added back in a future CL.

Change-Id: I8d7aed2092b3d19c45c14be5f9a0986dfe224aeb
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303115
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-03-19 20:20:48 +00:00
Julie Qiu c5b023c085 migrations: add new documentation table and change some PKs
TABLE new_documentation is created, which will replace the documentation
table after reprocessing. new_documentation has the following schema changes:

- id is a BIGINT instead of INTEGER
- goos and goarch are ENUMs
- zip column is dropped, since it is not being used

documentation_symbols is updated with a FK to new_documentation. The
id column is dropped, and id_bigint is renamed to id.

The id column on package_symbols is also dropped and id_bigint is
renamed to id.

Change-Id: I916ed7edd38647cd75f95f05f1fc7ea5b5c8980d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303113
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-03-19 20:20:31 +00:00
Jamal Carvalho d1f5b90c73 internal: create sticky-header experiment
Change-Id: Iaf9b56b1a9663c59605bb624c03a1d4aaa5ffed4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303410
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-03-19 20:17:14 +00:00
Jonathan Amsterdam 02c6e8466a internal/postgres: update latest good when it is retracted
Previously, UpdateLatestModuleVersions only changed the raw and cooked
versions, leaving the good version to InsertModule. Now it updates the
good version when the current good version is retracted, which
otherwise would not happen.

For golang/go#44710

Change-Id: I90d771310dbfb56ae02255e0abc3afddcce7b34c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303311
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>
2021-03-19 20:16:42 +00:00
Jamal Carvalho 0e33e5967a content/static: copy unit header static
Copies unit header html and styles into
legacy files in anticipation of updates
to the header.

Change-Id: I5921537da5f1e94a9c3bc30a2b279a9e6b5bf975
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303411
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>
2021-03-19 20:11:29 +00:00
Jamal Carvalho 805371e96b content/static,e2e: update frontend fetch test
Switches frontend fetch test to a smaller
module to speed up the test.

Change-Id: Iac74d1f7078fe725fd24a1451ae5251899890fc3
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303409
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>
2021-03-19 20:11:18 +00:00
Jamal Carvalho 1774609b1c e2e: remove page global
Reusing the same page between tests cases
can lead to unexpected results when things
like scroll position are not reset. Removing
the global in favor of local page objects
that can be shared when convenient or reset
between tests.

Change-Id: I9e5b851d58a393fb3553ff281b8addbcb7044f81
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303114
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-03-19 19:11:29 +00:00
Jonathan Amsterdam 7eca3b55e9 internal/postgres: reimplement alternative-module check
When inserting a module, we skip inserting into search_documents if
the module path is an alternative one.

This CL factors out that test, and also reimplements it in terms of
the latest cooked version.  Previously, any later version with a 491
status would classify the path as alternative, but this version uses
the latest cooked (non-retracted) version's status to decide, allowing
module authors to fix mistakes.

Change-Id: I3588f3df6a1a4dd4db59333314c34167eda51df1

For golang/go#44710

Change-Id: I670d9085800fed198e6dd6469f1a8d5728c5f039
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303309
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-03-19 17:57:51 +00:00
Julie Qiu 50e768a51c internal: delete symbols tests
Tests for symbols are temporarily deleted so that tests pass when we
change around primary keys.

Change-Id: I3afaf84ad76bbc75bfe37ef7c16b4dc60e3abbc1
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303116
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>
2021-03-19 16:42:12 +00:00
Jonathan Amsterdam a3acbfb02d internal/frontend: use common function for major version
Define a function to get the major version from a module path in a
clean way, and use it.

For golang/go#45098

Change-Id: I0a5053a763cf93dbd076ca4e0adc68d9c1bfb7f0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/302951
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>
2021-03-19 15:58:59 +00:00
Jamal Carvalho 2bc2ba4e81 e2e: add snapshot test for fixed header
Change-Id: Ib7454175d68bd382709603575b089de8dc055fa9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303112
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>
2021-03-19 15:32:51 +00:00
Jonathan Amsterdam c7bd94d404 internal/frontend: make imported-by tab count match list
The number shown in the imported-by tab should match the number of
packages actually displayed.

That might contradict the search result number, but at least it is
consistent with what is on the same page.

For golang/go#44965

Change-Id: I8f2e3caff4a440038f41d9bf8b3710ecd21d42d9
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/302949
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>
2021-03-19 14:53:33 +00:00
Julie Qiu d6528aa26b content/static/css: update blue hex value
The hex value for var(--blue) is updated based on the new UXD style
guide. This color is currently only used for highlighting anchor tags.

UnitDirectories-moduleTag is deleted since this class is not used
anywhere.

Change-Id: I70e4544f9b3d1be44c231678e63357a6ff8a2825
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/302672
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>
2021-03-18 22:25:22 +00:00
Jonathan Amsterdam 6872f0ff14 internal/licenses: accept Python-2.0
For golang/go#45095

Change-Id: Iea030936f382535ec82b64f40fe4b4effc2f5d8f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303129
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
2021-03-18 20:51:07 +00:00
Julie Qiu 0bfbd362c1 content: remove Versions-minor class
The Versions-minor class is currently unused and is removed.

The class will be added back in a future CL when this element is styled.

Change-Id: I2b51b2dc36386cbdec6a6e219ba2976e3ad9ef09
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/303109
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>
2021-03-18 20:33:34 +00:00
Jonathan Amsterdam bd41dbe2ec internal/postgres: ignore untagged versions for latest major
When finding the latest major version of a unit, do not
consider untagged (that is, pseudo) versions.

For golang/go#45098

Change-Id: Ic38480f68edbe2a3db189bc3055ae75b3d5df72b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/302950
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>
2021-03-18 18:48:59 +00:00
Julie Qiu c861539528 migrations: add documentation bigint
The rate of growth for the documentation table suggests that the id
column might hit the INTEGER limit as the size of our database grows. We
change this to a BIGINT column now, since its easier to make this change
before this table is used in prod.

The update_documentation_id is changed to update both documentation.id
and documentation.id_bigint with the same value on INSERT or UPDATE.

Change-Id: Id310ed548c2fa3769fbd2707cea4f69295434f2f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/302671
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-03-17 21:07:08 +00:00