-
Notifications
You must be signed in to change notification settings - Fork 18k
x/pkgsite: improve pkgsite command #47780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Change https://golang.org/cl/343211 mentions this issue: |
Change https://golang.org/cl/343210 mentions this issue: |
Change https://golang.org/cl/343212 mentions this issue: |
Change-Id: Ie2495949a365f5cbdfcfdc42c12233348c88b85c For golang/go#47780 Change-Id: Ibe93986002ffa4f0a5419cf7ce7ce0987fa95cb2 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/343210 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
For golang/go#47780 Change-Id: Ib32d9b56540ce6786e5951829fcf2b8999303057 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/343211 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Change https://golang.org/cl/343220 mentions this issue: |
For golang/go#47780 Change-Id: I1259649c8a1d452ffad5e8a2a92943801a24b306 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/343212 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Add fsModuleGetter, which is a ModuleGetter for a directory organized like proxy URLs. The go module download cache is in this format. For golang/go#47780 Change-Id: Ifccdfa3010874adddc0a600593699d454e44c0e3 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/343220 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Julie Qiu <julie@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com>
Change https://golang.org/cl/343591 mentions this issue: |
Change https://golang.org/cl/343590 mentions this issue: |
Change https://golang.org/cl/343629 mentions this issue: |
Change https://golang.org/cl/343630 mentions this issue: |
A correctly configured directoryModuleGetter knows the module path it is serving, and returns NotFound for any others. This will enable trying multiple ModuleGetters when looking for a path. For golang/go#47780 Change-Id: Ib33bd3d7e222ff048ae8a35843df43219e9d844b Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/343590 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Instead of loading a list of modules initially, a local datasource now takes a list of ModuleGetters, which are called on demand when a module is requested. For golang/go#47780 Change-Id: Ica3cc6d47de01ec78c451c0ef54b9ba0e0c5a96e Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/343591 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
It is no longer used. For golang/go#47780 Change-Id: I9857e6b4d0ac77cfe4b30ce02e670fc93f34e51e Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/343629 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Add a small test to the pkgsite command to make sure it's working. For golang/go#47780 Change-Id: I276feeacbc11b18ceb054902fe6b0c1c2c2ab923 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/343630 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Please do not remove or deprecate godoc 🙏 |
Change https://golang.org/cl/344529 mentions this issue: |
Change https://golang.org/cl/344530 mentions this issue: |
godoc still has all the -analysis flags. Does pkgsite offer that? |
No.
|
Change https://golang.org/cl/344589 mentions this issue: |
Change https://golang.org/cl/344590 mentions this issue: |
Change https://golang.org/cl/344669 mentions this issue: |
Change https://golang.org/cl/344670 mentions this issue: |
Change https://golang.org/cl/344671 mentions this issue: |
Move the getModule method into the shared implementation. Move the proxy client into the shared implementation, and set it to nil for the local proxy. Remove the lock around getModule. As the comment explains, the resulting race is benign, and we gain the benefit of allowing multiple goroutines to look up modules concurrently. Remove the BuildContext arg to getModule. It's not appropriate there, since getModule's job is to deliver all the information about a module. We'll re-introduce it (and use it properly) later. For golang/go#47780 Change-Id: I3e9440c0d6c1b24f7a190a516c9efac1ec0f05bd Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/344949 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>
Move both methods into the shared datasource, and clean up the logic. For golang/go#47780 Change-Id: I7ce0d29742652c63db2d2e55dedf6e378b838445 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/344950 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>
Move GetLatestInfo to the shared datasource. Remove GetModuleInfo; it was unused. For golang/go#47780 Change-Id: I94419458f219759f83c990124d31fcfbddbb4b8e Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/344951 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Merge ProxyDataSource and LocalDataSource into a single type, DataSource. Combine and simplify tests. For golang/go#47780 Change-Id: I3510fee3a3d786705a2306a6233b352e5af40076 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/344952 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Rename the package and type by including the word "fetch," to describe what it does and distinguish it from other DataSources. For golang/go#47780 Change-Id: I7c674d8ba3dc16084a857039b0cc2b3147f27a29 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/344953 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Julie Qiu <julie@golang.org>
Change https://golang.org/cl/345249 mentions this issue: |
Change https://golang.org/cl/345251 mentions this issue: |
Change https://golang.org/cl/345269 mentions this issue: |
Change https://golang.org/cl/345270 mentions this issue: |
Change https://golang.org/cl/345271 mentions this issue: |
Change https://golang.org/cl/345272 mentions this issue: |
Change https://golang.org/cl/345273 mentions this issue: |
A FetchDataSource may be configured with a proxy for latest-version information while still being used for local modules. So ignore latest-version errors. For golang/go#47780 Change-Id: I30448e133faec80002194df59e6f2db449f80625 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/345249 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>
…kage If a module exists but the package path is not in it, return NotFound. For golang/go#47780 Change-Id: If3a6602df4b99c8470020e8538e01c685880d86d Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/345251 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>
GetUnit returns a Unit with its Documentation set to a matching BuildContext. This is the same behavior as postgres.DB.GetUnit. For golang/go#47780 Change-Id: I2bc23b7bc5a006e78bec54f6f3229e59ab5a03ef Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/345269 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>
Treat any command-line argument as a path or comma-separated list of paths. For golang/go#47780 Change-Id: I5d9044d3ff0e14af99c4632f3c723039179a94a5 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/345270 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Julie Qiu <julie@golang.org>
If the -proxy flag is provided, the pkgsite command will fetch modules from the proxy if they can't be found locally. For golang/go#47780 Change-Id: I02b9fddac9013d9d3859b78e6c8887282469c9a8 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/345271 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Julie Qiu <julie@golang.org>
With the -cache flag, fetch modules from the module cache. For golang/go#47780 Change-Id: I2aa6467955cd90a80ccae559f27928cca6e06079 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/345272 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Julie Qiu <julie@golang.org>
If the fsProxyModuleGetter is asked for the latest version, it finds it by looking at the versions of all the cached zips for the module. For golang/go#47780 Change-Id: I6e0b1f51c994e99bbcf3e66f40ef4c504fe48ce8 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/345273 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Julie Qiu <julie@golang.org>
This work is basically done at The pages served by |
@jba I just tried
|
Also, the standard library packages (/std and the like) aren't served. |
They aren't embedded, but you can use the
Sadly, search will never work, because it relies on information in the database. To get search, you would have to run your own full system, with a frontend, a worker, and a shared DB, and process the modules you wanted to search.
They are, it just takes a while for the first package (about a minute on my machine) because it has to clone the go repo and process it. After that, it's cached, so pretty fast. |
Thanks.
An alternative could be an index page listing all the available modules from the cache.
Ah, ok. The concrete standard library package pages like /net/http work after a while, but the /std page stays empty below the "Details" area and the "Jump to" box. Thanks for all the work. |
Just added this: if you clone the go repo and point to it with the |
Since #47982 is done, I'm going to close this. |
Improve golang.org/x/pkgsite/cmd/pkgsite so it can be used instead of golang.org/x/tools/cmd/godoc.
The text was updated successfully, but these errors were encountered: