Commit Graph

393 Commits

Author SHA1 Message Date
Owen Mansel-Chan
ba48eaa8a6 Factor out calculation of source dir 2023-04-19 12:20:50 +01:00
Owen Mansel-Chan
702c22b630 Refactor calculation of inLGTM 2023-04-19 12:20:49 +01:00
Owen Mansel-Chan
f0186957ca Factor out tryUpdateGoModAndGoSum 2023-04-19 12:20:49 +01:00
Owen Mansel-Chan
0bfb242e63 Factor out logic for needGopath 2023-04-19 12:20:49 +01:00
Owen Mansel-Chan
b169f1bfdf Factor out code to fix go vendor issues 2023-04-19 12:20:48 +01:00
Owen Mansel-Chan
f872a11b85 Factor out initial ModMode calculation 2023-04-19 12:20:48 +01:00
Owen Mansel-Chan
2d8d9773c4 Factor out depMode calculation 2023-04-19 12:20:47 +01:00
Owen Mansel-Chan
d613bc8a28 Update checks for files or dirs existing
The previous way is considered outdated now.
2023-04-19 12:20:47 +01:00
Owen Mansel-Chan
674799af8c Implement diagnostic for relative package paths 2023-03-10 12:20:44 +00:00
Owen Mansel-Chan
f87b307ddb The source name of a diagnostic should not change 2023-03-09 14:00:52 +00:00
Chris Smowton
db5bd98781 Return on failure to create file 2023-03-08 22:48:57 +00:00
Owen Mansel-Chan
820de5d36f Remove fatal/panic exits from diagnostic code 2023-03-08 22:00:34 +00:00
Owen Mansel-Chan
9fc119cc55 Rearrange diagnostic error message
The context should come in the middle and the call to action should come
last.
2023-03-08 17:09:52 +00:00
Owen Mansel-Chan
63d3b3ff2a Fix diagnostic-limit-reached visibility and location 2023-03-08 16:34:29 +00:00
Owen Mansel-Chan
0d6f17ec90 Do not use field internal, which is deprecated 2023-03-08 16:34:01 +00:00
Owen Mansel-Chan
17c550bc88 Address review comments 2023-03-08 15:51:45 +00:00
Owen Mansel-Chan
07098bf8bf Minor refactor in diagnostics.go 2023-03-07 16:38:53 +00:00
Owen Mansel-Chan
2edccec693 Do not link to GitHub AE version of documentation 2023-03-07 16:38:53 +00:00
Owen Mansel-Chan
05a4fdf6d8 Put all package-not-found errors into one diagnostic 2023-03-07 16:38:52 +00:00
Owen Mansel-Chan
a4c9120a9a Update one of the diagnostic messages 2023-03-07 16:38:52 +00:00
Owen Mansel-Chan
2c5239ff7b Use full stops at the end of diagnostics messages 2023-03-07 16:38:51 +00:00
Owen Mansel-Chan
a7a10de9ea Emit diagnostic to pass fourth integration tests 2023-03-07 16:38:51 +00:00
Owen Mansel-Chan
b6a9f87238 Use "go/autobuilder/" as prefix for all diagnostics 2023-03-07 16:38:50 +00:00
Owen Mansel-Chan
4907e5754f Address review comments 2023-03-07 16:38:49 +00:00
Owen Mansel-Chan
2a41e6ae66 Emit diagnostic to pass third inegration tests 2023-03-07 16:38:49 +00:00
Owen Mansel-Chan
c0cc1c3fd5 Emit diagnostic to pass second integration test 2023-03-07 16:38:48 +00:00
Owen Mansel-Chan
3f805d3456 Remove unused param from function 2023-03-07 16:38:48 +00:00
Owen Mansel-Chan
cbb2fb9968 Emit diagnostic to pass first integration test 2023-03-07 16:38:47 +00:00
Chris Smowton
7921de243a Fix DepErrors test
This was likely harmlessly causing `go get` reruns, since most (all?) real dependency errors cause `go list` to exit with a nonzero return code in any case.
2023-01-26 11:37:41 +00:00
Michael B. Gale
1ef1d63c11 Add test for parseGoVersion 2023-01-06 11:20:51 +00:00
Michael B. Gale
9af9b32722 Find the last line of output from go version 2023-01-06 11:20:39 +00:00
Owen Mansel-Chan
14e6f9fee2 Remove @errorexpr from the dbscheme (use @badexpr) 2022-12-14 10:46:19 +00:00
Gustav Munkby
b4382855fa Fallback to package dir for discovering go.mod
This reverts to the old behavior of reusing the package directory when looking for go.mod. It seems unlikely that this is the right thing to do since we failed to find the module directory, but this behavior should be consistent with what we had before.
2022-12-01 15:43:51 +01:00
Chris Smowton
b471926030 Autoformat 2022-11-29 17:17:39 +00:00
Gustav
256d8547c1 Fix copy-paste error 2022-11-21 12:29:16 +01:00
Gustav Munkby
a293239bd5 Accelerating go-extractor by using 'go list -deps'
Resurrect https://github.com/github/codeql-go/pull/554, but behind an environment variable as to avoid the broken builds noted in https://github.com/github/codeql/issues/9304, but still allowing some people to opt in to the much faster approach.
2022-11-15 10:30:56 +01:00
Gustav Munkby
279ba60eb1 Refactor package path extraction
In preparation for pulling all package information at once.
2022-11-15 10:10:39 +01:00
Gustav
3514694cdf Fix direct access to trap.Writer from trap.Labeler 2022-11-11 18:39:25 +01:00
Gustav
fea4b816af Fix double close
Co-authored-by: Chris Smowton <smowton@github.com>
2022-11-11 17:12:13 +01:00
Gustav
f659ee3e0b Go: Optimize trap.Writer by buffering gzip writes
The TRAP writer already buffers writes before emitting to file, but running gzip compression is also fairly costly (especially if you only do it a couple of bytes at a time). Thus, this injects another buffer that collects the emitted tuples in string form, and only triggers gzip compression once the buffer is full. In my local testing, this buffering was actually more beneficial than the one between gzip and file (likely because the gzip writer already emits data in chunks), but that one is still beneficial.
2022-11-11 13:07:30 +01:00
Chris Smowton
259b942fac Indent blocks that gofmt would mistake for markdown
As of go 1.19 it will try to format markdown nicely, but in both these cases the formatting isn't supposed to be interpreted this way, so indent it to make it a preformatted block.
2022-08-19 19:06:21 +01:00
Chris Smowton
16a2107f89 Go autobuilder: don't attempt a go mod tidy when there's a vendor directory present
This is likely to spuriously remove dependencies leading to a later build failure due to missing requirements.
2022-06-16 10:12:39 +01:00
Chuan-kai Lin
aa514fff32 codeql-go merge prep: move into go/ directory 2022-05-20 10:07:19 -07:00