Commit Graph

54887 Commits

Author SHA1 Message Date
Rasmus Wriedt Larsen
13ae98ea76 Python: Fix submodule exported under wrong name (when attribute clash) 2023-02-23 00:55:30 +01:00
Rasmus Wriedt Larsen
373907265b Python: Fixed most problems from last commit
That one line was an afterthought, and certainly did not work as
intended.
2023-02-23 00:39:45 +01:00
Rasmus Wriedt Larsen
97fefd2545 Python: Attempt to fix import flow
It's nice that it fixes the `InsecureProtocol` test-case (which maybe
should have been a test-case for the import resolution library in the
first place?)

But it's not quite right:

1. it adds spurious flow for `clashing_attr`
2. it runs into huge problems for typetracking_imports/tracked.expected
3. it runs into the problem for
   https://github.com/github/codeql/pull/10176 with an `from <pkg>
   import *` blocking flow from previously defined variable, that is NOT
   overridden. (simplistic_reexport.bar_attr)
2023-02-23 00:36:30 +01:00
Rasmus Wriedt Larsen
bea0acb497 Python: Add barrier test to import resolution
Just like the one added for `py/insecure-protocol` in fb425b7, but
instead added in the import-resolution tests, such that we don't have to
remember it's in a completely different directory.
2023-02-23 00:33:12 +01:00
Rasmus Wriedt Larsen
321a4b4ef2 Python: ModuleExport.ql test: ignore main.py
It's not very useful to look at, and it's a mess when you change any
tests to see all the changes lines in the expected output that you
really do not care about!
2023-02-23 00:31:05 +01:00
Taus
6a32a3ae58 QL: Add predicates for timestamps and locations 2023-02-22 22:47:51 +00:00
Mathias Vorreiter Pedersen
24935c97bc Merge pull request #12285 from github/calumgrant/ql-ra-parser
RA parser first draft
2023-02-22 19:07:03 +00:00
Chris Smowton
560a341e87 Fix multiple-candidate-builds message 2023-02-22 17:43:08 +00:00
Chris Smowton
c4640a6a9a Fix diagnostic markdown links 2023-02-22 17:43:08 +00:00
Chris Smowton
73e4480cc6 Update test expectations 2023-02-22 17:43:08 +00:00
Chris Smowton
2c216793a4 Diagnostics tests: don't create own diagnostics directory
The CLI does this now. Also omit default arguments to the integration test script.
2023-02-22 17:43:08 +00:00
Chris Smowton
53ac1e0133 Replace test absolute directory 2023-02-22 17:43:08 +00:00
Chris Smowton
57ac951451 Add tests for Java autobuilder errors 2023-02-22 17:43:08 +00:00
Chris Smowton
fd1ce5d12c Switch to using language-specific diagnostic environment variable 2023-02-22 17:43:08 +00:00
Chris Smowton
7a2c6b5645 Java no-build-system test: switch to single-file diagnostics.expected format 2023-02-22 17:43:07 +00:00
Chris Smowton
40e45d3636 Add test for missing Java build system 2023-02-22 17:43:07 +00:00
Chris Smowton
7dc5e7e0fe Merge pull request #12283 from github/smowton/admin/merge-rc38-into-main-2023
Merge rc/3.8 into main
2023-02-22 17:35:11 +00:00
Calum Grant
0fdcf0338a Tidy up warnings 2023-02-22 17:02:49 +00:00
Calum Grant
f3e5a8f90f Minor tidy 2023-02-22 17:01:07 +00:00
Calum Grant
9980756ee8 RA parser first draft 2023-02-22 16:51:16 +00:00
Paolo Tranquilli
62f4e48433 Swift: fix comments in PrintAst library 2023-02-22 16:46:46 +01:00
Mathias Vorreiter Pedersen
676f4125c3 Merge pull request #12282 from MathiasVP/float-and-array-padding
QL: Handle large numbers and -1 padding
2023-02-22 15:16:54 +00:00
Chris Smowton
9155e08b65 Merge remote-tracking branch 'origin/rc/3.8' into smowton/admin/merge-rc38-into-main-2023 2023-02-22 15:12:06 +00:00
Chris Smowton
2c7a2fc6d7 Merge pull request #12272 from smowton/smowton/admin/rc38-ci-fixes
Merge rc/3.7 into rc/3.8
2023-02-22 15:10:35 +00:00
Mathias Vorreiter Pedersen
498d0c359e QL: Convert various int getters to float (to avoid overflow) and correctly handle '-1' padding. 2023-02-22 14:54:40 +00:00
Rasmus Wriedt Larsen
8eaaf8e3e5 Python: Ignore trace.py in ModuleExport.ql test
I guess we could have done this at the very start of introducing this
test in this PR, but I think the last commit was mostly inspired from
looking at all the things that evidently was re-exported from the trace
import, even when I knew they were not available because of the
`__all__` definition.
2023-02-22 15:42:28 +01:00
Rasmus Wriedt Larsen
c8a76246d8 Python: Take __all__ into consideration for re-export of from <pkg> import *
However, we can see that `from <pkg> import *` and `import pkg` are
handled differently. Would have liked `has_defined_all_indirection` to
behave in the same way no matter how the import was made.
2023-02-22 15:39:57 +01:00
Rasmus Wriedt Larsen
be5812cf91 Python: from <pkg> import * ignores __all__ regression
Notice that `has_defined_all_indirection` all have both
`all_defined_bar_copy` and `all_defined_foo_copy` marked as exported,
even though only `all_defined_foo_copy` is available.
2023-02-22 15:38:24 +01:00
Mathias Vorreiter Pedersen
b738c2684b Merge pull request #12279 from MathiasVP/kind-predicate-logs
QL: Start of the AST for `kind: predicates` evaluator logs
2023-02-22 14:25:11 +00:00
Mathias Vorreiter Pedersen
5e3289a089 Merge pull request #12280 from github/tausbn/ql-make-json-parsing-a-bit-more-robust
QL: Make the JSON parser a bit more robust
2023-02-22 14:16:48 +00:00
Mathias Vorreiter Pedersen
d64d03ec48 QL: Fix Code Scanning warning. 2023-02-22 14:15:47 +00:00
Mathias Vorreiter Pedersen
f155f19725 QL: Respond to comments. 2023-02-22 14:15:18 +00:00
Rasmus Wriedt Larsen
d77ce4f3d7 Python: minor rewrite of from <pkg> import * handling 2023-02-22 15:00:55 +01:00
Rasmus Wriedt Larsen
4df7dfbff6 Python: Don't import module as module_attr
For `from <pkg> import <attr>` we would use to treat the `<pkg>`
(ImportExpr) as a definition of the name `<attr>`.

Since this removes bad import-flow, and nothing broke, I'm guessing this
was never intentional.
2023-02-22 14:52:35 +01:00
Rasmus Wriedt Larsen
6ba39d5fb3 Python: Add import regression for re-exported things 2023-02-22 14:50:42 +01:00
Taus
2cdec47585 QL: Make the JSON parser a bit more robust
Updates the grammar to allow trailing commas in objects and arrays.

Also bumps the file size limit to 10MB.
2023-02-22 13:45:47 +00:00
Mathias Vorreiter Pedersen
161acf0ebe QL: Add more getters. 2023-02-22 13:43:51 +00:00
Mathias Vorreiter Pedersen
2c31d6863c QL: Start on the AST for kind: predicates evaluator logs. 2023-02-22 13:26:47 +00:00
Michael B. Gale
93b7a2bc92 Fix: drop please 2023-02-22 12:32:11 +00:00
Michael B. Gale
c3e25d2549 Add docs link for missing Xamarin SDKs 2023-02-22 12:32:10 +00:00
Michael B. Gale
08b51c3b06 Link to docs for autobuild failures 2023-02-22 12:32:10 +00:00
Michael B. Gale
0f320996cf Make improvements based on PR feedback 2023-02-22 12:32:07 +00:00
Mathias Vorreiter Pedersen
5b1288143f Merge pull request #12277 from github/tausbn/clean-up-structured-logs-module
QL: Clean up structured logs module
2023-02-22 12:27:07 +00:00
Rasmus Wriedt Larsen
6a5eebe891 Python: Add test of module_export 2023-02-22 12:26:01 +01:00
Taus
5304fe2bcb QL: Clean up structured logs module
Pushes it into an internal module and removes the abstract class.
2023-02-22 11:07:48 +00:00
Jeroen Ketema
eb6c8480f8 Make "Detecting a potential buffer overflow" example more uniform
All queries that use SSA import `semmle.code.cpp.controlflow.SSA` explicitly,
except for the last one. Also import the library there. Note that this is not
strictly necessary, as the library is transitively imported via `import cpp`.
2023-02-22 10:02:12 +01:00
Mathias Vorreiter Pedersen
dffb12070e Merge pull request #12271 from github/tausbn/ql-fix-json-extraction
QL: Fix JSON extraction
2023-02-22 08:50:49 +00:00
Chris Smowton
b28f1a562a Merge pull request #12273 from intrigus-lgtm/patch-8
Fix grammar
2023-02-22 08:43:07 +00:00
Michael Nebel
47c69d924b C#: Update comment on the isSupported predicate. 2023-02-22 09:05:28 +01:00
Michael Nebel
b4a6d1e1b6 C#: Add change note. 2023-02-22 08:59:14 +01:00