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

46 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Amsterdam acdeec62f9 worker: display request state on main page
Add a RequestInfo.State field to record the current state of a request
for display.

Add a function internal.RequestState to for updating the state,
and use it for long-running requests.

Display the state on the worker main page.

Change-Id: I1a04036982aba23cf27776fac75248972a1336f3
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/568515
Reviewed-by: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
kokoro-CI: kokoro <noreply+kokoro@google.com>
2024-03-05 19:44:05 +00:00
Hana (Hyang-Ah) Kim 694b5d3c2a all: convert interface{} to any
Change-Id: I1f3b7cc8899c7707abb01e3d14807c37c3451382
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/449695
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
2022-11-15 20:10:34 +00:00
Jonathan Amsterdam 2beb68e7d8 internal/database: use generics for Collect functions
Reimplement some reflection-based collection functions to
use generics.

In some cases we still need reflection, but at least we
can provide a type-safe wrapper with generics.

Change-Id: Id95949a7a22ee687166ecdfc1191150d79568889
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/389657
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>
2022-03-07 15:51:22 +00:00
Julie Qiu 0d3582b07d internal: delete stale symbol_search_documents
When the latest version of a module is inserted, delete
symbol_search_documents rows for symbols not in that version of the
package, so that stale rows are removed.

For golang/go#44142

Change-Id: I9a5c45eff4713cb765fd15b57530bf139385a3a8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/349892
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-09-20 20:09:31 +00:00
Julie Qiu 9525a3f3f6 internal/postgres: delete update in upsertSymbolNamesReturningIDs
This update is no longer necessary.

Change-Id: I208047e7d194142d227bb0d43e482574dc4279a8
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/349611
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-09-13 20:19:31 +00:00
Julie Qiu 7fe00f130e internal: remove experiment insert-symbol-search-documents
This experiment is live in all environments and can be removed.

For golang/go#44142

Change-Id: Ie653e833b8fc04d5a538fab41137ca77a0989125
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/341451
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-08-11 18:54:31 +00:00
Julie Qiu f890bb079c internal/postgres: change experiment for documentation_symbols upsert
Data is now inserted into documentation_symbols if the
insert-symbol-search-documents experiment is on, as opposed to if
skip-insert-symbols is off.

This table is needed for the symbol search design, but it's unnecessary
to insert into that table unless we are also inserting into symbol
search documents.

The experiment is added to various symbol history tests, since it uses
data from that table as a check against data in the symbol_history
table.

For golang/go#44142

Change-Id: I24f1689a9456e555274bf1c6725e917a8e9a8d45
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/335266
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-07-19 18:49:56 +00:00
Julie Qiu 9fbbd13ed6 internal/postgres: trigger set_tsv_name_tokens
We don't re-insert rows to symbol_names in insertSymbols, since there's
no reason to do so, but tsv_name_tokens is populated by an ON INSERT OR
UPDATE trigger.

In order to make the trigger activate, set name=name when a symbol_name
is not inserted.

For golang/go#44142

Change-Id: I5eac5075727fd2db80c1a0ff7d66fa4df44c5c54
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/335394
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-07-19 18:48:26 +00:00
Julie Qiu 9e8940ac46 internal/postgres: move getUnitSymbols to test file
This code is only used in tests.

For golang/go#44142

Change-Id: Ice0479b439b64c3dd3c2556401cd1dc533d75924
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/330131
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-07-13 16:21:56 +00:00
Julie Qiu 309ad62896 internal/postgres: move symbol search logic to symbolsearch.go
Pure code in motion.

For golang/go#44142

Change-Id: Idb54fbc9a62138897d818c171f95f34471272cc5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/329923
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-06-22 17:05:39 +00:00
Julie Qiu de3c212715 internal/postgres: change logic for upsertSearchDocumentSymbols
upsertSearchDocumentSymbols is changed based on the new schema.

For golang/go#44142

Change-Id: I1857b04cceeb9b702e4c54fc3a8d39efa811a3ce
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/329493
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-06-21 17:39:06 +00:00
Julie Qiu fc9b57af4c internal/postgres: move insertSymbols to saveModule
Logic for insertSymbols is moved out of insertUnits to saveModule. This
will allows us to run that code after the check for isLatest, which is
necessary to insert symbols where the latest unit is not a
release version.

For golang/go#44142

Change-Id: Id917b6b74020957549ad1c6594f21d3f8d27e464
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/329349
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-06-21 17:30:40 +00:00
Jonathan Amsterdam 28e226e533 internal/postgres: only skip documentation_symbols
When skip-insert-symbols is on, skip only the documentation_symbols
table, not the others.

