Skip to content

Commit 1947dee

Browse files
authored
Merge branch 'main' into p--oj-ox-unsafe-deser
2 parents 9596aeb + e5ba8fe commit 1947dee

File tree

7,470 files changed

+699754
-217836
lines changed

Some content is hidden

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

7,470 files changed

+699754
-217836
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DisableFormat: true

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,6 @@ go/extractor/opencsv/CSVReader.java -text
7171
# `javascript/ql/experimental/adaptivethreatmodeling/test/update_endpoint_test_files.py`.
7272
javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/autogenerated/**/*.js linguist-generated=true -merge
7373
javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/autogenerated/**/*.ts linguist-generated=true -merge
74+
75+
# Auto-generated modeling for Python
76+
python/ql/lib/semmle/python/frameworks/data/internal/subclass-capture/*.yml linguist-generated=true

.github/workflows/check-change-note.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,42 @@ on:
99
- "*/ql/lib/**/*.ql"
1010
- "*/ql/lib/**/*.qll"
1111
- "*/ql/lib/**/*.yml"
12+
- "shared/**/*.ql"
13+
- "shared/**/*.qll"
1214
- "!**/experimental/**"
1315
- "!ql/**"
1416
- ".github/workflows/check-change-note.yml"
1517

1618
jobs:
1719
check-change-note:
20+
env:
21+
REPO: ${{ github.repository }}
22+
PULL_REQUEST_NUMBER: ${{ github.event.number }}
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1824
runs-on: ubuntu-latest
1925
steps:
26+
2027
- name: Fail if no change note found. To fix, either add one, or add the `no-change-note-required` label.
2128
if: |
2229
github.event.pull_request.draft == false &&
2330
!contains(github.event.pull_request.labels.*.name, 'no-change-note-required')
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2631
run: |
27-
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq 'any(.[].filename ; test("/change-notes/.*[.]md$"))' |
28-
grep true -c
32+
change_note_files=$(gh api "repos/$REPO/pulls/$PULL_REQUEST_NUMBER/files" --paginate --jq '.[].filename | select(test("/change-notes/.*[.]md$"))')
33+
34+
if [ -z "$change_note_files" ]; then
35+
echo "No change note found. Either add one, or add the 'no-change-note-required' label."
36+
exit 1
37+
fi
38+
39+
echo "Change notes found:"
40+
echo "$change_note_files"
41+
2942
- name: Fail if the change note filename doesn't match the expected format. The file name must be of the form 'YYYY-MM-DD.md', 'YYYY-MM-DD-{title}.md', where '{title}' is arbitrary text, or released/x.y.z.md for released change-notes
30-
env:
31-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3243
run: |
33-
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq '[.[].filename | select(test("/change-notes/.*[.]md$"))] | all(test("/change-notes/[0-9]{4}-[0-9]{2}-[0-9]{2}.*[.]md$") or test("/change-notes/released/[0-9]*[.][0-9]*[.][0-9]*[.]md$"))' |
34-
grep true -c
44+
bad_change_note_file_names=$(gh api "repos/$REPO/pulls/$PULL_REQUEST_NUMBER/files" --paginate --jq '[.[].filename | select(test("/change-notes/.*[.]md$"))][] | select((test("/change-notes/[0-9]{4}-[0-9]{2}-[0-9]{2}.*[.]md$") or test("/change-notes/released/[0-9]*[.][0-9]*[.][0-9]*[.]md$")) | not)')
45+
46+
if [ -n "$bad_change_note_file_names" ]; then
47+
echo "The following change note file names are invalid:"
48+
echo "$bad_change_note_file_names"
49+
exit 1
50+
fi

.github/workflows/close-stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/stale@v8
15+
- uses: actions/stale@v9
1616
with:
1717
repo-token: ${{ secrets.GITHUB_TOKEN }}
1818
stale-issue-message: 'This issue is stale because it has been open 14 days with no activity. Comment or remove the `Stale` label in order to avoid having this issue closed in 7 days.'

.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@v3
31+
uses: actions/setup-dotnet@v4
3232
with:
33-
dotnet-version: 7.0.102
33+
dotnet-version: 8.0.100
3434

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

.github/workflows/csharp-qltest.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ jobs:
7272
steps:
7373
- uses: actions/checkout@v4
7474
- name: Setup dotnet
75-
uses: actions/setup-dotnet@v3
75+
uses: actions/setup-dotnet@v4
7676
with:
77-
dotnet-version: 7.0.102
77+
dotnet-version: 8.0.100
7878
- name: Extractor unit tests
7979
run: |
80-
dotnet test -p:RuntimeFrameworkVersion=7.0.2 extractor/Semmle.Util.Tests
81-
dotnet test -p:RuntimeFrameworkVersion=7.0.2 extractor/Semmle.Extraction.Tests
82-
dotnet test -p:RuntimeFrameworkVersion=7.0.2 autobuilder/Semmle.Autobuild.CSharp.Tests
83-
dotnet test -p:RuntimeFrameworkVersion=7.0.2 "${{ github.workspace }}/cpp/autobuilder/Semmle.Autobuild.Cpp.Tests"
80+
dotnet test -p:RuntimeFrameworkVersion=8.0.0 extractor/Semmle.Util.Tests
81+
dotnet test -p:RuntimeFrameworkVersion=8.0.0 extractor/Semmle.Extraction.Tests
82+
dotnet test -p:RuntimeFrameworkVersion=8.0.0 autobuilder/Semmle.Autobuild.CSharp.Tests
83+
dotnet test -p:RuntimeFrameworkVersion=8.0.0 "${{ github.workspace }}/cpp/autobuilder/Semmle.Autobuild.Cpp.Tests"
8484
shell: bash
8585
stubgentest:
8686
runs-on: ubuntu-latest
@@ -91,7 +91,7 @@ jobs:
9191
run: |
9292
# Generate (Asp)NetCore stubs
9393
STUBS_PATH=stubs_output
94-
python3 ql/src/Stubs/make_stubs_nuget.py webapp Swashbuckle.AspNetCore.Swagger 6.5.0 "$STUBS_PATH"
94+
python3 scripts/stubs/make_stubs_nuget.py webapp Swashbuckle.AspNetCore.Swagger 6.5.0 "$STUBS_PATH"
9595
rm -rf ql/test/resources/stubs/_frameworks
9696
# Update existing stubs in the repo with the freshly generated ones
9797
mv "$STUBS_PATH/output/stubs/_frameworks" ql/test/resources/stubs/

