419 Commits

Author SHA1 Message Date
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
Henry Mercer
f3847b3f51 Merge branch 'main' into henrymercer/rc-3.11-mergeback 2023-10-03 16:30:23 +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
3b708993c7 Go: Add diagnostic for 1.21 toolchain error 2023-09-07 11:51:20 +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
a7469ce4f1 Use Origin() 2023-07-17 16:11:25 +01:00
Owen Mansel-Chan
a2a2e93cfd Fix printing when one obj is nil 2023-07-15 07:06:16 +01:00
Owen Mansel-Chan
cff09d28b8 Test if Origin() works (for Var and Func) 2023-07-14 13:52:50 +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
a0f470b01a Change bazel check to look in subdirs 2023-06-29 16:56:15 +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
8726b3a00e Change how we deal with singular/plural 2023-06-29 16:56:07 +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
Owen Mansel-Chan
69854638b6 Add Go version table for --identify-environment 2023-06-07 15:51:21 +01:00
Michael B. Gale
631ba6584d Go: Update identify-environment JSON format
The spec changed after this was implemented and merged
2023-05-26 10:13:40 +01:00
Owen Mansel-Chan
1a9bd9ccde Merge pull request #13135 from owen-mc/go/fix-unit-test
Go: fix unit test
2023-05-16 07:50:50 +01:00
Owen Mansel-Chan
760ba82c7a Fix unit tests 2023-05-11 16:40:59 +01:00
Owen Mansel-Chan
1beb348d95 Fix outdated message 2023-05-11 14:29:14 +01:00
Owen Mansel-Chan
02a224c28f --identify-environment should write json to stdout 2023-05-11 14:29:14 +01:00
Owen Mansel-Chan
b306807046 Merge pull request #13040 from owen-mc/go/identify-environment-change-logic
Go: change logic in `go-autobuilder --identify-environment`
2023-05-11 08:22:01 +01:00
Owen Mansel-Chan
9334cfb22c Change logic when go mod version above max supported version 2023-05-10 21:56:56 +01:00
Owen Mansel-Chan
9c5fc9714a Use "Requesting" instead of "Writing environment file" 2023-05-10 21:53:10 +01:00
Owen Mansel-Chan
97ec7a07eb Address review comments 2023-05-10 15:53:08 +01:00
Owen Mansel-Chan
50d3cffe61 Accept review comments 2023-05-10 13:28:11 +01:00
Owen Mansel-Chan
fcf3cb7ea4 Update "go/autobuilder/package-not-found" message 2023-05-10 12:24:03 +01:00
Owen Mansel-Chan
375be68492 Fix diagnostics 2023-05-10 11:12:48 +01:00
Owen Mansel-Chan
edebebf603 Refactor for clarity 2023-05-10 11:12:47 +01:00
Owen Mansel-Chan
f9d2467eaa Downgrade package-not-found diagnostic to warning
error is reserved for when the build fails.
2023-05-10 09:58:58 +01:00
Owen Mansel-Chan
12f996ff56 Deal better with goModVersion < minGoVersion 2023-05-10 09:45:48 +01:00
Owen Mansel-Chan
32b5df69c3 Add comments explaining version choice logic 2023-05-10 09:26:18 +01:00
Owen Mansel-Chan
d329da673a Refactor logic for which version to install
This does not change the version returned. In the case the the go mod
version is supported and the go env version is below goMinVersion, the
message now talks about go env version being unsupported instead of
it being less than go mod version. This seems more sensible to me.
2023-05-05 15:44:55 +01:00
Owen Mansel-Chan
3f7a230a11 Sometimes install Go version even when one exists 2023-05-05 15:44:54 +01:00
Owen Mansel-Chan
bb3101e649 Merge pull request #13022 from owen-mc/go/identify-environment-fixes
Go: `go-autobuilder --identify-environment` fixes
2023-05-04 14:30:31 +01:00
Owen Mansel-Chan
011c9272cf Remove inconsistent line break in message 2023-05-04 10:33:05 +01:00
Owen Mansel-Chan
c21b1a6e3b Be clear when no Go version in environment file 2023-05-04 10:32:21 +01:00
Owen Mansel-Chan
5d06adb1e6 Only check if go env version is supported if go mod version is supported
This is what I meant to implement in the first place.
2023-05-04 10:24:43 +01:00
Owen Mansel-Chan
62653fbec5 Simplify return statements in tryReadGoDirective
This makes it easier to reason about what is returned and would have
avoided the bug with variable shadowing.
2023-05-03 16:55:19 +01:00
Owen Mansel-Chan
d30b736eb2 Move check for EmitNewerGoVersionNeeded diagnostic
This should only be done when --identify-environment has not been passed
2023-05-03 16:52:48 +01:00
Owen Mansel-Chan
afb692300a Fix typo in field name 2023-05-03 16:46:44 +01:00
Owen Mansel-Chan
742a6d9264 Fix accidental variable shadowing 2023-05-03 16:32:53 +01:00