Skip to content

Commit d0cf2a9

Browse files
authored
Merge branch 'main' into maikypedia/javascript-cors
2 parents 8ba7ac6 + 40b7534 commit d0cf2a9

File tree

13,583 files changed

+1182577
-657240
lines changed

Some content is hidden

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

13,583 files changed

+1182577
-657240
lines changed

.bazelrc

+22-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
11
common --enable_platform_specific_config
2+
common --enable_bzlmod
3+
# because we use --override_module with `%workspace%`, the lock file is not stable
4+
common --lockfile_mode=off
5+
6+
# when building from this repository in isolation, the internal repository will not be found at ..
7+
# where `MODULE.bazel` looks for it. The following will get us past the module loading phase, so
8+
# that we can build things that do not rely on that
9+
common --override_module=semmle_code=%workspace%/misc/bazel/semmle_code_stub
210

311
build --repo_env=CC=clang --repo_env=CXX=clang++
412

5-
build:linux --cxxopt=-std=c++20
6-
build:macos --cxxopt=-std=c++20 --cpu=darwin_x86_64
7-
build:windows --cxxopt=/std:c++20 --cxxopt=/Zc:preprocessor
13+
# we use transitions that break builds of `...`, so for `test` to work with that we need the following
14+
test --build_tests_only
15+
16+
# this requires developer mode, but is required to have pack installer functioning
17+
startup --windows_enable_symlinks
18+
common --enable_runfiles
19+
20+
# with the above, we can avoid building python zips which is the default on windows as that's expensive
21+
build --nobuild_python_zip
22+
23+
common --registry=file:///%workspace%/misc/bazel/registry
24+
common --registry=https://bcr.bazel.build
25+
26+
common --@rules_dotnet//dotnet/settings:strict_deps=false
827

928
try-import %workspace%/local.bazelrc

.bazelrc.internal

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# this file should contain bazel settings required to build things from `semmle-code`
2+
3+
common --registry=file:///%workspace%/ql/misc/bazel/registry
4+
common --registry=https://bcr.bazel.build
5+
6+
# See bazelbuild/rules_dotnet#413: strict_deps in C# also appliy to 3rd-party deps, and when we pull
7+
# in (for example) the xunit package, there's no code in this at all, it just depends transitively on
8+
# its implementation packages without providing any code itself.
9+
# We either can depend on internal implementation details, or turn of strict deps.
10+
common --@rules_dotnet//dotnet/settings:strict_deps=false

.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.3.1
1+
7.2.1

.clang-format

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DisableFormat: true

.gitattributes

+27-11
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,40 @@
5050
*.dll -text
5151
*.pdb -text
5252

53-
java/ql/test/stubs/**/*.java linguist-generated=true
54-
java/ql/test/experimental/stubs/**/*.java linguist-generated=true
53+
/java/ql/test/stubs/**/*.java linguist-generated=true
54+
/java/ql/test/experimental/stubs/**/*.java linguist-generated=true
55+
/java/kotlin-extractor/deps/*.jar filter=lfs diff=lfs merge=lfs -text
5556

5657
# Force git not to modify line endings for go or html files under the go/ql directory
57-
go/ql/**/*.go -text
58-
go/ql/**/*.html -text
58+
/go/ql/**/*.go -text
59+
/go/ql/**/*.html -text
5960
# Force git not to modify line endings for go dbschemes
60-
go/*.dbscheme -text
61+
/go/*.dbscheme -text
6162
# Preserve unusual line ending from codeql-go merge
62-
go/extractor/opencsv/CSVReader.java -text
63+
/go/extractor/opencsv/CSVReader.java -text
6364

6465
# For some languages, upgrade script testing references really old dbscheme
6566
# files from legacy upgrades that have CRLF line endings. Since upgrade
6667
# resolution relies on object hashes, we must suppress line ending conversion
6768
# for those testing dbscheme files.
68-
*/ql/lib/upgrades/initial/*.dbscheme -text
69+
/*/ql/lib/upgrades/initial/*.dbscheme -text
6970

70-
# Generated test files - these are synced from the standard JavaScript libraries using
71-
# `javascript/ql/experimental/adaptivethreatmodeling/test/update_endpoint_test_files.py`.
72-
javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/autogenerated/**/*.js linguist-generated=true -merge
73-
javascript/ql/experimental/adaptivethreatmodeling/test/endpoint_large_scale/autogenerated/**/*.ts linguist-generated=true -merge
71+
# Auto-generated modeling for Python
72+
/python/ql/lib/semmle/python/frameworks/data/internal/subclass-capture/*.yml linguist-generated=true
73+
74+
# auto-generated bazel lock file
75+
/ruby/extractor/cargo-bazel-lock.json linguist-generated=true
76+
/ruby/extractor/cargo-bazel-lock.json -merge
77+
78+
# auto-generated files for the C# build
79+
/csharp/paket.lock linguist-generated=true
80+
# needs eol=crlf, as `paket` touches this file and saves it as crlf
81+
/csharp/.paket/Paket.Restore.targets linguist-generated=true eol=crlf
82+
/csharp/paket.main.bzl linguist-generated=true
83+
/csharp/paket.main_extension.bzl linguist-generated=true
84+
85+
# ripunzip tool
86+
/misc/ripunzip/ripunzip-* filter=lfs diff=lfs merge=lfs -text
87+
88+
# swift prebuilt resources
89+
/swift/third_party/resource-dir/*.zip filter=lfs diff=lfs merge=lfs -text

.github/dependabot.yml

+14-1
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/labeler.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ Java:
1515
- change-notes/**/*java.*
1616

