Commit Graph

78628 Commits

Author SHA1 Message Date
Taus
2158eaa34c Python: Fix a bug in glob regex creation
The previous version was tested on a version of the code where we had
temporarily removed the `glob.strip("/")` bit, and so the bug didn't
trigger then.

We now correctly remember if the glob ends in `/`, and add an extra part
in that case. This way, if the path ends with multiple slashes, they
effectively get consolidated into a single one, which results in the
correct semantics.
2025-05-15 15:34:11 +00:00
Taus
c8cca126a1 Python: Bump extractor version 2025-05-15 14:59:33 +00:00
Taus
72ae633a64 Python: Update change note and extractor config
Removes the previously added extractor option and updates the change
note to explain how to use `paths-ignore` to exclude files in hidden
directories.
2025-05-15 14:58:32 +00:00
Taus
96558b53b8 Python: Update test
The second test case now sets the `paths-ignore` setting in the config
file in order to skip files in hidden directories.
2025-05-15 14:53:15 +00:00
Taus
98388be25c Python: Remove special casing of hidden files
If it is necessary to exclude hidden files, then adding
```
paths-ignore: ['**/.*/**']
```
to the relevant config file is recommended instead.
2025-05-15 14:49:17 +00:00
Taus
61719cf448 Python: Fix a bug in glob conversion
If you have a filter like `**/foo/**` set in the `paths-ignore` bit of
your config file, then currently the following happens:

- First, the CodeQL CLI observes that this string ends in `/**` and
  strips off the `**` leaving `**/foo/`
- Then the Python extractor strips off leading and trailing `/`
  characters and proceeds to convert `**/foo` into a regex that is
  matched against files to (potentially) extract.

The trouble with this is that it leaves us unable to distinguish
between, say, a file `foo.py` and a file `foo/bar.py`. In other words,
we have lost the ability to exclude only the _folder_ `foo` and not any
files that happen to start with `foo`.

To fix this, we instead make a note of whether the glob ends in a
forward slash or not, and adjust the regex correspondingly.
2025-05-15 14:48:06 +00:00
Taus
2ded42c285 Python: Update extractor tests 2025-05-02 14:27:46 +00:00
Taus
67d04d5477 Python: Add change note 2025-05-02 14:27:46 +00:00
Taus
605f2bff9c Python: Add integration test 2025-05-02 14:27:46 +00:00
Taus
0c1b379ac1 Python: Extract files in hidden dirs by default
Changes the default behaviour of the Python extractor so files inside
hidden directories are extracted by default.

Also adds an extractor option, `skip_hidden_directories`, which can be
set to `true` in order to revert to the old behaviour.

Finally, I made the logic surrounding what is logged in various cases a
bit more obvious.

Technically this changes the behaviour of the extractor (in that hidden
excluded files will now be logged as `(excluded)`, but I think this
makes more sense anyway.
2025-05-02 12:44:05 +00:00
Paolo Tranquilli
abbf753a09 Merge pull request #19385 from github/redsun82/update-rules-kotlin
Bazel: update `rules_kotlin` to 2.1.3
2025-04-29 16:54:28 +02:00
Michael Nebel
f5a295c24e Merge pull request #19408 from michaelnebel/debug/removemodelgentag
C#/Java/Rust: Change the tag for the model generator debugging queries.
2025-04-29 15:21:18 +02:00
Joe Farebrother
299b3f7af4 Merge pull request #19325 from joefarebrother/python-qual-loop-var-capture
Python: Tweak LoopVariableCapture for performance
2025-04-29 13:49:09 +01:00
Michael Nebel
89fd9a4dd5 C#/Java/Rust: Change the tag for the model generator debugging queries. 2025-04-29 12:02:37 +02:00
Michael Nebel
e5d296180b Merge pull request #19396 from michaelnebel/csharp/equality-on-floats
C#: Add `cs/equality-on-floats` to the Code Quality suite.
2025-04-29 11:47:18 +02:00
Mathias Vorreiter Pedersen
daf953fabe Merge pull request #19404 from MathiasVP/cleanup-PropagateFlowConfig
Shared: Use `isSink/1` in `PropagateFlowConfig`
2025-04-29 10:30:01 +01:00
Nick Rolfe
d784473dcd Merge pull request #19400 from github/nickrolfe/rb-qhelp-tweak
Fix spelling/wording in qhelp for `rb/uninitialized-local-variable`
2025-04-29 09:43:58 +01:00
Tamás Vajk
1694050f37 Merge pull request #19390 from tamasvajk/test/cpp-python-query-suites
Add query suite inclusion tests for cpp, python
2025-04-29 10:26:40 +02:00
Asger F
6e64a22579 Merge pull request #19393 from asgerf/js/json-extractor-trailing-commas2
JS: Tolerate trailing commas in JSON objects
2025-04-29 09:40:38 +02:00
Tamás Vajk
e73031c688 Update cpp/ql/integration-tests/query-suite/not_included_in_qls.expected
Co-authored-by: Michael Nebel <michaelnebel@github.com>
2025-04-29 08:45:02 +02:00
Tamas Vajk
a408e216ae Add query suite inclusion tests for cpp, python 2025-04-29 08:45:01 +02:00
Jeroen Ketema
966b7463ee Merge pull request #19397 from jketema/use-after-free
C++: Add use-after-free FP tests
2025-04-29 08:32:44 +02:00
Mathias Vorreiter Pedersen
b91a2cc159 Shared: Use 'isSink/1' in 'PropagateFlowConfig'. 2025-04-28 17:36:37 +01:00
Nick Rolfe
50f7ee1158 Merge pull request #19401 from github/post-release-prep/codeql-cli-2.21.2
Post-release preparation for codeql-cli-2.21.2
2025-04-28 16:16:21 +01:00
github-actions[bot]
2e0699ab2b Post-release preparation for codeql-cli-2.21.2 2025-04-28 14:03:28 +00:00
Nick Rolfe
69bc12dd4f Fix spelling/wording in qhelp for rb/uninitialized-local-variable 2025-04-28 14:41:21 +01:00
Nick Rolfe
a46f8fb0d9 Merge pull request #19398 from github/nickrolfe/rm-erroneous-query
Java: Remove erroneously-committed query
2025-04-28 14:06:52 +01:00
Nick Rolfe
e3f33f192f Remove erroneously-committed query 2025-04-28 13:55:34 +01:00
Napalys Klicius
b4c98b40a5 Merge pull request #19364 from Napalys/js/aws_creds
JS: Improved modeling of `aws-sdk`
2025-04-28 14:18:03 +02:00
Jeroen Ketema
0bb0b5c587 C++: Add use-after-free FP tests 2025-04-28 14:13:14 +02:00
Napalys Klicius
73309fb9dd Updated modeling of aws-sdk with MaD 2025-04-28 14:00:12 +02:00
Napalys Klicius
654177daa7 Fixed naming acronyms to be PascalCase 2025-04-28 14:00:12 +02:00
Napalys Klicius
f7f9fb823a Updated takesConfigurationObject with API graphs 2025-04-28 14:00:12 +02:00
Napalys Klicius
42d5b80e81 Added support for AWS.Credentials hardcoded credentials 2025-04-28 14:00:12 +02:00
Napalys Klicius
f69037c176 Added ability to detect direct write to global AWS.config 2025-04-28 14:00:12 +02:00
Napalys Klicius
05e4677fd1 Added ability to detect new AWS.ServiceName cases with hardcoded credentials 2025-04-28 14:00:12 +02:00
Napalys Klicius
e6450a17ec Added test cases for individual AWS services, direct modification of global credentials and AWS.Credentials 2025-04-28 14:00:12 +02:00
Nick Rolfe
ded3865722 Merge pull request #19395 from github/release-prep/2.21.2
Release preparation for version 2.21.2
2025-04-28 12:57:36 +01:00
Nick Rolfe
ca7f8f21cd Tweak change-note for MaD model generation 2025-04-28 12:50:58 +01:00
Michael Nebel
f9d8be1ef7 C#: Add change note. 2025-04-28 13:41:06 +02:00
Michael Nebel
8bc965641a C#: Update integration tests expected output. 2025-04-28 13:38:15 +02:00
Michael Nebel
318bfc6d73 C#: Add cs/equality-on-floats to the code-quality suite. 2025-04-28 13:32:34 +02:00
Mathias Vorreiter Pedersen
f6e7d79f62 Merge pull request #19383 from MathiasVP/add-missing-predicate-to-mad-generation
C++: Fix missing summaries in MaD generation
2025-04-28 11:58:05 +01:00
github-actions[bot]
625354c46e Release preparation for version 2.21.2 2025-04-28 10:55:22 +00:00
Nick Rolfe
35939ec3b1 Merge pull request #19394 from github/nickrolfe/actions-change-note
Follow-up fixes to #19376
2025-04-28 11:46:14 +01:00
Nick Rolfe
b61a87a2a3 Update integration test to match update to security-and-quality suite 2025-04-28 11:26:07 +01:00
Michael Nebel
2d6457e4d3 C#: Set the precision of cs/equality-on-floats to high. 2025-04-28 11:45:12 +02:00
Mathias Vorreiter Pedersen
e942ec9964 C++: Fix annotations after #19311. 2025-04-28 10:39:11 +01:00
Mathias Vorreiter Pedersen
6466a5dbaf Merge branch 'main' into add-missing-predicate-to-mad-generation 2025-04-28 10:33:24 +01:00
Nick Rolfe
70a3fe3e33 Add YAML front matter to change note 2025-04-28 10:09:33 +01:00