Skip to content

Commit 634087b

Browse files
committed
Merge branch 'main' into rbPoly
2 parents 80d05c0 + f07c598 commit 634087b

File tree

871 files changed

+114873
-10913
lines changed

Some content is hidden

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

871 files changed

+114873
-10913
lines changed

.github/actions/find-latest-bundle/action.yml

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

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ updates:
55
schedule:
66
interval: "daily"
77

8+
- package-ecosystem: "cargo"
9+
directory: "ql"
10+
schedule:
11+
interval: "daily"
12+
813
- package-ecosystem: "github-actions"
914
directory: "/"
1015
schedule:

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828

2929
steps:
3030
- name: Setup dotnet
31-
uses: actions/setup-dotnet@v2
31+
uses: actions/setup-dotnet@v3
3232
with:
33-
dotnet-version: 6.0.202
33+
dotnet-version: 7.0.102
3434

3535
- name: Checkout repository
3636
uses: actions/checkout@v3

.github/workflows/csharp-qltest.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ jobs:
7777
- name: Setup dotnet
7878
uses: actions/setup-dotnet@v3
7979
with:
80-
dotnet-version: 6.0.202
80+
dotnet-version: 7.0.102
8181
- name: Extractor unit tests
8282
run: |
83-
dotnet test -p:RuntimeFrameworkVersion=6.0.4 "${{ github.workspace }}/csharp/extractor/Semmle.Util.Tests"
84-
dotnet test -p:RuntimeFrameworkVersion=6.0.4 "${{ github.workspace }}/csharp/extractor/Semmle.Extraction.Tests"
85-
dotnet test -p:RuntimeFrameworkVersion=6.0.4 "${{ github.workspace }}/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests"
86-
dotnet test -p:RuntimeFrameworkVersion=6.0.4 "${{ github.workspace }}/cpp/autobuilder/Semmle.Autobuild.Cpp.Tests"
83+
dotnet test -p:RuntimeFrameworkVersion=7.0.2 "${{ github.workspace }}/csharp/extractor/Semmle.Util.Tests"
84+
dotnet test -p:RuntimeFrameworkVersion=7.0.2 "${{ github.workspace }}/csharp/extractor/Semmle.Extraction.Tests"
85+
dotnet test -p:RuntimeFrameworkVersion=7.0.2 "${{ github.workspace }}/csharp/autobuilder/Semmle.Autobuild.CSharp.Tests"
86+
dotnet test -p:RuntimeFrameworkVersion=7.0.2 "${{ github.workspace }}/cpp/autobuilder/Semmle.Autobuild.Cpp.Tests"

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

Lines changed: 24 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -22,144 +22,54 @@ jobs:
2222
steps:
2323
### Build the queries ###
2424
- uses: actions/checkout@v3
25-
- name: Find latest bundle
26-
id: find-latest-bundle
27-
uses: ./.github/actions/find-latest-bundle
2825
- name: Find codeql
2926
id: find-codeql
30-
uses: github/codeql-action/init@45955cb1830b640e2c1603ad72ad542a49d47b96
27+
uses: github/codeql-action/init@v2
3128
with:
3229
languages: javascript # does not matter
33-
tools: ${{ steps.find-latest-bundle.outputs.url }}
34-
- name: Get CodeQL version
35-
id: get-codeql-version
36-
run: |
37-
echo "version=$("${CODEQL}" --version | head -n 1 | rev | cut -d " " -f 1 | rev)" >> $GITHUB_OUTPUT
38-
shell: bash
39-
env:
40-
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
4130
- uses: ./.github/actions/os-version
4231
id: os_version
43-
- name: Cache entire pack
44-
id: cache-pack
45-
uses: actions/cache@v3
46-
with:
47-
path: ${{ runner.temp }}/pack
48-
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-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') }}
49-
- name: Cache queries
50-
if: steps.cache-pack.outputs.cache-hit != 'true'
51-
id: cache-queries
52-
uses: actions/cache@v3
53-
with:
54-
path: ${{ runner.temp }}/queries
55-
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') }}
56-
- name: Build query pack
57-
if: steps.cache-queries.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
58-
run: |
59-
cd ql/ql/src
60-
"${CODEQL}" pack create -j 16
61-
mv .codeql/pack/codeql/ql/0.0.0 ${{ runner.temp }}/queries
62-
env:
63-
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
64-
- name: Move cache queries to pack
65-
if: steps.cache-pack.outputs.cache-hit != 'true'
66-
run: |
67-
cp -r ${{ runner.temp }}/queries ${{ runner.temp }}/pack
68-
env:
69-
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
70-
7132
### Build the extractor ###
7233
- name: Cache entire extractor
73-
if: steps.cache-pack.outputs.cache-hit != 'true'
7434
id: cache-extractor
7535
uses: actions/cache@v3
7636
with:
77-
path: |
78-
ql/target/release/ql-autobuilder
79-
ql/target/release/ql-autobuilder.exe
80-
ql/target/release/ql-extractor
81-
ql/target/release/ql-extractor.exe
37+
path: ql/extractor-pack/
8238
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-extractor-${{ hashFiles('ql/**/Cargo.lock') }}-${{ hashFiles('ql/**/*.rs') }}
8339
- name: Cache cargo
84-
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
40+
if: steps.cache-extractor.outputs.cache-hit != 'true'
8541
uses: actions/cache@v3
8642
with:
8743
path: |
8844
~/.cargo/registry
8945
~/.cargo/git
9046
ql/target
9147
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-rust-cargo-${{ hashFiles('ql/**/Cargo.lock') }}
92-
- name: Check formatting
93-
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
94-
run: cd ql; cargo fmt --all -- --check
95-
- name: Build
96-
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
97-
run: cd ql; cargo build --verbose
98-
- name: Run tests
99-
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
100-
run: cd ql; cargo test --verbose
10148
- name: Release build
102-
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
103-
run: cd ql; cargo build --release
104-
- name: Generate dbscheme
105-
if: steps.cache-extractor.outputs.cache-hit != 'true' && steps.cache-pack.outputs.cache-hit != 'true'
106-
run: ql/target/release/ql-generator --dbscheme ql/ql/src/ql.dbscheme --library ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll
107-
108-
### Package the queries and extractor ###
109-
- name: Package pack
110-
if: steps.cache-pack.outputs.cache-hit != 'true'
111-
run: |
112-
cp -r ql/codeql-extractor.yml ql/tools ql/ql/src/ql.dbscheme.stats ${PACK}/
113-
mkdir -p ${PACK}/tools/linux64
114-
cp ql/target/release/ql-autobuilder ${PACK}/tools/linux64/autobuilder
115-
cp ql/target/release/ql-extractor ${PACK}/tools/linux64/extractor
116-
chmod +x ${PACK}/tools/linux64/autobuilder
117-
chmod +x ${PACK}/tools/linux64/extractor
118-
env:
119-
PACK: ${{ runner.temp }}/pack
120-
121-
### Run the analysis ###
122-
- name: Hack codeql-action options
123-
run: |
124-
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]')
125-
echo "CODEQL_ACTION_EXTRA_OPTIONS=${JSON}" >> ${GITHUB_ENV}
126-
env:
127-
PACK: ${{ runner.temp }}/pack
128-
129-
- name: Create CodeQL config file
130-
run: |
131-
echo "paths-ignore:" >> ${CONF}
132-
echo " - ql/ql/test" >> ${CONF}
133-
echo " - \"*/ql/lib/upgrades/\"" >> ${CONF}
134-
echo "disable-default-queries: true" >> ${CONF}
135-
echo "queries:" >> ${CONF}
136-
echo " - uses: ./ql/ql/src/codeql-suites/ql-code-scanning.qls" >> ${CONF}
137-
echo "Config file: "
138-
cat ${CONF}
49+
if: steps.cache-extractor.outputs.cache-hit != 'true'
50+
run: cd ql; ./scripts/create-extractor-pack.sh
13951
env:
140-
CONF: ./ql-for-ql-config.yml
141-
- name: Initialize CodeQL
142-
uses: github/codeql-action/init@45955cb1830b640e2c1603ad72ad542a49d47b96
143-
with:
144-
languages: ql
145-
db-location: ${{ runner.temp }}/db
146-
config-file: ./ql-for-ql-config.yml
147-
tools: ${{ steps.find-latest-bundle.outputs.url }}
148-
- name: Move pack queries
52+
GH_TOKEN: ${{ github.token }}
53+
- name: Cache compilation cache
54+
id: query-cache
55+
uses: ./.github/actions/cache-query-compilation
56+
with:
57+
key: run-ql-for-ql
58+
- name: Make database and analyze
14959
run: |
150-
cp -r ${PACK}/queries ql/ql/src
151-
env:
152-
PACK: ${{ runner.temp }}/pack
153-
154-
- name: Perform CodeQL Analysis
155-
uses: github/codeql-action/analyze@45955cb1830b640e2c1603ad72ad542a49d47b96
60+
${CODEQL} database create -l=ql --search-path ql/extractor-pack ${DB}
61+
${CODEQL} database analyze -j0 --format=sarif-latest --output=ql-for-ql.sarif ${DB} ql/ql/src/codeql-suites/ql-code-scanning.qls --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
62+
env:
63+
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
64+
DB: ${{ runner.temp }}/DB
65+
LGTM_INDEX_FILTERS: |
66+
exclude:ql/ql/test
67+
exclude:*/ql/lib/upgrades/
68+
- name: Upload sarif to code-scanning
69+
uses: github/codeql-action/upload-sarif@v2
15670
with:
157-
category: "ql-for-ql"
158-
- name: Copy sarif file to CWD
159-
run: cp ../results/ql.sarif ./ql-for-ql.sarif
160-
- name: Fixup the $scema in sarif # Until https://github.com/microsoft/sarif-vscode-extension/pull/436/ is part in a stable release
161-
run: |
162-
sed -i 's/\$schema.*/\$schema": "https:\/\/raw.githubusercontent.com\/oasis-tcs\/sarif-spec\/master\/Schemata\/sarif-schema-2.1.0",/' ql-for-ql.sarif
71+
sarif_file: ql-for-ql.sarif
72+
category: ql-for-ql
16373
- name: Sarif as artifact
16474
uses: actions/upload-artifact@v3
16575
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@45955cb1830b640e2c1603ad72ad542a49d47b96
28+
uses: github/codeql-action/init@v2
2929
with:
3030
languages: javascript # does not matter
3131
- uses: ./.github/actions/os-version

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ on:
66
paths:
77
- "ql/**"
88
- codeql-workspace.yml
9+
- .github/workflows/ql-for-ql-tests.yml
910
pull_request:
1011
branches: [main]
1112
paths:
1213
- "ql/**"
1314
- codeql-workspace.yml
15+
- .github/workflows/ql-for-ql-tests.yml
1416

