Skip to content

Commit a9e1e72

Browse files
committed
Merge branch 'main' into shared-http-client-request
2 parents 528ef0e + 6674e07 commit a9e1e72

File tree

1,425 files changed

+125558
-17640
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,425 files changed

+125558
-17640
lines changed

.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ documentation:
4242

4343
"QL-for-QL":
4444
- ql/**/*
45+
- .github/workflows/ql-for-ql*

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
# uses a compiled language
5757

5858
- run: |
59-
dotnet build csharp /p:UseSharedCompilation=false
59+
dotnet build csharp
6060
6161
- name: Perform CodeQL Analysis
6262
uses: github/codeql-action/analyze@main

.github/workflows/go-tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
name: Test Linux (Ubuntu)
1212
runs-on: ubuntu-latest
1313
steps:
14-
- name: Set up Go 1.18.1
14+
- name: Set up Go 1.19
1515
uses: actions/setup-go@v3
1616
with:
17-
go-version: 1.18.1
17+
go-version: 1.19
1818
id: go
1919

2020
- name: Check out code
@@ -57,10 +57,10 @@ jobs:
5757
name: Test MacOS
5858
runs-on: macos-latest
5959
steps:
60-
- name: Set up Go 1.18.1
60+
- name: Set up Go 1.19
6161
uses: actions/setup-go@v3
6262
with:
63-
go-version: 1.18.1
63+
go-version: 1.19
6464
id: go
6565

6666
- name: Check out code
@@ -87,10 +87,10 @@ jobs:
8787
name: Test Windows
8888
runs-on: windows-2019
8989
steps:
90-
- name: Set up Go 1.18.1
90+
- name: Set up Go 1.19
9191
uses: actions/setup-go@v3
9292
with:
93-
go-version: 1.18.1
93+
go-version: 1.19
9494
id: go
9595

9696
- name: Check out code

.github/workflows/ql-for-ql-build.yml

Lines changed: 58 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ on:
55
branches: [main]
66
pull_request:
77
branches: [main]
8+
paths:
9+
- "ql/**"
10+
- "**.qll"
11+
- "**.ql"
12+
- "**.dbscheme"
13+
- "**/qlpack.yml"
14+
- ".github/workflows/ql-for-ql-build.yml"
815

916
env:
1017
CARGO_TERM_COLOR: always
@@ -17,7 +24,7 @@ jobs:
1724
- uses: actions/checkout@v3
1825
- name: Find codeql
1926
id: find-codeql
20-
uses: github/codeql-action/init@aa93aea877e5fb8841bcb1193f672abf6e9f2980
27+
uses: github/codeql-action/init@71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca
2128
with:
2229
languages: javascript # does not matter
2330
- name: Get CodeQL version
@@ -27,31 +34,37 @@ jobs:
2734
shell: bash
2835
env:
2936
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
37+
- name: Cache entire pack
38+
id: cache-pack
39+
uses: actions/cache@v3
40+
with:
41+
path: ${{ runner.temp }}/pack
42+
key: ${{ runner.os }}-pack-${{ hashFiles('ql/**/Cargo.lock') }}-${{ hashFiles('ql/**/*.rs') }}-${{ hashFiles('ql/**/*.ql*') }}-${{ hashFiles('ql/**/qlpack.yml') }}-${{ hashFiles('ql/ql/src/ql.dbscheme*') }}-${{ steps.get-codeql-version.outputs.version }}--${{ hashFiles('.github/workflows/ql-for-ql-build.yml') }}
3043
- name: Cache queries
44+
if: steps.cache-pack.outputs.cache-hit != 'true'
3145
id: cache-queries
3246
uses: actions/cache@v3
3347
with:
34-
path: ${{ runner.temp }}/query-pack.zip
35-
key: queries-${{ hashFiles('ql/**/*.ql*') }}-${{ hashFiles('ql/**/qlpack.yml') }}-${{ hashFiles('ql/ql/src/ql.dbscheme*') }}-${{ steps.get-codeql-version.outputs.version }}
48+
path: ${{ runner.temp }}/queries
49+
key: queries-${{ hashFiles('ql/**/*.ql*') }}-${{ hashFiles('ql/**/qlpack.yml') }}-${{ hashFiles('ql/ql/src/ql.dbscheme*') }}-${{ steps.get-codeql-version.outputs.version }}--${{ hashFiles('.github/workflows/ql-for-ql-build.yml') }}
3650
- name: Build query pack
37-
if: steps.cache-queries.outputs.cache-hit != 'true'
51+
if: steps.cache-queries.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
3852
run: |
3953
cd ql/ql/src
40-
"${CODEQL}" pack create
41-
cd .codeql/pack/codeql/ql/0.0.0
42-
zip "${PACKZIP}" -r .
43-
rm -rf *
54+
"${CODEQL}" pack create -j 16
55+
mv .codeql/pack/codeql/ql/0.0.0 ${{ runner.temp }}/queries
56+
env:
57+
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
58+
- name: Move cache queries to pack
59+
if: steps.cache-pack.outputs.cache-hit != 'true'
60+
run: |
61+
cp -r ${{ runner.temp }}/queries ${{ runner.temp }}/pack
4462
env:
4563
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
46-
PACKZIP: ${{ runner.temp }}/query-pack.zip
47-
- name: Upload query pack
48-
uses: actions/upload-artifact@v3
49-
with:
50-
name: query-pack-zip
51-
path: ${{ runner.temp }}/query-pack.zip
5264

