Skip to content

Commit 2c4d2d3

Browse files
authored
Merge branch 'main' into amammad-js-CodeInjection_execa
2 parents 67fb802 + a09078a commit 2c4d2d3

File tree

5,659 files changed

+360981
-125679
lines changed

Some content is hidden

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

5,659 files changed

+360981
-125679
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,24 @@ updates:
1919
update-types: ['version-update:semver-patch', 'version-update:semver-minor']
2020

2121
- package-ecosystem: "gomod"
22-
directory: "go"
22+
directory: "go/extractor"
2323
schedule:
2424
interval: "daily"
2525
allow:
2626
- dependency-name: "golang.org/x/mod"
2727
- dependency-name: "golang.org/x/tools"
28+
groups:
29+
extractor-dependencies:
30+
patterns:
31+
- "golang.org/x/*"
32+
reviewers:
33+
- "github/codeql-go"
34+
35+
- package-ecosystem: "gomod"
36+
directory: "go/ql/test"
37+
schedule:
38+
interval: "monthly"
39+
ignore:
40+
- dependency-name: "*"
2841
reviewers:
2942
- "github/codeql-go"

.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/codeql-analysis.yml

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

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

.github/workflows/compile-queries.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
# run with --check-only if running in a PR (github.sha != main)
3030
if : ${{ github.event_name == 'pull_request' }}
3131
shell: bash
32-
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --check-only --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
32+
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --check-only --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" --compilation-cache-size=500
3333
- name: compile queries - full
3434
# do full compile if running on main - this populates the cache
3535
if : ${{ github.event_name != 'pull_request' }}
3636
shell: bash
37-
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
37+
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}" --compilation-cache-size=500

.github/workflows/csharp-qltest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ 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:
7777
dotnet-version: 7.0.102
7878
- name: Extractor unit tests
@@ -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 latest "$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/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ jobs:
99
pull-requests: write
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/labeler@v4
12+
- uses: actions/labeler@v5
1313
with:
1414
repo-token: "${{ secrets.GITHUB_TOKEN }}"

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
/swift/ @github/codeql-swift
99
/misc/codegen/ @github/codeql-swift
1010
/java/kotlin-extractor/ @github/codeql-kotlin
11+
/java/ql/test-kotlin1/ @github/codeql-kotlin
12+
/java/ql/test-kotlin2/ @github/codeql-kotlin
1113

1214
# ML-powered queries
1315
/javascript/ql/experimental/adaptivethreatmodeling/ @github/codeql-ml-powered-queries-reviewers

codeql-workspace.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
provide:
22
- "*/ql/src/qlpack.yml"
33
- "*/ql/lib/qlpack.yml"
4-
- "*/ql/test/qlpack.yml"
4+
- "*/ql/test*/qlpack.yml"
55
- "*/ql/examples/qlpack.yml"
66
- "*/ql/consistency-queries/qlpack.yml"
77
- "*/ql/automodel/src/qlpack.yml"
88
- "*/ql/automodel/test/qlpack.yml"
9-
- "shared/*/qlpack.yml"
9+
- "shared/**/qlpack.yml"
1010
- "cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml"
1111
- "go/ql/config/legacy-support/qlpack.yml"
1212
- "go/build/codeql-extractor-go/codeql-extractor.yml"
@@ -29,6 +29,7 @@ provide:
2929
- "swift/extractor-pack/codeql-extractor.yml"
3030
- "swift/integration-tests/qlpack.yml"
3131
- "ql/extractor-pack/codeql-extractor.yml"
32+
- ".github/codeql/extensions/**/codeql-pack.yml"
3233

3334
versionPolicies:
3435
default:

config/identical-files.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -498,22 +498,6 @@
498498
"ruby/ql/lib/codeql/ruby/frameworks/data/internal/ApiGraphModelsExtensions.qll",
499499
"python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModelsExtensions.qll"
500500
],
501-
"TaintedFormatStringQuery Ruby/JS": [
502-
"javascript/ql/lib/semmle/javascript/security/dataflow/TaintedFormatStringQuery.qll",
503-
"ruby/ql/lib/codeql/ruby/security/TaintedFormatStringQuery.qll"
504-
],
505-
"TaintedFormatStringCustomizations Ruby/JS": [
506-
"javascript/ql/lib/semmle/javascript/security/dataflow/TaintedFormatStringCustomizations.qll",
507-
"ruby/ql/lib/codeql/ruby/security/TaintedFormatStringCustomizations.qll"
508-
],
509-
"HttpToFileAccessQuery JS/Ruby": [
510-
"javascript/ql/lib/semmle/javascript/security/dataflow/HttpToFileAccessQuery.qll",
511-
"ruby/ql/lib/codeql/ruby/security/HttpToFileAccessQuery.qll"
512-
],
513-
"HttpToFileAccessCustomizations JS/Ruby": [
514-
"javascript/ql/lib/semmle/javascript/security/dataflow/HttpToFileAccessCustomizations.qll",
515-
"ruby/ql/lib/codeql/ruby/security/HttpToFileAccessCustomizations.qll"
516-
],
517501
"Typo database": [
518502
"javascript/ql/src/Expressions/TypoDatabase.qll",
519503
"ql/ql/src/codeql_ql/style/TypoDatabase.qll"

0 commit comments

Comments
 (0)