diff options
| author | Jonathan Amsterdam <jba@google.com> | 2020-08-25 17:18:40 -0400 |
|---|---|---|
| committer | Jonathan Amsterdam <jba@google.com> | 2020-08-26 10:23:18 +0000 |
| commit | b420ef11c677003f7ebd734a88c8a680206e1065 (patch) | |
| tree | 96b3ea3a47b217f2a5ffd54171bc11ef612deafa /internal/postgres/insert_module.go | |
| parent | fe1a9b4f98d97878a576c6dc843933cafd2f69e4 (diff) | |
| download | go-x-pkgsite-b420ef11c677003f7ebd734a88c8a680206e1065.tar.xz | |
internal/postgres: enforce redistributability and allow bypass for search
- Unexport upsertSearchDocuments and verify that at its sole call
site, non-redistributable data is removed unless the bypass flag is
true. This "fixes" golang/go#40971, which was never actually broken.
- Remove non-redistributable data in
GetPackagesForSearchDocumentUpsert. (This was a legitimate bug,
although one that never had any effect.)
Fixes golang/go#40971
For golang/go#39602
Change-Id: I35493739de3a4ac0694ad3f07a371d9873f31b52
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/250637
Reviewed-by: Julie Qiu <julie@golang.org>
Diffstat (limited to 'internal/postgres/insert_module.go')
| -rw-r--r-- | internal/postgres/insert_module.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go index 2af86f90..931639c2 100644 --- a/internal/postgres/insert_module.go +++ b/internal/postgres/insert_module.go @@ -157,7 +157,7 @@ func (db *DB) saveModule(ctx context.Context, m *internal.Module) (err error) { return err } // Insert the module's packages into search_documents. - return UpsertSearchDocuments(ctx, tx, m) + return upsertSearchDocuments(ctx, tx, m) }) } |