5365
### Build the extractor ###
5466
- name: Cache entire extractor
67+
if: steps.cache-pack.outputs.cache-hit != 'true'
5568
id: cache-extractor
5669
uses: actions/cache@v3
5770
with:
@@ -62,7 +75,7 @@ jobs:
6275
ql/target/release/ql-extractor.exe
6376
key: ${{ runner.os }}-extractor-${{ hashFiles('ql/**/Cargo.lock') }}-${{ hashFiles('ql/**/*.rs') }}
6477
- name: Cache cargo
65-
if: steps.cache-extractor.outputs.cache-hit != 'true'
78+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
6679
uses: actions/cache@v3
6780
with:
6881
path: |
@@ -71,108 +84,75 @@ jobs:
7184
ql/target
7285
key: ${{ runner.os }}-rust-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
7386
- name: Check formatting
74-
if: steps.cache-extractor.outputs.cache-hit != 'true'
87+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
7588
run: cd ql; cargo fmt --all -- --check
7689
- name: Build
77-
if: steps.cache-extractor.outputs.cache-hit != 'true'
90+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
7891
run: cd ql; cargo build --verbose
7992
- name: Run tests
80-
if: steps.cache-extractor.outputs.cache-hit != 'true'
93+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
8194
run: cd ql; cargo test --verbose
8295
- name: Release build
83-
if: steps.cache-extractor.outputs.cache-hit != 'true'
96+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
8497
run: cd ql; cargo build --release
8598
- name: Generate dbscheme
86-
if: steps.cache-extractor.outputs.cache-hit != 'true'
99+
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
87100
run: ql/target/release/ql-generator --dbscheme ql/ql/src/ql.dbscheme --library ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll
88-
- uses: actions/upload-artifact@v3
89-
with:
90-
name: extractor-ubuntu-latest
91-
path: |
92-
ql/target/release/ql-autobuilder
93-
ql/target/release/ql-autobuilder.exe
94-
ql/target/release/ql-extractor
95-
ql/target/release/ql-extractor.exe
96-
retention-days: 1
97101

