Commit Graph

70439 Commits

Author SHA1 Message Date
Chris Smowton
bb44a2fc8c Populate pkgInfoMapping for test packages if relevant 2024-09-21 13:38:41 +01:00
Chris Smowton
bcb84a84e1 Only skip test packages at the file-extraction phase 2024-09-20 12:48:08 +01:00
Chris Smowton
f5ff822681 Convert extract-tests option to an official extractor option 2024-09-20 10:03:54 +01:00
Chris Smowton
94cb99e51d Adjust test expectations 2024-09-20 10:03:53 +01:00
Chris Smowton
9d79feb4d3 Autoformat go 2024-09-20 10:03:52 +01:00
Chris Smowton
eb6918f88f Autoformat 2024-09-20 10:03:51 +01:00
Chris Smowton
fd592fa18f Add tests 2024-09-20 10:03:46 +01:00
Chris Smowton
c3dffc955b Apply review comments 2024-09-20 09:56:29 +01:00
Chris Smowton
76e6942594 Go: support extracting test code
This implements support for test extraction by two mechanisms:

* In autobuild mode, setting `CODEQL_EXTRACTOR_GO_EXTRACT_TESTS` to `true`.
* In manual build mode, tracing a `go test` command (`go test -c` is to be recommended for efficiency).

Go deals with test compilation by creating several extra packages on top of those expected from inspection of the source code (see docs of `packages.Load` for more detail): packages whose IDs include a suffix like `mydomain.com/mypackage [mydomain.com/mypackage.test]`, and packages containing generated test driver code like `mydomain.com/mypackage.test`. There are also additional packages like `mydomain.com/mypackage_tests` which are explicitly present in source code, but not compiled by a normal `go build`.

So far as I can tell, the purpose of the two variants of the package is to resolve dependency cycles (because the tests variant of the package can have more dependencies than the non-tests variant, and non-test code can compile against non-test package variants). Since the test package variants seems to be a superset of the non-tests variant, I employ the simple heuristic of ignoring the variant of each package with the shortest ID. I haven't seen a case where there are three or more variants of a package, so I expect this to always identify the tests variant as the preferred one. If several variants were extracted, and we were to attempt to match Golang's linkage strategy among the different variants, we would need to extend trap-file name and most top-level symbol trap IDs with the package variant they come from; I hope this won't prove necessary.

"Real" `_tests` packages, and wholly synthetic driver code packages, are extracted just like normal.
2024-09-20 09:56:28 +01:00
Arthur Baars
594045b634 Merge pull request #17530 from github/redsun82/codegen-annotate
Codegen: allow full annotation of classes
2024-09-20 10:38:44 +02:00
Tom Hvitved
f2e943f9ba Merge pull request #17520 from hvitved/cfg/no-kind-graph
Shared: Do not use `@kind graph` for CFG test output
2024-09-20 10:10:05 +02:00
Paolo Tranquilli
74c0fa7154 Codegen: allow annotations to add class decorations 2024-09-20 08:40:34 +02:00
Paolo Tranquilli
cc5882a3c3 Codegen: allow full annotation of classes 2024-09-20 06:55:17 +02:00
Arthur Baars
cf5d56addf Merge pull request #17524 from github/revert-17514-redsun82/codegen-include
Revert "Codegen: allow to include `.py` files in `schema.py`"
2024-09-19 21:43:28 +02:00
Jeroen Ketema
a065434dd7 Merge pull request #16811 from porcupineyhairs/curlssl
CPP: Disabled SSL certificate verification
2024-09-19 20:02:17 +02:00
Porcupiney Hairs
ee41e65e90 Include changes from review 2024-09-19 22:52:20 +05:30
Tom Hvitved
16813240ae Shared: Do not use @kind graph for CFG test output 2024-09-19 18:13:31 +02:00
Florin Coada
ec74595671 Merge pull request #17511 from github/changedocs/2.19.0
Adding unified changelog for 2.19.0
2024-09-19 17:05:30 +01:00
Simon Friis Vindum
95c18ce431 Merge pull request #17498 from paldepind/rust-improve-cfg
Rust: Improve CFG
2024-09-19 17:33:30 +02:00
Paolo Tranquilli
97cca76970 Revert "Codegen: allow to include .py files in schema.py" 2024-09-19 16:58:20 +02:00
Paolo Tranquilli
6a540d833e Merge pull request #17523 from github/redsun82/rust-break-up-schema
Codegen/Rust: allow breaking up schema file
2024-09-19 16:57:58 +02:00
Chris Smowton
fe1081e880 Merge pull request #17510 from mbaluda/patch-1
Model summary for `org.springframework.core.io.getInputStream` methods
2024-09-19 15:47:31 +01:00
Chris Smowton
0deefaddc5 Merge pull request #17483 from smowton/smowton/feature/csharp-dataflow-fewer-nodes-including-virtual-dispatch
C#: Restrict dataflow node creation to source and source-referenced entities [virtual-dispatch-inclusive variant]
2024-09-19 15:33:47 +01:00
Florin Coada
0e828bb5da Merge branch 'main' into changedocs/2.19.0 2024-09-19 15:16:49 +01:00
Chris Smowton
bb82dc1b18 Change note 2024-09-19 15:12:11 +01:00
Chris Smowton
bc9eb993b8 Remove unnecessary fromSource conditions 2024-09-19 15:08:08 +01:00
Paolo Tranquilli
a5e3fbf367 Codegen/Rust: allow breaking up schema file 2024-09-19 15:57:42 +02:00
Simon Friis Vindum
19697b9a77 Merge branch 'main' into rust-improve-cfg 2024-09-19 15:53:41 +02:00
Arthur Baars
f38f818578 Merge pull request #17516 from github/redsun82/codegen-annotate
Codegen: allow to attach docstrings after the definition
2024-09-19 15:35:16 +02:00
Owen Mansel-Chan
682f08ceb9 Merge pull request #17515 from owen-mc/go/run-ci-when-shared-libs-change
Go: Run CI when shared libraries change
2024-09-19 14:28:44 +01:00
Simon Friis Vindum
db9f5fdf81 Rust: Handle nested if expressions, address review comments 2024-09-19 15:10:37 +02:00
Arthur Baars
3c09f70e0d Merge pull request #17502 from github/aibaars/rust-extract-ast
Rust: ast-based extractor
2024-09-19 14:13:25 +02:00
Simon Friis Vindum
2511986324 Rust: Address PR review comments 2024-09-19 14:11:58 +02:00
Arthur Baars
919a9002bc Merge pull request #17514 from github/redsun82/codegen-include
Codegen: allow to include `.py` files in `schema.py`
2024-09-19 13:22:49 +02:00
Arthur Baars
3aa47a3950 Rust: accept test changes 2024-09-19 13:13:18 +02:00
Arthur Baars
1c0f60fa2e Rust: lines of code, exclude 'SourceFile' node 2024-09-19 13:00:52 +02:00
Arthur Baars
24f24855f0 Rust: update expected output 2024-09-19 13:00:51 +02:00
Arthur Baars
e19bca0de8 Rust: remove queries that no longer work 2024-09-19 13:00:50 +02:00
Arthur Baars
c3b10bf90b Rust: patch cfg implementation 2024-09-19 13:00:49 +02:00
Arthur Baars
80d32a2333 Rust: re-generate code 2024-09-19 13:00:46 +02:00
Arthur Baars
9104c3fc81 Rust: re-generate schema and extractor 2024-09-19 13:00:45 +02:00
Arthur Baars
1f30d5f41b Rust: generate schema.py and extractor from ungrammar 2024-09-19 13:00:05 +02:00
Paolo Tranquilli
c117a53fb0 Codegen: allow to attach docstrings after the definition 2024-09-19 12:43:34 +02:00
Owen Mansel-Chan
f2fbe64137 Go: Run CI when shared libraries change 2024-09-19 11:32:46 +01:00
Paolo Tranquilli
ec9bb1da56 Codegen: allow to include .py files in schema.py 2024-09-19 12:18:52 +02:00
Tom Hvitved
4baa4ae2aa Merge pull request #17513 from owen-mc/fix-test-expectations
C#/Go: Fix test expectations including double space
2024-09-19 12:17:18 +02:00
Michael B. Gale
a5ab5d9236 Merge pull request #17422 from github/dependabot/go_modules/go/extractor/extractor-dependencies-f3a1f89f55 2024-09-19 11:02:34 +01:00
Owen Mansel-Chan
ded52ccb8e Fix test expectations including double space 2024-09-19 11:01:38 +01:00
Florin Coada
54632b289e Adding unified changelog for 2.19.0 2024-09-19 10:03:07 +01:00
Arthur Baars
61ac8d66f5 Rust: make things compile 2024-09-19 10:51:52 +02:00