Change-Id: Ia1f6bf975f02a2cc5aad15cd220b8a6c54585e97
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/324790
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
2021-06-03 17:23:30 +00:00
Julie Qiu 08539edb45 internal/postgres: fix deadlock in upsertPackageSymbolsReturningIDs
Symbols are now sorted in upsertPackageSymbolsReturningIDs to prevent
deadlocks.

Change-Id: I2be1e23c89b953b7fbc6dc9099462b44302a6502
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320709
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-05-18 22:54:04 +00:00
Julie Qiu c9ae5b7556 internal/postgres: upsert documentation_symbols
Data is now upserted into documentation_symbols, to fix a bug where the
package symbol ID in the database did not match that of the one that was
going to be inserted.

This was due to changes made to the package_symbols table in CL 315309
and CL 315310.

Change-Id: I1d26132a55339d1b747d8c2fb5dfa1cb0b153558
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320689
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-05-18 22:53:56 +00:00
Julie Qiu 6061a5df41 internal: delete ExperimentInsertSymbolHistory
Change-Id: I801cf927c9500589f6460927aaf6c9cb61b98207
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/320450
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-05-17 18:02:11 +00:00
Julie Qiu a6a5d894a0 internal/postgres: fix upsertPackageSymbolsReturningIDs
Inserting a package symbol with the same name but different parent name
than an existing row in the database previously resulted in a 500 which
is fixed.

Change-Id: Ia9c4f25a8bdf2aca87f0d736595778ba2baa62ad
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/316909
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-05-04 19:09:39 +00:00
Julie Qiu d61744311c internal: change Symbol.Children to SymbolMeta
The children of a symbol will always have the same build context and no
other children. As a result, Symbol.Children are changed to the
SymbolMeta type.

For golang/go#37102

Change-Id: I89c361f86eff7179c18572e57a5dd0788fea4b1d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/315432
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-05-04 02:15:00 +00:00
Julie Qiu 9cde3d9f22 internal/postgres: fix package_symbols unique key
For golang/go#37102

Change-Id: I188b4af3f9fd80ad88f7df72cbe9c12db64a0b0d
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/315310
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-04-30 16:21:21 +00:00
Julie Qiu c4f46a6c61 internal/postgres: delete CompareStdLib
CompareStdLib is no longer used.

Change-Id: I20959a48c6534bed89670866a67ad29997cfd3d0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/314892
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
2021-04-29 16:49:03 +00:00
Julie Qiu 196deb3ba0 internal/symbol: add CompareAPIVersions
CompareAPIVersions is added, which compares the since version data for
symbols with the data for apiVersions. This replaces CompareStdLib.

For golang/go#37102

Change-Id: I60815b4154a2c25b592127b4207bd6c5482f21c7
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/314536
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-04-29 15:30:31 +00:00
Julie Qiu 57292c989b internal/symbol: update ParsePackageAPIInfo for non-stdlib packages
ParsePackageAPIInfo is updated to handle apidata for both stdlib and
third-party packages.

It also handles information for constants and variables.

For golang/go#37102

Change-Id: Ia2a6a374cecb843700b9187e77ac7c395c23392b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/314535
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-04-29 15:30:14 +00:00
Julie Qiu e252e92a29 internal/postgres: export GetSymbolHistory helper functions
GetSymbolHistooryWithPackageSymbols and GetSymbolHistoryFromTable are
exported for use in test scripts.

For golang/go#37102

Change-Id: I39f0dfd075ae89b69d08561be40ecc6de043f158
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/314509
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-04-28 19:40:33 +00:00
Julie Qiu 36b91b5698 internal/postgres: add upsertSymbolHistory
upsertSymbolHistory is added, which inserts data into the symbol_history
table.

For golang/go#37102

Change-Id: Ia288e47d82ab9868db4bce196574ec2806216cce
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/313596
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-04-28 17:58:22 +00:00
Julie Qiu ef62493bc1 internal: add experiments for reading and writing to symbol_history
For golang/go#37102