98102
### Package the queries and extractor ###
99-
- uses: actions/download-artifact@v3
100-
with:
101-
name: query-pack-zip
102-
path: query-pack-zip
103-
- uses: actions/download-artifact@v3
104-
with:
105-
name: extractor-ubuntu-latest
106-
path: linux64
107-
- run: |
108-
unzip query-pack-zip/*.zip -d pack
109-
cp -r ql/codeql-extractor.yml ql/tools ql/ql/src/ql.dbscheme.stats pack/
110-
mkdir -p pack/tools/linux64
111-
if [[ -f linux64/ql-autobuilder ]]; then
112-
cp linux64/ql-autobuilder pack/tools/linux64/autobuilder
113-
chmod +x pack/tools/linux64/autobuilder
114-
fi
115-
if [[ -f linux64/ql-extractor ]]; then
116-
cp linux64/ql-extractor pack/tools/linux64/extractor
117-
chmod +x pack/tools/linux64/extractor
118-
fi
119-
cd pack
120-
zip -rq ../codeql-ql.zip .
121-
rm -rf *
122-
- uses: actions/upload-artifact@v3
123-
with:
124-
name: codeql-ql-pack
125-
path: codeql-ql.zip
126-
retention-days: 1
127-
128-
### Run the analysis ###
129-
- name: Download pack
130-
uses: actions/download-artifact@v3
131-
with:
132-
name: codeql-ql-pack
133-
path: ${{ runner.temp }}/codeql-ql-pack-artifact
134-
135-
- name: Prepare pack
103+
- name: Package pack
104+
if: steps.cache-pack.outputs.cache-hit != 'true'
136105
run: |
137-
unzip "${PACK_ARTIFACT}/*.zip" -d "${PACK}"
106+
cp -r ql/codeql-extractor.yml ql/tools ql/ql/src/ql.dbscheme.stats ${PACK}/
107+
mkdir -p ${PACK}/tools/linux64
108+
cp ql/target/release/ql-autobuilder ${PACK}/tools/linux64/autobuilder
109+
cp ql/target/release/ql-extractor ${PACK}/tools/linux64/extractor
110+
chmod +x ${PACK}/tools/linux64/autobuilder
111+
chmod +x ${PACK}/tools/linux64/extractor
138112
env:
139-
PACK_ARTIFACT: ${{ runner.temp }}/codeql-ql-pack-artifact
140113
PACK: ${{ runner.temp }}/pack
114+
115+
### Run the analysis ###
141116
- name: Hack codeql-action options
142117
run: |
143-
JSON=$(jq -nc --arg pack "${PACK}" '.database."run-queries"=["--search-path", $pack] | .resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .database.init=["--search-path", $pack]')
118+
JSON=$(jq -nc --arg pack "${PACK}" '.database."run-queries"=["--search-path", $pack] | .resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .resolve.languages=["--search-path", $pack] | .database.init=["--search-path", $pack]')
144119
echo "CODEQL_ACTION_EXTRA_OPTIONS=${JSON}" >> ${GITHUB_ENV}
145120
env:
146121
PACK: ${{ runner.temp }}/pack
147122

148123
- name: Create CodeQL config file
149124
run: |
150125
echo "paths-ignore:" >> ${CONF}
151-
echo " - ql/ql/test" >> ${CONF}
152-
echo " - \"*/ql/lib/upgrades/\"" >> ${CONF}
126+
echo " - ql/ql/test" >> ${CONF}
127+
echo " - \"*/ql/lib/upgrades/\"" >> ${CONF}
153128
echo "disable-default-queries: true" >> ${CONF}
154-
echo "packs:" >> ${CONF}
155-
echo " - codeql/ql" >> ${CONF}
129+
echo "queries:" >> ${CONF}
130+
echo " - uses: ./ql/ql/src/codeql-suites/ql-code-scanning.qls" >> ${CONF}
156131
echo "Config file: "
157132
cat ${CONF}
158-
env:
133+
env:
159134
CONF: ./ql-for-ql-config.yml
160135
- name: Initialize CodeQL
161-
uses: github/codeql-action/init@aa93aea877e5fb8841bcb1193f672abf6e9f2980
136+
uses: github/codeql-action/init@71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca
162137
with:
163138
languages: ql
164139
db-location: ${{ runner.temp }}/db
165140
config-file: ./ql-for-ql-config.yml
141+
- name: Move pack cache
142+
run: |
143+
cp -r ${PACK}/.cache ql/ql/src/.cache
144+
env:
145+
PACK: ${{ runner.temp }}/pack
166146

167147
- name: Perform CodeQL Analysis
168-
uses: github/codeql-action/analyze@aa93aea877e5fb8841bcb1193f672abf6e9f2980
169-
with:
148+
uses: github/codeql-action/analyze@71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca
149+
with:
170150
category: "ql-for-ql"
171151
- name: Copy sarif file to CWD
172152
run: cp ../results/ql.sarif ./ql-for-ql.sarif
173153
- name: Fixup the $scema in sarif # Until https://github.com/microsoft/sarif-vscode-extension/pull/436/ is part in a stable release
174154
run: |
175-
sed -i 's/\$schema.*/\$schema": "https:\/\/raw.githubusercontent.com\/oasis-tcs\/sarif-spec\/master\/Schemata\/sarif-schema-2.1.0",/' ql-for-ql.sarif
155+
sed -i 's/\$schema.*/\$schema": "https:\/\/raw.githubusercontent.com\/oasis-tcs\/sarif-spec\/master\/Schemata\/sarif-schema-2.1.0",/' ql-for-ql.sarif
176156
- name: Sarif as artifact
177157
uses: actions/upload-artifact@v3
178158
with:

.github/workflows/ql-for-ql-dataset_measure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
- name: Find codeql
2727
id: find-codeql
28-
uses: github/codeql-action/init@aa93aea877e5fb8841bcb1193f672abf6e9f2980
28+
uses: github/codeql-action/init@71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca
2929
with:
3030
languages: javascript # does not matter
3131
- uses: actions/cache@v3

.github/workflows/ql-for-ql-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- uses: actions/checkout@v3
2323
- name: Find codeql
2424
id: find-codeql
25-
uses: github/codeql-action/init@aa93aea877e5fb8841bcb1193f672abf6e9f2980
25+
uses: github/codeql-action/init@71a8b35ff4c80fcfcd05bc1cd932fe3c08f943ca
2626
with:
2727
languages: javascript # does not matter
2828
- uses: actions/cache@v3

config/identical-files.json

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,6 @@
463463
],
464464
"SSA C#": [
465465
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/SsaImplCommon.qll",
466-
"csharp/ql/lib/semmle/code/csharp/controlflow/internal/pressa/SsaImplCommon.qll",
467-
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/basessa/SsaImplCommon.qll",
468-
"csharp/ql/lib/semmle/code/cil/internal/SsaImplCommon.qll",
469466
"ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImplCommon.qll",
470467
"cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/SsaImplCommon.qll",
471468
"swift/ql/lib/codeql/swift/dataflow/internal/SsaImplCommon.qll"
@@ -585,22 +582,22 @@
585582
],
586583
"Swift declarations test file": [
587584
"swift/ql/test/extractor-tests/declarations/declarations.swift",
588-
"swift/ql/test/library-tests/parent/declarations.swift"
585+
"swift/ql/test/library-tests/ast/declarations.swift"
589586
],
590587
"Swift statements test file": [
591588
"swift/ql/test/extractor-tests/statements/statements.swift",
592-
"swift/ql/test/library-tests/parent/statements.swift"
589+
"swift/ql/test/library-tests/ast/statements.swift"
593590
],
594591
"Swift expressions test file": [
595592
"swift/ql/test/extractor-tests/expressions/expressions.swift",
596-
"swift/ql/test/library-tests/parent/expressions.swift"
593+
"swift/ql/test/library-tests/ast/expressions.swift"
597594
],
598595
"Swift patterns test file": [
599596
"swift/ql/test/extractor-tests/patterns/patterns.swift",
600-
"swift/ql/test/library-tests/parent/patterns.swift"
597+
"swift/ql/test/library-tests/ast/patterns.swift"
601598
],
602599
"IncompleteMultiCharacterSanitization JS/Ruby": [
603600
"javascript/ql/lib/semmle/javascript/security/IncompleteMultiCharacterSanitizationQuery.qll",
604601
"ruby/ql/lib/codeql/ruby/security/IncompleteMultiCharacterSanitizationQuery.qll"
605602
]
606-
}
603+
}

cpp/ql/lib/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 0.3.4
2+
3+
### Deprecated APIs
4+
5+
* Many classes/predicates/modules with upper-case acronyms in their name have been renamed to follow our style-guide.
6+
The old name still exists as a deprecated alias.
7+
8+
### New Features
9+
10+
* Added support for getting the link targets of global and namespace variables.
11+
* Added a `BlockAssignExpr` class, which models a `memcpy`-like operation used in compiler generated copy/move constructors and assignment operations.
12+
13+
### Minor Analysis Improvements
14+
15+
* All deprecated predicates/classes/modules that have been deprecated for over a year have been deleted.
16+
117
## 0.3.3
218

319
### New Features

cpp/ql/lib/change-notes/2022-08-12-block-assignment-support.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

cpp/ql/lib/change-notes/2022-08-17-deleted-deprecations.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)