.github/workflows/csv-coverage-pr-artifacts.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,32 @@ jobs:
8989
- name: Save PR number
9090
run: |
9191
mkdir -p pr
92-
echo ${{ github.event.pull_request.number }} > pr/NR
92+
echo ${PR_NUMBER} > pr/NR
93+
env:
94+
PR_NUMBER: ${{ github.event.pull_request.number }}
9395
- name: Upload PR number
9496
uses: actions/upload-artifact@v3
9597
with:
9698
name: pr
9799
path: pr/
100+
- name: Save comment ID (if it exists)
101+
run: |
102+
# Find the latest comment starting with COMMENT_PREFIX
103+
COMMENT_PREFIX=":warning: The head of this PR and the base branch were compared for differences in the framework coverage reports."
104+
COMMENT_ID=$(gh api "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments" --paginate | jq --arg prefix "${COMMENT_PREFIX}" 'map(select(.body|startswith($prefix)) | .id) | max // empty')
105+
if [[ -z ${COMMENT_ID} ]]
106+
then
107+
echo "Comment not found. Not uploading 'comment/ID' artifact."
108+
else
109+
mkdir -p comment
110+
echo ${COMMENT_ID} > comment/ID
111+
fi
112+
env:
113+
GITHUB_TOKEN: ${{ github.token }}
114+
PR_NUMBER: ${{ github.event.pull_request.number }}
115+
- name: Upload comment ID (if it exists)
116+
uses: actions/upload-artifact@v3
117+
with:
118+
name: comment
119+
path: comment/
120+
if-no-files-found: ignore

.github/workflows/go-tests-other-os.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: macos-latest
1616
steps:
1717
- name: Set up Go ${{ env.GO_VERSION }}
18-
uses: actions/setup-go@v4
18+
uses: actions/setup-go@v5
1919
with:
2020
go-version: ${{ env.GO_VERSION }}
2121
id: go
@@ -50,7 +50,7 @@ jobs:
5050
runs-on: windows-latest-xl
5151
steps:
5252
- name: Set up Go ${{ env.GO_VERSION }}
53-
uses: actions/setup-go@v4
53+
uses: actions/setup-go@v5
5454
with:
5555
go-version: ${{ env.GO_VERSION }}
5656
id: go

.github/workflows/go-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
runs-on: ubuntu-latest-xl
2424
steps:
2525
- name: Set up Go ${{ env.GO_VERSION }}
26-
uses: actions/setup-go@v4
26+
uses: actions/setup-go@v5
2727
with:
2828
go-version: ${{ env.GO_VERSION }}
2929
id: go

.github/workflows/mad_modelDiff.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- main
1313
paths:
1414
- "java/ql/src/utils/modelgenerator/**/*.*"
15+
- "misc/scripts/models-as-data/*.*"
1516
- ".github/workflows/mad_modelDiff.yml"
1617

1718
permissions:
@@ -61,8 +62,9 @@ jobs:
6162
DATABASE=$2
6263
cd codeql-$QL_VARIANT
6364
SHORTNAME=`basename $DATABASE`
64-
python java/ql/src/utils/modelgenerator/GenerateFlowModel.py --with-summaries --with-sinks $DATABASE ${SHORTNAME}.temp.model.yml
65-
mv java/ql/lib/ext/generated/${SHORTNAME}.temp.model.yml $MODELS/${SHORTNAME}Generated_${QL_VARIANT}.model.yml
65+
python java/ql/src/utils/modelgenerator/GenerateFlowModel.py --with-summaries --with-sinks $DATABASE $SHORTNAME/$QL_VARIANT
66+
mkdir -p $MODELS/$SHORTNAME
67+
mv java/ql/lib/ext/generated/$SHORTNAME/$QL_VARIANT $MODELS/$SHORTNAME
6668
cd ..
6769
}
6870
@@ -85,16 +87,16 @@ jobs:
8587
set -x
8688
MODELS=`pwd`/tmp-models
8789
ls -1 tmp-models/
88-
for m in $MODELS/*_main.model.yml ; do
90+
for m in $MODELS/*/main/*.model.yml ; do
8991
t="${m/main/"pr"}"
9092
basename=`basename $m`
91-
name="diff_${basename/_main.model.yml/""}"
93+
name="diff_${basename/.model.yml/""}"
9294
(diff -w -u $m $t | diff2html -i stdin -F $MODELS/$name.html) || true
9395
done
9496
- uses: actions/upload-artifact@v3
9597
with:
9698
name: models
97-
path: tmp-models/*.model.yml
99+
path: tmp-models/**/**/*.model.yml
98100
retention-days: 20
99101
- uses: actions/upload-artifact@v3
100102
with:

0 commit comments

Comments
 (0)