1717
JS:
18-
- any: [ 'javascript/**/*', '!javascript/ql/experimental/adaptivethreatmodeling/**/*' ]
18+
- any: [ 'javascript/**/*' ]
1919
- change-notes/**/*javascript*
2020

2121
Kotlin:
2222
- java/kotlin-extractor/**/*
23-
- java/ql/test/kotlin/**/*
23+
- java/ql/test-kotlin*/**/*
2424

2525
Python:
2626
- python/**/*
@@ -46,6 +46,3 @@ documentation:
4646
# Since these are all shared files that need to be synced, just pick _one_ copy of each.
4747
"DataFlow Library":
4848
- "shared/dataflow/**/*"
49-
50-
"ATM":
51-
- javascript/ql/experimental/adaptivethreatmodeling/**/*

.github/workflows/build-ripunzip.yml

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Build runzip
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
ripunzip-version:
7+
description: "what reference to checktout from google/runzip"
8+
required: false
9+
default: v1.2.1
10+
openssl-version:
11+
description: "what reference to checkout from openssl/openssl for Linux"
12+
required: false
13+
default: openssl-3.3.0
14+
15+
jobs:
16+
build:
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-20.04, macos-12, windows-2019]
21+
runs-on: ${{ matrix.os }}
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
repository: google/ripunzip
26+
ref: ${{ inputs.ripunzip-version }}
27+
# we need to avoid ripunzip dynamically linking into libssl
28+
# see https://github.com/sfackler/rust-openssl/issues/183
29+
- if: runner.os == 'Linux'
30+
name: checkout openssl
31+
uses: actions/checkout@v4
32+
with:
33+
repository: openssl/openssl
34+
path: openssl
35+
ref: ${{ inputs.openssl-version }}
36+
- if: runner.os == 'Linux'
37+
name: build and install openssl with fPIC
38+
shell: bash
39+
working-directory: openssl
40+
run: |
41+
./config -fPIC --prefix=$HOME/.local --openssldir=$HOME/.local/ssl
42+
make -j $(nproc)
43+
make install_sw -j $(nproc)
44+
- if: runner.os == 'Linux'
45+
name: build (linux)
46+
shell: bash
47+
run: |
48+
env OPENSSL_LIB_DIR=$HOME/.local/lib64 OPENSSL_INCLUDE_DIR=$HOME/.local/include OPENSSL_STATIC=yes cargo build --release
49+
mv target/release/ripunzip ripunzip-linux
50+
- if: runner.os == 'Windows'
51+
name: build (windows)
52+
shell: bash
53+
run: |
54+
cargo build --release
55+
mv target/release/ripunzip ripunzip-windows
56+
- name: build (macOS)
57+
if: runner.os == 'macOS'
58+
shell: bash
59+
run: |
60+
rustup target install x86_64-apple-darwin
61+
rustup target install aarch64-apple-darwin
62+
cargo build --target x86_64-apple-darwin --release
63+
cargo build --target aarch64-apple-darwin --release
64+
lipo -create -output ripunzip-macos \
65+
-arch x86_64 target/x86_64-apple-darwin/release/ripunzip \
66+
-arch arm64 target/aarch64-apple-darwin/release/ripunzip
67+
- uses: actions/upload-artifact@v4
68+
with:
69+
name: ripunzip-${{ runner.os }}
70+
path: ripunzip-*
71+
- name: Check built binary
72+
shell: bash
73+
run: |
74+
./ripunzip-* --version

.github/workflows/buildifier.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check bazel formatting
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "**.bazel"
7+
- "**.bzl"
8+
branches:
9+
- main
10+
- "rc/*"
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
check:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
- name: Check bazel formatting
22+
uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
23+
with:
24+
extra_args: >
25+
buildifier --all-files 2>&1 ||
26+
(
27+
echo -e "In order to format all bazel files, please run:\n bazel run //misc/bazel:buildifier"; exit 1
28+
)
+27-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Check change note
22

3+
permissions:
4+
pull-requests: read
5+
36
on:
47
pull_request_target:
58
types: [labeled, unlabeled, opened, synchronize, reopened, ready_for_review]
@@ -9,26 +12,42 @@ on:
912
- "*/ql/lib/**/*.ql"
1013
- "*/ql/lib/**/*.qll"
1114
- "*/ql/lib/**/*.yml"
15+
- "shared/**/*.ql"
16+
- "shared/**/*.qll"
1217
- "!**/experimental/**"
1318
- "!ql/**"
1419
- ".github/workflows/check-change-note.yml"
1520

1621
jobs:
1722
check-change-note:
23+
env:
24+
REPO: ${{ github.repository }}
25+
PULL_REQUEST_NUMBER: ${{ github.event.number }}
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1827
runs-on: ubuntu-latest
1928
steps:
29+
2030
- name: Fail if no change note found. To fix, either add one, or add the `no-change-note-required` label.
2131
if: |
2232
github.event.pull_request.draft == false &&
2333
!contains(github.event.pull_request.labels.*.name, 'no-change-note-required')
24-
env:
25-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2634
run: |
27-
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq 'any(.[].filename ; test("/change-notes/.*[.]md$"))' |
28-
grep true -c
35+
change_note_files=$(gh api "repos/$REPO/pulls/$PULL_REQUEST_NUMBER/files" --paginate --jq '.[].filename | select(test("/change-notes/.*[.]md$"))')
36+
37+
if [ -z "$change_note_files" ]; then
38+
echo "No change note found. Either add one, or add the 'no-change-note-required' label."
39+
exit 1
40+
fi
41+
42+
echo "Change notes found:"
43+
echo "$change_note_files"
44+
2945
- 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 }}
3246
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
47+
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)')
48+
49+
if [ -n "$bad_change_note_file_names" ]; then
50+
echo "The following change note file names are invalid:"
51+
echo "$bad_change_note_file_names"
52+
exit 1
53+
fi

.github/workflows/check-implicit-this.yml

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
- main
1010
- "rc/*"
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
check:
1417
runs-on: ubuntu-latest

.github/workflows/check-qldoc.yml

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
- main
1111
- "rc/*"
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
qldoc:
1518
runs-on: ubuntu-latest

.github/workflows/check-query-ids.yml

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- "rc/*"
1212
workflow_dispatch:
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
check:
1619
name: Check query IDs

.github/workflows/close-stale.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ on:
55
schedule:
66
- cron: "30 1 * * *"
77

8+
permissions:
9+
issues: write
10+
811
jobs:
912
stale:
1013
if: github.repository == 'github/codeql'
1114

1215
runs-on: ubuntu-latest
1316

1417
steps:
15-
- uses: actions/stale@v8
18+
- uses: actions/stale@v9
1619
with:
1720
repo-token: ${{ secrets.GITHUB_TOKEN }}
1821
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

+5-3
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.101
3434

3535
- name: Checkout repository
3636
uses: actions/checkout@v4
@@ -56,7 +56,9 @@ jobs:
5656
# uses a compiled language
5757

5858
- run: |
59-
dotnet build csharp
59+
cd csharp
60+
dotnet tool restore
61+
dotnet build .
6062
6163
- name: Perform CodeQL Analysis
6264
uses: github/codeql-action/analyze@main

0 commit comments

Comments
 (0)