aboutsummaryrefslogtreecommitdiff
path: root/internal/stdlib/gorepo.go
AgeCommit message (Collapse)Author
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>
2024-02-21internal/stdlib: remove support for special branchesJonathan Amsterdam
Remove support for the dev.boringcrypto and dev.fuzz branches. They are no longer relevant. For golang/go#65205. Change-Id: If0e7060b148fe3ebff9139a6ce2f418b928a0bd6 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/557415 kokoro-CI: kokoro <noreply+kokoro@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org>
2024-01-08cmd/pkgsite: fix case where we don't have runtime.GOROOT()Michael Matloob
If pkgsite is built with -trimpath, runtime.GOROOT() returns an empty string, so we don't know where the local go stdlib is. In that case, don't try to serve a local stdlib and instead fall back to the stdlibZipModuleGetter. Also fix two issues that show up when using the stdlibZipModuleGetter. First, we try to prefetch fetch.LocalVersion of the standard library when the server starts. Instead, prefetch latest which will have the correct behavior with both the stdlib zips and local stdlib. Second, when we're trying to fetch the stdlib using git make sure that we're on another branch than the one we're trying to fetch into because git won't let us fetch into the branch we're on. Fixes golang/go#64903 Change-Id: I9dfb22d50b7738080490ce2682e0cf187c16d2d1 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/554195 TryBot-Bypass: Michael Matloob <matloob@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-11-08internal/stdlib: pass -f to git fetch in remoteGoRepo.cloneMichael Matloob
remoteGoRepo.clone inits a repo and then tries to fetch into the "main" branch of the repo. But if the user's settings are for the default branch to be called main, main will already exist and the fetch command will fail. The -f flag will cause the command to do the fetch even though the branch already exists. For golang/go#63254 For golang/go#63744 Change-Id: I33f414654088a67eae4bfa70424d0dc6c34903f0 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/540635 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Michael Matloob <matloob@golang.org>
2023-08-25internal/stdlib: remove dependence on internal/testing/testhelperMichael Matloob
The testhelper package says it should only be depended on by test files, but it's depended on by an internal/stdlib non-test file (albeit for a testing purpose). Remove the dependency by making a copy of the TestDataPath function. An alternative to this would be splitting the testGoRepo into a different package, and making the goRepo interface and the withGoRepo function exported. For golang/go#61399 Change-Id: Ib64c18c6311f99501fc340801eee7a5625b95730 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/522242 Run-TryBot: Michael Matloob <matloob@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com>
2023-07-19internal/stdlib: remove dependency on github.com/go-git/go-git/v5Michael Matloob
Instead of using the in-memory git library implementation, just run all git operations using git commands. Add the MustHaveExecPath function from the internal/testenv library in the Go repo to our internal/testenv (with a modification to drop MustHaveExec because we don't really need it) so that we can check that git exists on the test platform before running tests that use this code because now we need a git binary to do git operations. For #61399 For #61341 Change-Id: I53441ee1638353a23935ba6a5ac70e2965b546f9 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/510415 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Jamal Carvalho <jamal@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> kokoro-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Michael Matloob <matloob@golang.org>
2023-07-12internal/stdlib: update to account for .0 major version suffixesRob Findley
Starting with go1.21.0, the first version of new major Go versions will include the .0 suffix (compare go1.20). Update pkgsite logic to account for this switch, and add unit+integration test support. Fixes golang/go#60373 Change-Id: Ibdac8a3413a48f925427a5aae366bed2f691cfa6 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/508937 Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org> TryBot-Result: kokoro <noreply+kokoro@google.com>
2022-01-13internal/stdlib: refactor go repo logicJonathan Amsterdam
Add a goRepo interface, implemented for remote, local and test repos. Functions of stdlib use a global instance that interface instead of if statements. Also, improve and rewrite some tests. For golang/go#50229 Change-Id: I73641813e6c7a6bb9667f44a672e37dce964b17a Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/378094 Trust: Jonathan Amsterdam <jba@google.com> Run-TryBot: Jonathan Amsterdam <jba@google.com> Reviewed-by: Jamal Carvalho <jamal@golang.org>