Change-Id: I0146f6ade0652e655c8b8c76e4740a237561eb7c
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/312173
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-04-27 04:29:26 +00:00
Julie Qiu 754bc2ca63 internal/{frontend,postgres}: add GetSymbolHistory
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>
2021-04-21 19:14:31 +00:00
Julie Qiu 8185298a14 internal/postgres: remove do-not-insert-new-documentation
Change-Id: I4b5e4b4e6556f6f724dd01c08b7014c30b10a2b3
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310313
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-04-21 19:14:16 +00:00
Julie Qiu 6db4e92ce5 internal/postgres: delete insert-symbols
Change-Id: I654b4b6186d49a9a8a83874747ab5ee9d909fe9a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/310380
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-04-16 19:00:33 +00:00
Julie Qiu 9f9e4bc7ca internal: add experiment do-not-insert-new-documentation
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>
2021-04-16 02:35:07 +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
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 30367d2f8a internal/postgres: change packageSymbol fields
A packageSymbol for a given package is now identified by the name,
synopsis and section.

For golang/go#37102

Change-Id: I30b730194e10d52d28518d744c24f5e6f1829f7a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/301051
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-15 17:33:39 +00:00
Julie Qiu 963700b208 internal/postgres: delete unused symbol_history code
Code related to inserting into the symbol_history table is deleted. That
table is no longer used and will be dropped in a future CL.

Change-Id: I4c7e5646a529770a03b2946916255ccaa9630dfd
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/300209
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-09 23:44:25 +00:00
Julie Qiu 07e0181a07 internal/symbol: add IntroducedHistory
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>
2021-03-05 17:44:43 +00:00
Julie Qiu 3e68221cfe internal/postgres: fix getUnitSymbols
A bug is fixed in getUnitSymbols where buildToSymbols was never
populated.

Various bugs in the tests are also fixed

Change-Id: If1dba8ea983e9a5a959adbdd94970a64af85b7f5
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/296450
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-02-25 21:39:58 +00:00
Julie Qiu aadbc86380 internal/postgres: insert documentation_symbols
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>
2021-02-25 05:13:07 +00:00
Julie Qiu 9e8d18f876 internal/postgres: update insertDocs
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>
2021-02-25 00:10:37 +00:00
Julie Qiu a403cb7d04 internal/postgres: change upserts for symbol_names and package_symbols
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>
2021-02-23 21:19:32 +00:00
Julie Qiu a45850f691 internal/postgres: change buildcontext key in getSymbolHistory
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>
2021-02-23 16:18:07 +00:00
Julie Qiu 09d6cf4a58 internal/postgres: update insertSymbols
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>
2021-02-19 22:34:29 +00:00
Julie Qiu 6369e83d70 internal/postgres: change symbols to symbol_names
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>
2021-02-19 17:43:00 +00:00
Julie Qiu 05df48e41c cmd,internal/symbol: add stdlib API comparison script
A script is added at cmd/internal/testing/stdlibsymbol/main.go, which
compares the stdlib API data in
https://go.googlesource.com/go/+/refs/heads/master/api with that of the
symbol_history table.

This script is used to check that data on pkgsite is accurate during
development.

Change-Id: Ib453dc8d63ee45cc3c8eb40365f9baf5636adec3
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/293429
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-02-19 17:13:59 +00:00
Julie Qiu de8e98b59d internal/postgres: move insert symbols behind experiment
The insert-symbol-history experiment is moved so that symbol names are
no longer inserted. This is done so that we can rename symbols to
symbol_names in a future CL.

TestInsertSymbolNamesAndHistory is skipped until the migrations are
merged.

Change-Id: Idfffaab82cca2365f01b61d36c3967523b0647be
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/293949
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-02-18 23:50:23 +00:00
Julie Qiu 1676d33cc9 internal/postgres: insert symbol history
Data for a package's symbol history is inserted into the symbol_history
table.

This change is added behind a feature flag as additional tests will be
added.

This change does not take into account cases where the GOOS/GOARCH
for a package changes from "all/all" to all of the supported build
context combinations at a later version. This edge case will be
addressed in a later CL.

For golang/go#37102

Change-Id: Ia3abf1cf63159cb5b1b2b926a305ab606926a4ec
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/292511
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-02-18 16:47:36 +00:00
Julie Qiu 7d8f2103ab internal/postgres: add logic for symbol history updates
shouldUpdateSymbolHistory is added, which reports whether the row for
the given symbolName should be updated.

For golang/go#37102

Change-Id: I2e0330ad1aac7957917c0f0e8f90eeb64acca0f6
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/291349
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-02-16 22:55:34 +00:00
Julie Qiu 56e2739dab internal/postgres: insert symbol names
Insert symbol names into the symbols table when package documentation is
inserted.

For golang/go#37102

Change-Id: I82cc0425ec9cdadc2c5449038fedfd6920e1adc0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/291089
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2021-02-12 21:27:40 +00:00