commit | 729fee3ca83f69fad10cd56429a9d010034ad320 | [log] [tgz] |
---|---|---|
author | Jonathan Amsterdam <jba@google.com> | Mon Aug 16 08:25:09 2021 -0400 |
committer | Julie Qiu <julie@golang.org> | Mon Aug 16 15:32:11 2021 +0000 |
tree | 039b6effb273c01ecdeb78dee21da5bc119ddb11 | |
parent | 1a91d325f56b7a8e88d3855c12705a9395d9195c [diff] |
internal/postgres: don't insert into search if a prefix In ReconcileSearch, don't insert a module into search_documents if there is already a module path that is a suffix of the current one. This avoids cases like the following: 1. github.com/araalinetworks/api, which has a golang package, is fetched and added to search_documents. 2. github.com/araalinetworks/api/golang is fetched and added to search_documents, correctly replacing github.com/araalinetworks/api because it is a longer module path. 3. Another version of github.com/araalinetworks/api is fetched. It is bad, so it isn't inserted in the usual way, but ReconcileSearch re-inserts the latest good version, which overwrites the longer module path inserted in step 2. Change-Id: If8ae59acfde7838c0ea48882d6beb0a457e125db Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/342469 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>
Pkg.go.dev is a website for discovering and evaluating Go packages and modules.
You can check it out at https://pkg.go.dev.
If you want to report a bug or have a feature suggestion, please first check the known issues to see if your issue is already being discussed. If an issue does not already exist, feel free to file an issue.
For answers to frequently asked questions, see go.dev/about.
You can also chat with us on the #pkgsite Slack channel on the Gophers Slack.
We would love your help!
Our canonical Git repository is located at go.googlesource.com/pkgsite. There is a mirror of the repository at github.com/golang/pkgsite.
To contribute, please read our contributing guide.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.