Skip to content

Commit 64321b3

Browse files
authored
Merge branch 'main' into js-extractor-fix
2 parents f33222c + 4d3d07a commit 64321b3

File tree

2,468 files changed

+97844
-291639
lines changed

Some content is hidden

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

2,468 files changed

+97844
-291639
lines changed

.gitattributes

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ go/extractor/opencsv/CSVReader.java -text
6767
# for those testing dbscheme files.
6868
*/ql/lib/upgrades/initial/*.dbscheme -text
6969

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
74-
7570
# Auto-generated modeling for Python
7671
python/ql/lib/semmle/python/frameworks/data/internal/subclass-capture/*.yml linguist-generated=true
7772

.github/labeler.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ 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:
@@ -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/**/*
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "Code scanning - C++"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'rc/*'
8+
pull_request:
9+
branches:
10+
- main
11+
- 'rc/*'
12+
paths:
13+
- 'swift/**'
14+
- '.github/codeql/**'
15+
- '.github/workflows/cpp-swift-analysis.yml'
16+
schedule:
17+
- cron: '0 9 * * 1'
18+
19+
jobs:
20+
CodeQL-Build:
21+
22+
runs-on: ubuntu-latest
23+
24+
permissions:
25+
contents: read
26+
security-events: write
27+
pull-requests: read
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
# Initializes the CodeQL tools for scanning.
34+
- name: Initialize CodeQL
35+
uses: github/codeql-action/init@main
36+
# Override language selection by uncommenting this and choosing your languages
37+
with:
38+
languages: cpp
39+
config-file: ./.github/codeql/codeql-config.yml
40+
41+
- name: "[Ubuntu] Remove GCC 13 from runner image"
42+
shell: bash
43+
run: |
44+
sudo rm -f /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-jammy.list
45+
sudo apt-get update
46+
sudo apt-get install -y --allow-downgrades libc6=2.35-* libc6-dev=2.35-* libstdc++6=12.3.0-* libgcc-s1=12.3.0-*
47+
48+
- name: "Build Swift extractor using Bazel"
49+
run: |
50+
bazel clean --expunge
51+
bazel run //swift:create-extractor-pack --nouse_action_cache --noremote_accept_cached --noremote_upload_local_results --spawn_strategy=local --features=-layering_check
52+
bazel shutdown
53+
54+
- name: Perform CodeQL Analysis
55+
uses: github/codeql-action/analyze@main

.github/workflows/swift.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- "swift/**"
77
- "misc/bazel/**"
88
- "misc/codegen/**"
9+
- "shared/**"
910
- "*.bazel*"
1011
- .github/workflows/swift.yml
1112
- .github/actions/**
@@ -22,10 +23,12 @@ on:
2223
- "swift/**"
2324
- "misc/bazel/**"
2425
- "misc/codegen/**"
26+
- "shared/**"
2527
- "*.bazel*"
2628
- .github/workflows/swift.yml
2729
- .github/actions/**
2830
- codeql-workspace.yml
31+
- .pre-commit-config.yaml
2932
- "!**/*.md"
3033
- "!**/*.qhelp"
3134
branches:

CODEOWNERS

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/cpp/ @github/codeql-c-analysis
2+
/cpp/autobuilder/ @github/codeql-c-extractor
23
/csharp/ @github/codeql-csharp
34
/go/ @github/codeql-go
45
/java/ @github/codeql-java
@@ -11,9 +12,6 @@
1112
/java/ql/test-kotlin1/ @github/codeql-kotlin
1213
/java/ql/test-kotlin2/ @github/codeql-kotlin
1314

14-
# ML-powered queries
15-
/javascript/ql/experimental/adaptivethreatmodeling/ @github/codeql-ml-powered-queries-reviewers
16-
1715
# CodeQL tools and associated docs
1816
/docs/codeql/codeql-cli/ @github/codeql-cli-reviewers
1917
/docs/codeql/codeql-for-visual-studio-code/ @github/codeql-vscode-reviewers
@@ -36,9 +34,7 @@ MODULE.bazel @github/codeql-ci-reviewers
3634

