aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
7 hours[DO-NOT-MERGE] all: add option shutdown-idleHEADmainShulhan
The shutdown-idle set the duration to automatically shutdown the HTTP server when no request after specific duration. This is to complement the socket based activation to minimize the resources on local environment.
7 hours[DO-NOT-MERGE] all: add make fileShulhan
This is to easily remember what tasks and commands to run in this repository.
7 hours[DO-NOT-MERGE] cmd/pkgsite: implement socket based activationShulhan
9 hoursinternal/api: test ServePackage with dbJonathan Amsterdam
Test the ServePackage function against a real database, as well as the fake data source. - Modules and packages must be redistributable, or the DB strips the documentation. - Documentation must contain source code. We must temporarily skip the dependency tests, to reduce the diffs on this change. The test is still important, because it asserts that the pkgsite command has only a few dependencies. To re-establish it, we will move the API tests to internal/testing/api. Change-Id: I67243ea2345c5e735edbdd6ee5bf2349a6b1eb60 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/765502 kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ethan Lee <ethanalee@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
31 hoursinternal/api: improve ambiguous package path resolutionHana Kim
Instead of falling back to UnknownModulePath, we now: 1. Query all candidate module paths. 2. Filter out candidates where the database fell back to a different module path (preventing false positives like google.golang.org). 3. Filter out deprecated or retracted candidates if at least one good candidate exists. 4. Return 400 if ambiguity remains among good candidates. This commit fixes the issue where /v1/package/google.golang.org/adk/agent was returning HTTP 400 because all candidate module paths matched: ``` { "code":400, "message":"ambiguous package path", "candidates":[ {"modulePath":"google.golang.org/adk/agent","packagePath":"google.golang.org/adk/agent"}, {"modulePath":"google.golang.org/adk","packagePath":"google.golang.org/adk/agent"}, {"modulePath":"google.golang.org","packagePath":"google.golang.org/adk/agent"}] } ``` Change-Id: I3ea24bca5144d536490019efd85fb597da214029 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/766380 kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
4 daysinternal/testing/fakedatasource: improve docJonathan Amsterdam
This was inadvertently left out of an earlier CL. Change-Id: I5ec5d82c9fa2efcc27c076360cb50097c86655d7 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/764821 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ethan Lee <ethanalee@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
5 daysgo.mod: update golang.org/x dependenciesGopher Robot
Update golang.org/x dependencies to their latest tagged versions. Change-Id: I0e4e9a00bda8777e7930d2b09e40dba681bfb768 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/764907 Reviewed-by: David Chase <drchase@google.com> Auto-Submit: Gopher Robot <gobot@golang.org> kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
5 daysinternal/frontend: add v1/search endpointEthan Lee
Change-Id: I53fc1becbee21fcc586e00f4e3d93f636eaaba4c Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/764960 kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> Auto-Submit: Ethan Lee <ethanalee@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Ethan Lee <ethanalee@google.com>
5 daysinternal/api: refactor error handling to increase consistencyEthan Lee
- Refactored error handling to avoid leaking internal implementation details. Database and system errors are masked by falling back to standard HTTP statuses but still logging the entire error context. - User facing error messages can now be specified within the Error struct. - Added helpers in types.go to simplify error construction. - Updated ServeModuleVersions to explicitly return 404 when no versions are found. - Expanded test coverage in api_test.go to include 404 and 400 edge cases. Change-Id: I89c4be3941126c15df6aefdd21e4bbd2d3b23be1 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/764820 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ethan Lee <ethanalee@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
5 daysinternal/api: test licenses and imports paramsJonathan Amsterdam
Test the "licenses" and "imports" query params for the packages route. Change-Id: I46c7dd18f0eb2e104d124d2d724039f920247e5b Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/764540 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> TryBot-Bypass: Jonathan Amsterdam <jba@google.com> Reviewed-by: Ethan Lee <ethanalee@google.com> Auto-Submit: Jonathan Amsterdam <jba@google.com>
5 daysinternal/api: simplify filter codeJonathan Amsterdam
Change-Id: I5510faeb196af4ce1418affe6159b17187b9efa5 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/764700 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ethan Lee <ethanalee@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
6 daysinternal/api: set cache-control headersJonathan Amsterdam
Set an HTTP Cache-Control header for all API responses. Since requests that reference a specific, numbered version apparently always produce the same response, it is tempting to use the "immutable" Cache-Control directive so these pages can be cached indefinitely. But occasionally we must exclude a module. It would be unfortunate if the module's data lived in caches forever. Instead, we cache such pages for one day. Pages that are subject to more rapid change, like those with versions "latest", "master" and so on, or those that depend on data other than a module (imported-by, search, etc.) are cached for an hour. That is an arbitrary value that seems like a good compromise, since the likelihood of a particular page's value changing in an hour is low. Change-Id: I21414c22c724220c993c1dd7e7a0b49074efd8b9 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/763782 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ethan Lee <ethanalee@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
6 daysinternal/api: add examples parameter to PackageParamsEthan Lee
- Enable conditional population of examples by introducing a new examples parameter. Change-Id: I53314344a414c41b423185c115e600ec8b63e6bf Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/763282 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ethan Lee <ethanalee@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
6 daysinternal/queue: add postgres queue implementation, and use it in worker|frontendJean Barkhuysen
Fixes golang/go#74027. Change-Id: I916ac81093e782d4eda21fe11ef47eeff4f5f0b1 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/751480 Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Ethan Lee <ethanalee@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
6 daysinternal/frontend: remove local map of case sensitive excluded pathsMadeline Kalil
go.dev/cl/761521 introduced an exact: prefix used to specify case sensitive paths that need to be excluded. We can now remove the map that previously handled case sensitive exclusion. A separate CL merges the outstanding case sensitive excluded paths into excluded.txt. For golang/go#77822 Change-Id: Ic4d15ae3deda9323981fb5ceaa5667522278960a Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/764080 kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Ethan Lee <ethanalee@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
6 daysinternal/postgres: allow matching exact prefix with exact:Madeline Kalil
Currently, the package exclusion process is case insensitive, because certain hosts such as GitHub are case insensitive. The only way to exclude a case sensitive version without also excluding all case insensitive matches is to add the prefix to caseSensitiveExcludedPaths in internal/frontend/details.go. This CL implements a new approach to excluding case sensitive paths: it enables specifying an "exact:" prefix in excluded.txt that will force matching the pattern exactly, instead of with case insensitivity. For golang/go#77822 Change-Id: I123ad2e13ff6673084006c6d51377308d95230ce Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/761521 kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ethan Lee <ethanalee@google.com>
7 daysinternal/api: clean up redundant TODOEthan Lee
- The relevant logic has already been implemented. Change-Id: I1d4f92e6d6c00666ba09a532e378fc1f0ede7856 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/763400 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ethan Lee <ethanalee@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
7 daysinternal/api: add support for readme and licenses in ServeModuleEthan Lee
- Utilize conditional fieldset in GetUnit to efficiently retrieve readme and license fields. - Modify Module type to include HasGoMod. Change-Id: Id22ac3f2485392749742332701d2e913f047b3da Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/763401 kokoro-CI: kokoro <noreply+kokoro@google.com> Auto-Submit: Ethan Lee <ethanalee@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
7 daysinternal/api: unify default pagination limitsEthan Lee
Change-Id: Ie8faec1c02d74ac2559e78d8793d6050a98b38fc Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/763281 Auto-Submit: Ethan Lee <ethanalee@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
7 daysinternal/api: refactor ServePackage and extract helper functionsEthan Lee
Change-Id: Iae93d49fdb6d3a196281d49cd2cf01a8b4e537e2 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/763280 kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ethan Lee <ethanalee@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
8 daysinternal/api: factor out common renderer thingsJonathan Amsterdam
Change-Id: I5d8a579913942bcdea664af675ff2ef29888281c Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/761400 TryBot-Bypass: Jonathan Amsterdam <jba@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Ethan Lee <ethanalee@google.com>
8 daysinternal/api: add support for examplesJonathan Amsterdam
renderDoc now includes examples. It has an option to omit examples, if we decide to omit them in order to reduce the context load. Change-Id: Ieaa411fe09b439f51aac7d49195cd5791a20d0d8 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/761000 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Ethan Lee <ethanalee@google.com> TryBot-Bypass: Jonathan Amsterdam <jba@google.com>
12 daysinternal/api: implement filtering logic based on query paramsEthan Lee
Change-Id: Ica73fe1f12b2c65d08240479d1a135a51c3ae566 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/758822 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Auto-Submit: Ethan Lee <ethanalee@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
13 daysinternal/api: consolidate error response handling for all handlersEthan Lee
- Ensure that all errors are wrapped correctly and served as a json error response. Change-Id: I588552c755fb2135916da95dec6d37238d030d39 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/758821 Auto-Submit: Ethan Lee <ethanalee@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-31internal/api: centralize pagination and trimming logicEthan Lee
- All handlers returning lists will utilize the paginate helper. - Path trimming logic has also been modularized within a helper. Change-Id: I5c99ae8264ea76587137e29524ad19795652e43b Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/758642 Auto-Submit: Ethan Lee <ethanalee@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
2026-03-30all.bash: re-enable unparamJonathan Amsterdam
It's working now. Also fix, issues that it detected. Change-Id: Ifd3fe5baf9a56d31bafe099bf4b38e02356bde21 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/760582 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Ethan Lee <ethanalee@google.com>
2026-03-30internal/api: implement vulnerabilities endpointEthan Lee
- Create vulnerabilities endpoint using server vuln client. Change-Id: I234c96851f7682a13bda97aa3e5018d0439e05da Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/754866 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ethan Lee <ethanalee@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
2026-03-30internal/api: implement package imported-by endpointEthan Lee
- Implement ServePackageImportedBy handler and GetImportedBy and GetImportedByCount datasource methods. Change-Id: I8c4cc65fbff7172eaf48e5426e4f3f41c82bd38e Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/754865 Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ethan Lee <ethanalee@google.com>
2026-03-30internal/api: add htmlRendererJonathan Amsterdam
Change-Id: Ib25c913ce7641dea58e2eefb6d65f5cc7dec813a Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/760820 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Ethan Lee <ethanalee@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-28tests/screentest: fix flaky mobile viewport screen capturesHana Kim
When "capture viewport 540x1080" shrinks the headless browser window from desktop to mobile size, the layout shifts and triggers CSS transitions. Because screentest takes the screenshot immediately after resizing, it often captures the page mid-animation. This causes element height changes and unexpected scrollbars, making the image diff fail randomly. Fixed by injecting a style tag that globally disables all CSS transitions during the hideElements initialization. This causes layout resizes to snap instantly, ensuring the captured image is always fully settled and consistent. Change-Id: I43310708ced5f0cff5bf011bfb407fa22705d9a2 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/760580 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ethan Lee <ethanalee@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
2026-03-27all: run go fix -waitgroupHana Kim
Change-Id: Iefc4a999101eb1fc5ea2ccd2dc6981f1967c7222 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/753435 kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-27internal/api: use unmarshalResponse for ServeModuleJonathan Amsterdam
Also add a test case. Change-Id: Iae30ecca8ebaaa412e9072de5123026ca4f78476 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/760480 kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ethan Lee <ethanalee@google.com>
2026-03-27internal/api: render markdown documentationJonathan Amsterdam
Change-Id: I8adf1e62d19cf592cc8204264d99953e12da5843 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/760260 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Ethan Lee <ethanalee@google.com>
2026-03-27internal/api: add unmarshalResponseJonathan Amsterdam
Add a useful helper. Use it once. We must use it at least once to pass our check for unused functions. Change-Id: Ied063f74dc7e3bc7dc7c12d4a17b0e55680951ad Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/759840 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Ethan Lee <ethanalee@google.com>
2026-03-27all: run go fix -testingcontextHana Kim
Change-Id: I8812f020b84ce40d577116199435af9e62c980f7 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/753434 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
2026-03-27all: run go fix -stringsseqHana Kim
Change-Id: Id22b6fbc926c516043a2a9869ce9042dedebc725 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/753433 Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-27all: run go fix -stringscutprefixHana Kim
Change-Id: I3c0a7e155ead790300ebe53e090ef9a42e655d3e Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/753432 kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
2026-03-27all: run go fix -stringscutHana Kim
Change-Id: I83d02fd7951c58b528062882dc32ea4ae5051954 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/753431 kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-26all: run go fix -stditeratorsHana Kim
Change-Id: I59796268d8bd663b1a4fb48f4c3e41b5d7852220 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/753429 Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-26all: run go fix -stringsbuilderHana Kim
Change-Id: I839e47c2b39ee592909f7ecb03603d4fb1d1954b Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/753430 Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-26all: run go fix -slicescontainsHana Kim
Change-Id: I14479d9e612dfa7eed9188206746af5b51c10201 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/753428 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
2026-03-26internal: consolidate build context and unit resolution logicEthan Lee
- Centralize logic for resolving units and selecting the best matching build context. - New helpers MatchingBuildContext, SortedBuildContexts provide a consistent, efficient approach to build context selection. - DocumentationForBuildContext now finds the best match based on precdence rules rather than just returning the first match. - A new getUnitContext helper resolves unit metadata and the best build context in a single query. - GetSymbols and GetUnit are now both optimized to use pre-resolved IDs, simplifying their queries and removing redundant joins. - Replaced redundant matchingDoc functions in fetchdatasource and fakedatasource. Change-Id: I9207d3bfe03404483c816090a0b99666f14a36e3 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/759162 Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ethan Lee <ethanalee@google.com>
2026-03-26all: fix rangeintHana Kim
Change-Id: I58ed5e7d2a3bbc13bc389ac7239737e18856dbfe Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/753427 Reviewed-by: Jonathan Amsterdam <jba@google.com> Reviewed-by: Ethan Lee <ethanalee@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-26internal/osv: remove ineffective omitemptyHana Kim
This was modified by go fix -omitzero. The intention was probably to omit the fields (of time.Time type) when they are zero values. However, omitempty doesn't do it. I considered to set them for omitzero, but it's delicate. - Modified field is "required" field per spec. - Published is an optional field but our codebase assumes it's always present (and optionally uses the Modified field only if it differs from Published). In practice, probably it's always set any way. Just remove the tag so the future `go fix` run doesn't cause churn. Change-Id: I1138e629e2d3f77d96167f3a52413a08b15821cd Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/753426 Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
2026-03-26internal/api: implement package symbols endpointEthan Lee
- Introduce a new ServePackageSymbols handler that utilizes the new db.GetSymbols method. - Consolidated module resolution logic shared by ServePackages into resolveModulePath. - Updated Datasource with GetSymbols, which provides a more efficient way to retrieve all symbols for a package at a given version and build context. This differs from the existing getPackageSymbols, since that will return symbols for the latest release/compatible version. - Refactored packageSymbolQueryJoin into a generic helper by removing hardcoded version filters. This allows GetSymbols to query for any specific version, while getPackageSymbols was updated to explicitly include release-only filters to preserve its existing behavior. - GetSymbols still utilizes the same underlying packageSymbolQueryJoin, but it will also attempt to match the most relevant BuildContext for the query. It will also provide a mapping of parent and child symbols. Change-Id: Ib18d2511d24ac6bc5b75c7b3809c4ce126245036 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/754864 Auto-Submit: Ethan Lee <ethanalee@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2026-03-26cmd/internal/pkgsite: fix godoc mode without -listFilippo Valsorda
Looks like it had always been broken, since m doesn't have a useful String() method. Change-Id: I6ad3a60916d3611fb38982a3aaf648c46a6a6964 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/737280 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
2026-03-25all: add LatestVersion to ModuleInfoEthan Lee
- Add LatestVersion field to internal.ModuleInfo and update tests accordingly. - Changed some test formatting to improve readability. Change-Id: I1238e54614ef276d219b31d125cd2cad6b5a66f7 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/756901 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Auto-Submit: Ethan Lee <ethanalee@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
2026-03-24internal/api: implement search endpointEthan Lee
- Implement ServeSearch method and pagination for search results. Change-Id: I109d0861b5fa0cfbc20ce20308561ef6b5616405 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/754860 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Auto-Submit: Ethan Lee <ethanalee@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
2026-03-24all: pgx/v4 to v5 and upgrade pqEthan Lee
- In preparation for upgrade to PostgreSQL 17, upgrade stale dependencies within pkgsite. Change-Id: Id54cbb46182711b9808ee3bbbe2f0d5d9a04583d Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/758121 Auto-Submit: Ethan Lee <ethanalee@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
2026-03-24internal/api: implement module packages endpointEthan Lee
- Implement the ServeModulePackages handler and introduce GetModulePackages to return the list of packages for a given module version. Change-Id: I20c1618e2fdbf0126cb913665a1d7457b8951177 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/754863 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Auto-Submit: Ethan Lee <ethanalee@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>