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
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
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
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
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
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
Owen Mansel-Chan
347b5f1b1a
Remove unused code
2023-05-03 16:03:17 +01:00
Owen Mansel-Chan
509dda5af5
Use raw string literals to avoid double-escaping
2023-05-03 16:02:36 +01:00
Owen Mansel-Chan
841db151f6
Improve naming
2023-05-03 13:01:23 +01:00
Owen Mansel-Chan
0f134c6a3c
Wrap long line
2023-05-03 12:52:11 +01:00
Owen Mansel-Chan
f86e540d2a
msg is always non-empty
2023-05-03 12:50:58 +01:00
Owen Mansel-Chan
af2a9b21ab
Add function comments
2023-05-03 12:47:28 +01:00
Owen Mansel-Chan
4b88279ccc
Improve usage message formatting
2023-05-03 12:03:11 +01:00
Owen Mansel-Chan
27fb42db76
Env var for path to environment file
2023-05-03 11:11:09 +01:00
Owen Mansel-Chan
0c6efb8c84
Add telemetry-only diagnostics
2023-05-02 17:17:06 +01:00
Owen Mansel-Chan
0710ed97db
Refactor to be more easily testable
2023-05-02 17:17:05 +01:00
Owen Mansel-Chan
2db304edee
Choose which version to install and write file
2023-05-02 17:17:04 +01:00
Owen Mansel-Chan
644d7f18c2
Factor out tryReadGoDirective()
2023-05-02 14:15:03 +01:00
Owen Mansel-Chan
5e87111a8b
Stop using deprecate io/ioutil package
2023-05-02 14:15:02 +01:00
Owen Mansel-Chan
1e2bdd88b1
Add --identify-environment flag
2023-05-02 14:15:01 +01:00
Owen Mansel-Chan
1afe845ed3
Add missing "v" to semver version string
...
Because it was missing, that function always returned +1,
so we were doing the wrong thing when the Go version
installed was lower than 1.16.
2023-04-24 14:31:46 +01:00
Owen Mansel-Chan
3ca04338ca
Use named initialization for struct
2023-04-19 13:06:51 +01:00
Owen Mansel-Chan
219c1686fd
Wrap return values of moveToTemporaryGopath in a struct
2023-04-19 12:40:23 +01:00
Owen Mansel-Chan
1bb006f43e
Move defer statements to the right place
...
It turns out that extracting defer statements into a separate function
changes behaviour.
2023-04-19 12:20:52 +01:00