Commit Graph

107 Commits

Author SHA1 Message Date
Paolo Tranquilli
00baccbc15 Go: autoformat 2024-05-02 17:08:23 +02:00
Paolo Tranquilli
76067cb12d Go: skip X:nocoverageredesign printing by autobuilder built with bazel 2024-05-02 17:02:48 +02:00
Michael B. Gale
73f71d8ace Merge pull request #15979 from github/mbg/go/deal-with-incorrect-versions 2024-03-28 14:16:14 +00:00
Michael B. Gale
be027e217e Go: Emit diagnostic for invalid toolchain versions 2024-03-19 16:26:06 +00:00
Michael B. Gale
2aa093c95c Go: Move getImportPath to shared util package 2024-03-05 12:48:19 +00:00
Michael B. Gale
52b273ae23 Go: Include workspace count in success message 2024-03-04 12:14:24 +00:00
Michael B. Gale
8055c5d9e3 Go: Avoid extra loop to track unsuccessfulProjects 2024-03-04 12:14:23 +00:00
Michael B. Gale
4d28c0d2a9 Go: Call go mod vendor to synchronise vendor directory when it exists 2024-02-15 16:19:07 +00:00
Michael B. Gale
6267506a77 Go: Postpone go.mod creation until necessary 2024-02-14 19:12:36 +00:00
Michael B. Gale
e2c673417f Go: Only call EmitNewerGoVersionNeeded at most once 2024-02-14 19:12:35 +00:00
Michael B. Gale
251888a0bd Go: Tell extractor to extract subdirectories as well 2024-02-14 19:12:33 +00:00
Michael B. Gale
843f7694fd Go: Only relocate project to temp dir if there is only one workspace 2024-02-14 19:12:32 +00:00
Michael B. Gale
f084829154 Go: Only fail autobuilder if all projects cannot be extracted 2024-02-14 19:12:31 +00:00
Michael B. Gale
fbd7946cfd Go: Fall back to ./... if there are no modules
Fixes issues for `dep` and `glide`
2024-02-14 19:12:31 +00:00
Michael B. Gale
51eb487022 Go: Handle filepath.Rel failure 2024-02-14 19:12:30 +00:00
Michael B. Gale
c96735e17a Go: Remove auto-generated go.mod files when done 2024-02-14 19:12:30 +00:00
Michael B. Gale
aa5e14f59f Go: Replace BuildInfo with GoWorkspace 2024-02-14 19:12:28 +00:00
Michael B. Gale
1bf747ef3a Go: Create go.mod file if necessary in project discovery 2024-02-14 19:12:27 +00:00
Michael B. Gale
254634075f Go: Add shared TidyModule function 2024-02-14 19:12:26 +00:00
Michael B. Gale
fc75e44238 Go: Allow GetBuildInfo to return multiple BuildInfo objects 2024-02-14 19:12:26 +00:00
Michael B. Gale
237bf5653a Go: Move getEnvGoSemVer to toolchain.go 2024-02-14 19:12:25 +00:00
Michael B. Gale
bd36847ca2 Go: Emit relative path import diagnostic if prompted by go mod tidy
The corresponding integration test now successfully extracts the project
2024-02-14 19:12:25 +00:00
Michael B. Gale
df212807a0 Go: Try to initialise go.mod file for legacy projects 2024-02-14 19:12:24 +00:00
Michael B. Gale
90eba711a3 Go: Include versions in newer Go version log message 2024-01-31 17:45:58 +00:00
Michael B. Gale
84baea5df2 Go: Include versions in newer Go version needed diagnostic 2024-01-31 13:29:53 +00:00
Michael B. Gale
cf1aab0157 Go: Move identify environment code to separate file 2024-01-23 13:59:34 +00:00
Michael B. Gale
ee36e7424a Go: Move project analysis code to separate file 2024-01-23 13:59:33 +00:00
Michael B. Gale
0dc3c847bc Go: Move go invocations to separate file 2024-01-23 13:59:33 +00:00
Chris Smowton
7e96eaa273 Log advice when a newer Go version is required under Actions 2024-01-23 10:49:52 +00:00
Michael B. Gale
8c13429163 Go: Ensure getEnvGoSemVer returns a canonical SemVer 2024-01-15 14:20:48 +00:00
Michael B. Gale
a64c001637 Go: Remove unnecessary call to Canonical 2024-01-15 14:19:55 +00:00
Michael B. Gale
42dcb5f94d Go: Better handle pre-release versions 2024-01-15 14:00:56 +00:00
Michael B. Gale
01a1d814f4 Do not call EmitNewerGoVersionNeeded for v1.21+ 2023-10-06 11:57:37 +01:00
Michael B. Gale
c63f6807c4 Go: Run go version with GOTOOLCHAIN=local 2023-10-06 11:57:26 +01:00
Michael B. Gale
76781e5d75 Go: Add GoVersionInfo type
Refactors `tryReadGoDirective` to return this instead of a pair.
This will make it easier to return multiple versions.
2023-10-06 11:57:08 +01:00
Michael B. Gale
d7278be064 Go: Update versionRe to include patch version
This is optional
2023-09-15 16:50:24 +01:00
Michael B. Gale
a1c9deea61 Merge pull request #13867 from github/mbg/go/1.21-support
Go: Basic Go 1.21 support
2023-08-18 14:37:11 +01:00
Chris Smowton
3bcfbcdf68 Don't warn when Go version exactly matches go.mod
We had only previously tested this with e.g. installed go 1.20.5 >= go.mod request `go 1.20`; now we have go 1.21.0 which shouldn't elicit a warning because 1.21.0 is equal to the go.mod request `go 1.21`.
2023-08-15 16:49:42 +01:00
Michael B. Gale
14731e8fa3 Bump supported Go version to 1.21 2023-08-11 10:57:10 +01:00
Owen Mansel-Chan
5864bdc1af Modify buildInfo inside function fixGoVendorIssues 2023-06-30 11:02:24 +01:00
Owen Mansel-Chan
6c89c60900 Put DepMode, ModMode and BaseDir into a struct 2023-06-30 11:00:16 +01:00
Owen Mansel-Chan
8269bffbdb Use filepath.Join more 2023-06-29 16:56:41 +01:00
Owen Mansel-Chan
bbbdc47dd5 Preserve behaviour for nested go.mods when one is in root 2023-06-29 16:56:32 +01:00
Owen Mansel-Chan
ae7adc999c Rename return variable 2023-06-29 16:56:29 +01:00
Owen Mansel-Chan
964ca33445 Fix cases where we can't yet use go.mod 2023-06-29 16:56:24 +01:00
Owen Mansel-Chan
c766f68b93 Fix bug detecting if go.mod files are nested 2023-06-29 16:56:20 +01:00
Owen Mansel-Chan
1a80ba0821 Name return values of findGoModFiles 2023-06-29 16:56:17 +01:00
Owen Mansel-Chan
a852173e22 Fix behaviour for single non-root go.mod
Also add telemetry so we can prioritise future work on the autobuilder.
2023-06-29 16:56:11 +01:00
Owen Mansel-Chan
e43fd72fc1 Fix log message about Glide 2023-06-29 16:56:09 +01:00
Owen Mansel-Chan
55fe318f5a Merge pull request #13397 from owen-mc/go/document-build-environment-recommendations
Add Go version table for --identify-environment
2023-06-07 17:06:13 +01:00