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

5 Коммитов

Автор SHA1 Сообщение Дата
Jonathan Amsterdam 5e159604f7 internal/frontend: get a DataSource on each request
Reorganize the server so that each request gets its own DataSource,
instead of using a single DataSource for every request.

Currently, the behavior doesn't change because we do in fact use
the same DataSource for every request. But this paves the way
to having a pool of health-checked DB connections, while still
having each request work with a single connection.

For golang/go#40444.

Change-Id: I717450593a8dcfd5689a8d28f634324776305042
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/244603
Reviewed-by: Julie Qiu <julie@golang.org>
2020-07-28 13:14:05 +00:00
Julie Qiu 4976d5a963 internal: delete insert-directories experiment
The insert-directories experiment flag is deleted, since we have already
inserted data for all modules into the paths, package_imports,
documentation, and readmes table, and been running that code path for a
while.

Updates golang/go#39629

Change-Id: I323850a462672c41ad0c67b6ab2b173bb32bf441
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/241320
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-07 21:06:13 +00:00
Julie Qiu 434abc0b2e internal/experiment: improve ergonomics for NewSet and NewContext
Previously, NewSet and NewContext required the caller to construct a set
that was passed in. The functions now accept experiment names, to make
them easier to use.

Change-Id: Id306902910d51483c48a6a3bc8205cf484694d6a
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/240857
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-06 15:32:32 +00:00
Julie Qiu 45475dd537 {cmd,internal}/frontend: add handler to download paths that do not exist
A fetch endpoint is added to the frontend, which will queue a module to
be enqueued by the worker, if it doesn't already exist in the database.

After enqueuing, the fetch handler will poll the version_map table at a
constant rate, until the path returns or the request times out.

If the request fails, a corresponding statusCode and responseText will
be returned to be displayed to the user.

Updates golang/go#36811
Updates golang/go#37002
Updates golang/go#37106

Change-Id: Ic2e20146dc626bf296db05bc2abbfb50d6fd7991
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/743103
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-06-04 15:55:57 +00:00
Jonathan Amsterdam 5a8a561170 internal/frontend: support stdlib shortcuts
If the URL path doesn't match anything, but it could be in the
standard library (e.g. "json", "http"), then look for a unique
standard library path that ends with the given path, and redirect to
that.

Updates b/149933479.

Change-Id: I0d7c16620c1d0f7c8326302bac1c1423daccfd21
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/747788
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
2020-05-18 16:23:08 +00:00