3735
# Workflows
3836
/.github/workflows/ @github/codeql-ci-reviewers
39-
/.github/workflows/atm-* @github/codeql-ml-powered-queries-reviewers
4037
/.github/workflows/go-* @github/codeql-go
41-
/.github/workflows/js-ml-tests.yml @github/codeql-ml-powered-queries-reviewers
4238
/.github/workflows/ql-for-ql-* @github/codeql-ql-for-ql-reviewers
4339
/.github/workflows/ruby-* @github/codeql-ruby
4440
/.github/workflows/swift.yml @github/codeql-swift

MODULE.bazel

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ local_path_override(
1414
# see https://registry.bazel.build/ for a list of available packages
1515

1616
bazel_dep(name = "platforms", version = "0.0.8")
17-
bazel_dep(name = "rules_pkg", version = "0.9.1")
17+
bazel_dep(name = "rules_pkg", version = "0.10.1")
1818
bazel_dep(name = "rules_nodejs", version = "6.0.3")
1919
bazel_dep(name = "rules_python", version = "0.31.0")
2020
bazel_dep(name = "bazel_skylib", version = "1.5.0")
@@ -31,6 +31,8 @@ pip.parse(
3131
use_repo(pip, "codegen_deps")
3232

3333
swift_deps = use_extension("//swift/third_party:load.bzl", "swift_deps")
34+
35+
# following list can be kept in sync with `bazel mod tidy`
3436
use_repo(
3537
swift_deps,
3638
"binlog",

codeql-workspace.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,13 @@ provide:
1111
- "cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml"
1212
- "go/ql/config/legacy-support/qlpack.yml"
1313
- "go/build/codeql-extractor-go/codeql-extractor.yml"
14-
- "javascript/ql/experimental/adaptivethreatmodeling/lib/qlpack.yml"
15-
# This pack is explicitly excluded from the workspace since most users
16-
# will want to use a version of this pack from the package cache. Internal
17-
# users can uncomment the following line and place a custom ML model
18-
# in the corresponding pack to test a custom ML model within their local
19-
# checkout.
20-
# - "javascript/ql/experimental/adaptivethreatmodeling/model/qlpack.yml"
21-
- "javascript/ql/experimental/adaptivethreatmodeling/modelbuilding/qlpack.yml"
22-
- "javascript/ql/experimental/adaptivethreatmodeling/src/qlpack.yml"
23-
- "javascript/ql/experimental/adaptivethreatmodeling/test/qlpack.yml"
2414
- "csharp/ql/campaigns/Solorigate/lib/qlpack.yml"
2515
- "csharp/ql/campaigns/Solorigate/src/qlpack.yml"
2616
- "csharp/ql/campaigns/Solorigate/test/qlpack.yml"
2717
- "misc/legacy-support/*/qlpack.yml"
2818
- "misc/suite-helpers/qlpack.yml"
2919
- "ruby/extractor-pack/codeql-extractor.yml"
3020
- "swift/extractor-pack/codeql-extractor.yml"
31-
- "swift/integration-tests/qlpack.yml"
3221
- "ql/extractor-pack/codeql-extractor.yml"
3322
- ".github/codeql/extensions/**/codeql-pack.yml"
3423

config/identical-files.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,6 @@
251251
"cpp/ql/src/Security/CWE/CWE-020/SafeExternalAPIFunction.qll",
252252
"cpp/ql/src/Security/CWE/CWE-020/ir/SafeExternalAPIFunction.qll"
253253
],
254-
"XML": [
255-
"cpp/ql/lib/semmle/code/cpp/XML.qll",
256-
"csharp/ql/lib/semmle/code/csharp/XML.qll",
257-
"java/ql/lib/semmle/code/xml/XML.qll",
258-
"python/ql/lib/semmle/python/xml/XML.qll"
259-
],
260254
"DuplicationProblems.inc.qhelp": [
261255
"cpp/ql/src/Metrics/Files/DuplicationProblems.inc.qhelp",
262256
"javascript/ql/src/Metrics/DuplicationProblems.inc.qhelp",

cpp/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("@rules_pkg//:mappings.bzl", "pkg_filegroup")
1+
load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup")
22

33
package(default_visibility = ["//visibility:public"])
44

cpp/autobuilder/Semmle.Autobuild.Cpp.Tests/BuildScripts.cs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ internal class TestDiagnosticWriter : IDiagnosticsWriter
203203
public IList<DiagnosticMessage> Diagnostics { get; } = new List<DiagnosticMessage>();
204204

205205
public void AddEntry(DiagnosticMessage message) => this.Diagnostics.Add(message);
206+
207+
public void Dispose() { }
206208
}
207209

208210
/// <summary>
@@ -250,12 +252,7 @@ void EndCallback(int ret, string s, bool silent)
250252
EndCallbackIn.Add(s);
251253
}
252254

253-
CppAutobuilder CreateAutoBuilder(bool isWindows,
254-
string? buildless = null, string? solution = null, string? buildCommand = null, string? ignoreErrors = null,
255-
string? msBuildArguments = null, string? msBuildPlatform = null, string? msBuildConfiguration = null, string? msBuildTarget = null,
256-
string? dotnetArguments = null, string? dotnetVersion = null, string? vsToolsVersion = null,
257-
string? nugetRestore = null, string? allSolutions = null,
258-
string cwd = @"C:\Project")
255+
CppAutobuilder CreateAutoBuilder(bool isWindows, string? dotnetVersion = null, string cwd = @"C:\Project")
259256
{
260257
string codeqlUpperLanguage = Language.Cpp.UpperCaseName;
261258
Actions.GetEnvironmentVariable[$"CODEQL_AUTOBUILDER_{codeqlUpperLanguage}_NO_INDEXING"] = "false";
@@ -265,22 +262,7 @@ CppAutobuilder CreateAutoBuilder(bool isWindows,
265262
Actions.GetEnvironmentVariable[$"CODEQL_EXTRACTOR_{codeqlUpperLanguage}_DIAGNOSTIC_DIR"] = "";
266263
Actions.GetEnvironmentVariable["CODEQL_JAVA_HOME"] = @"C:\codeql\tools\java";
267264
Actions.GetEnvironmentVariable["CODEQL_PLATFORM"] = "win64";
268-
Actions.GetEnvironmentVariable["SEMMLE_DIST"] = @"C:\odasa";
269-
Actions.GetEnvironmentVariable["SEMMLE_JAVA_HOME"] = @"C:\odasa\tools\java";
270-
Actions.GetEnvironmentVariable["SEMMLE_PLATFORM_TOOLS"] = @"C:\odasa\tools";
271-
Actions.GetEnvironmentVariable["LGTM_INDEX_VSTOOLS_VERSION"] = vsToolsVersion;
272-
Actions.GetEnvironmentVariable["LGTM_INDEX_MSBUILD_ARGUMENTS"] = msBuildArguments;
273-
Actions.GetEnvironmentVariable["LGTM_INDEX_MSBUILD_PLATFORM"] = msBuildPlatform;
274-
Actions.GetEnvironmentVariable["LGTM_INDEX_MSBUILD_CONFIGURATION"] = msBuildConfiguration;
275-
Actions.GetEnvironmentVariable["LGTM_INDEX_MSBUILD_TARGET"] = msBuildTarget;
276-
Actions.GetEnvironmentVariable["LGTM_INDEX_DOTNET_ARGUMENTS"] = dotnetArguments;
277-
Actions.GetEnvironmentVariable["LGTM_INDEX_DOTNET_VERSION"] = dotnetVersion;
278-
Actions.GetEnvironmentVariable["LGTM_INDEX_BUILD_COMMAND"] = buildCommand;
279-
Actions.GetEnvironmentVariable["LGTM_INDEX_SOLUTION"] = solution;
280-
Actions.GetEnvironmentVariable["LGTM_INDEX_IGNORE_ERRORS"] = ignoreErrors;
281-
Actions.GetEnvironmentVariable["LGTM_INDEX_BUILDLESS"] = buildless;
282-
Actions.GetEnvironmentVariable["LGTM_INDEX_ALL_SOLUTIONS"] = allSolutions;
283-
Actions.GetEnvironmentVariable["LGTM_INDEX_NUGET_RESTORE"] = nugetRestore;
265+
Actions.GetEnvironmentVariable["CODEQL_EXTRACTOR_CSHARP_OPTION_DOTNET_VERSION"] = dotnetVersion;
284266
Actions.GetEnvironmentVariable["ProgramFiles(x86)"] = isWindows ? @"C:\Program Files (x86)" : null;
285267
Actions.GetCurrentDirectory = cwd;
286268
Actions.IsWindows = isWindows;

0 commit comments

Comments
 (0)