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

14 Коммитов

Автор SHA1 Сообщение Дата
Julie Qiu 89dd2f627b internal/frontend: add serveDirectoryPage
A serveDirectoryPage function is added, which serves pages for the
directory view using a versioned directory.

For golang/go#39629

Change-Id: I372981dfa7822d850aac59ffd9fea2aab8949baa
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/241859
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-10 17:31:15 +00:00
Julie Qiu 4dcf7b4c6f internal/frontend: specify requested or resolved version in args
Many functions in internal/frontend have "version" as an argument, but
it is not clear whether that version is the "requested version" (i.e.
latest, master, or semver), or the "resolved version" (the semantic
version corresponding to the requested version).

These are now specified in the argument name to make it clearer what is
expected as an input to the function.

Change-Id: I9211c1b55e0951b37f693bfed5c4b509a5d81da4
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/240939
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-07-06 18:00:44 +00:00
Julie Qiu e594fa1e26 internal: remove methods from DataSource
At the moment there are several methods not implemented by the
proxydatasource. These are removed from internal.DataSource.

Fixes b/150138536

Change-Id: Id1eef4b2497bd46c8e3cecf8a083ef81bfbe2f47
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/768688
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-06-11 20:31:41 +00:00
Jonathan Amsterdam 216e30b8a7 internal/frontend: use new model tables to build package pages
Use the results of postgres.GetDirectoryNew to build
package pages.

Change-Id: Iff812416f4fb879baa16536639a80810fc1248b2
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/747780
Reviewed-by: Julie Qiu <julieqiu@google.com>
2020-05-21 16:00:46 +00:00
Julie Qiu 19794c8aeb all: rename module to golang.org/x/pkgsite
golang.org/x/discovery is renamed to golang.org/x/pkgsite.

When the repository is open sourced, it will be hosted at
go.googlesource.com/pkgsite.

Change-Id: Ifc3b45b771a385b99179e785447f2a87afcacf87
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/724273
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-04-23 16:18:43 +00:00
Jonathan Amsterdam 66ad1f1dbe all: rename VersionInfo to ModuleInfo
This CL is pure renaming:
- internal.VersionInfo to internal.ModuleInfo
- related variables from vi to mi

Updates b/150143758.

Change-Id: I5da63a07d6f9b731016ffe92e403e5f2d9aadab7
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/673875
Reviewed-by: Julie Qiu <julieqiu@google.com>
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
2020-04-06 15:50:52 -04:00
Julie Qiu 1ab926d464 internal: move Datasource from frontend to internal package
frontend.Datasource is moved into internal.Datasource, so that it
can be used in future CLs in the internal/middleware package.

Change-Id: Id4823b46f36f114fd02ee3b8ac78c1e6d24c0cc5
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/611020
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-03-27 16:46:49 -04:00
Jonathan Amsterdam 355b026adf internal/postgres: ignore self-imports in imported-by counts
Do not count package A as importing package B if they
are in the same module.

Change-Id: Ic0f98af8d72b8fff29e105779c6eb619214335e9
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/596525
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
2020-03-27 16:46:47 -04:00
Julie Qiu aab06ffb69 internal/frontend: add DataSource.GetPackageInModule and modify DataSource.GetImports
GetPackageInModule is added to the DataSource struct and as a method to
proxydatasource.

GetImports is modified to accept modulePath in addition to pkgPath and
version as an argument.

Updates b/140191811
Updates b/136484298

Change-Id: Ibee233535a5970a2e4a5568181a4317a57a920eb
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/565240
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
2020-03-27 16:46:44 -04:00
Jonathan Amsterdam 8ad4f41b99 internal/postgres: use imports_unique for imported-by
Use the new imports_unique table to determine importers.
It is significantly faster.

Increase limit significantly.

Change-Id: I8ca549d769a83533d9fb7baa8f69a02a45f721c4
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/537588
CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com>
Reviewed-by: Julie Qiu <julieqiu@google.com>
2020-03-27 16:46:43 -04:00
Rob Findley 1ce0e852e6 internal/frontend: add a DataSource interface
This introduces a layer of abstraction between the frontend and
postgres, which can be useful for testing but also is required for
enabling a 'direct' mode which goes straight to a proxy.

Updates b/139144841

Change-Id: I38ebda5766df38f87ce18d0fde8c862ac92e2713
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/539132
Reviewed-by: Julie Qiu <julieqiu@google.com>
2020-03-27 16:46:42 -04:00
Jonathan Amsterdam c76866da88 internal/frontend: group imported-by paths
Instead of displaying the paths imported by a module as a flat list,
use <details> elements to display a tree.

Make tree nodes for (roughly) "account" and "repo", so that
"github.com/google" is one level of the tree, and
"github.com/google/somerepo" is the next level. Don't group beyond
that on the assumption that users would want to see all the importing
packages in a repo as a flat list.

Also, get rid of pagination on the query. Instead use a large limit,
and only display paths up to that limit.

Fixes b/139411420.

Change-Id: I55e030e5f901dacf854f2e7f585a444d089f6ea1
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/537581
Reviewed-by: Julie Qiu <julieqiu@google.com>
2020-03-27 16:46:42 -04:00
Jonathan Amsterdam 0c5d10f433 internal/postgres: methods in details annotate errors
Change-Id: Ic4deb401f98e5cfcf9e8dbdcc39d0fad53b75e9d
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/527173
Reviewed-by: Robert Findley <rfindley@google.com>
2020-03-27 16:46:41 -04:00
Julie Qiu 6cbe04d012 internal/frontend: reorganize details.go
details.go currently contains almost all of the logic for rendering the
package details view. In a future CL, it will also contain logic for
rendering the module details view.

It is reorganized by being split into multiple files in preparation for
handling that logic, which has a lot of shared functionality.

Updates b/138448402

Change-Id: Id031b14f58dce9e90b32ca658bfe920c30c42b74
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/515745
Reviewed-by: Robert Findley <rfindley@google.com>
2020-03-27 16:46:40 -04:00