1517
env:
1618
CARGO_TERM_COLOR: always
@@ -22,7 +24,7 @@ jobs:
2224
- uses: actions/checkout@v3
2325
- name: Find codeql
2426
id: find-codeql
25-
uses: github/codeql-action/init@45955cb1830b640e2c1603ad72ad542a49d47b96
27+
uses: github/codeql-action/init@v2
2628
with:
2729
languages: javascript # does not matter
2830
- uses: ./.github/actions/os-version
@@ -34,6 +36,8 @@ jobs:
3436
~/.cargo/git
3537
ql/target
3638
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-qltest-cargo-${{ hashFiles('ql/rust-toolchain.toml', 'ql/**/Cargo.lock') }}
39+
- name: Check formatting
40+
run: cd ql; cargo fmt --all -- --check
3741
- name: Build extractor
3842
run: |
3943
cd ql;
@@ -65,7 +69,7 @@ jobs:
6569
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
6670
- name: Find codeql
6771
id: find-codeql
68-
uses: github/codeql-action/init@77a8d2d10c0b403a8b4aadbd223dc489ecd22683
72+
uses: github/codeql-action/init@v2
6973
with:
7074
languages: javascript # does not matter
7175
- uses: ./.github/actions/os-version

config/identical-files.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl2.qll",
3535
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl3.qll",
3636
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl4.qll",
37+
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImplForRegExp.qll",
3738
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl.qll",
3839
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImpl2.qll",
39-
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForRegExp.qll",
4040
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForHttpClientLibraries.qll",
4141
"ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowImplForPathname.qll",
4242
"swift/ql/lib/codeql/swift/dataflow/internal/DataFlowImpl.qll"

cpp/autobuilder/Semmle.Autobuild.Cpp.Tests/Semmle.Autobuild.Cpp.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net7.0</TargetFramework>
66
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
77
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
88
<Nullable>enable</Nullable>

cpp/autobuilder/Semmle.Autobuild.Cpp/Semmle.Autobuild.Cpp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<AssemblyName>Semmle.Autobuild.Cpp</AssemblyName>
66
<RootNamespace>Semmle.Autobuild.Cpp</RootNamespace>
77
<ApplicationIcon />

0 commit comments

Comments
 (0)