Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1410 commits
Select commit Hold shift + click to select a range
95efef3
Actions: model environment expressions at declarations
owen-mc Sep 29, 2026
755e78b
Actions: ensure CFG callable scopes are unique
owen-mc Oct 5, 2026
1c10fca
Move HttpStringLiteral class documentation
mbaluda Oct 5, 2026
5478a91
Merge pull request #22586 from forks-felickz/grape-request-accessors
hvitved Oct 5, 2026
c64bccd
C++: Add a testcase that would generate invalid IR when running on th…
MathiasVP Oct 5, 2026
44536bd
C++: Filter out destructor calls of temporaries in the translation cl…
MathiasVP Oct 5, 2026
ce33a8a
Merge pull request #22695 from owen-mc/ql/update-tree-sitter-0.26
owen-mc Oct 5, 2026
af3dac7
Bump golang.org/x/tools
dependabot[bot] Oct 6, 2026
87f7afa
Merge branch 'main' into ignore-path-dependent-destructors-in-transla…
jketema Oct 6, 2026
d62fae8
C#: Re-factor logic for setting .NET proxy environment variables into…
michaelnebel Oct 5, 2026
2f3f6df
C#: Set proxy environment variables for sub-process invoking the NuGe…
michaelnebel Oct 5, 2026
47d2033
Merge pull request #22754 from MathiasVP/ignore-path-dependent-destru…
MathiasVP Oct 6, 2026
36395a3
C#: Also set lower case versions of the proxy environment variables.
michaelnebel Oct 6, 2026
983d936
C#: Log the NuGet CLI command before executing it.
michaelnebel Oct 6, 2026
16ebfc8
C#: Add change-note.
michaelnebel Oct 6, 2026
6013895
Merge pull request #22756 from github/dependabot/go_modules/go/extrac…
jketema Oct 6, 2026
6647e5f
Merge pull request #22748 from mbaluda/mbaluda/useofhttp-perf
mbaluda Oct 6, 2026
b439222
Rust: More type inference tests
hvitved Oct 6, 2026
89844db
Merge pull request #22708 from michaelnebel/csharp/improvesimplifyboo…
michaelnebel Oct 6, 2026
2e0f0c4
C#: Address review comments.
michaelnebel Oct 6, 2026
b874df6
Shared: Tighten test triggers and add Yeast test workflow
tausbn Oct 6, 2026
e7d447d
Shared: Remove branch filter
tausbn Oct 6, 2026
199a93f
Python: Allow trailing commas in type parameters
jketema Oct 2, 2026
36994cd
Merge pull request #22762 from github/tausbn/shared-tighten-test-trig…
tausbn Oct 6, 2026
84ed5d6
Address review comments
owen-mc Oct 6, 2026
52efbe3
C++: Expand test coverage for cpp/resource-not-released-in-destructor.
geoffw0 Oct 6, 2026
d8e7e2e
Update tree-sitter-ql
owen-mc Oct 1, 2026
7c70852
C++: Recognize resource releases through aliases.
geoffw0 Oct 6, 2026
337ed63
C++: Add change note.
geoffw0 Oct 6, 2026
993ce4b
Model optional overlay annotations
owen-mc Oct 1, 2026
10f6b3b
Type inference: Improve constraint matching
hvitved Oct 6, 2026
a27305a
Rust: Install the codeql CLI in workflow
paldepind Oct 7, 2026
c8a0971
Rust: Remove parser fixture workaround
paldepind Oct 7, 2026
042eefc
Unified: Use the shared lib handling of LabeledStmt.
aschackmull Oct 7, 2026
765edd9
Rust: Find rust-analyzer git tag more robustly
paldepind Oct 7, 2026
6046d76
Merge pull request #22752 from michaelnebel/csharp/nugetexeproxyconfig
michaelnebel Oct 7, 2026
393de98
QL4QL: Install CodeQL with `setup-codeql` rather than `init`
henrymercer Oct 7, 2026
96d56d9
Apply suggestion from @hvitved
hvitved Oct 7, 2026
1ee154d
C#: Avoid logging warnings for empty explicit or inherited feeds.
michaelnebel Oct 7, 2026
f726a89
C#: Add change-note.
michaelnebel Oct 7, 2026
931615e
QL4QL: Pass `--threads=0` when creating the database and running tests
henrymercer Oct 7, 2026
8b0733b
QL4QL: Remove redundant `CODEQL_THREADS` setting from the database st…
henrymercer Oct 7, 2026
2927ff2
update codeql documentation
invalid-email-address Oct 7, 2026
87db22d
JavaScript: Align Restify link protocol
navntoft Oct 7, 2026
8e71347
Merge pull request #22778 from github/codeql-spark-run-37617747858
navntoft Oct 7, 2026
3aebc64
Merge pull request #22767 from paldepind/rust/remove-workaround
paldepind Oct 7, 2026
f55585d
Merge pull request #22759 from hvitved/rust/type-inference-more-bound…
hvitved Oct 7, 2026
72a00e3
Unified: More type inference tests
hvitved Oct 6, 2026
70e4424
Unified: Type inference for empty array literals
hvitved Oct 7, 2026
c481ad1
Unified: Add simple constructor tests
hvitved Oct 7, 2026
f122c30
Unified: Add constructors to both static and instance namespaces
hvitved Oct 7, 2026
0490821
Merge pull request #22777 from github/henrymercer/fix-workflow-per-la…
henrymercer Oct 7, 2026
27a8a7e
Merge pull request #22779 from hvitved/unified-constructor-instance-s…
hvitved Oct 7, 2026
468caa3
Type inference: Improve base type matching
hvitved Oct 6, 2026
2222138
Merge pull request #22747 from github/tausbn/python315-model-new-bina…
tausbn Oct 7, 2026
1339778
Merge pull request #22774 from michaelnebel/csharp/improvefeedreachab…
michaelnebel Oct 8, 2026
1db8370
Merge pull request #22768 from aschackmull/unified/cfg-labeledstmt
aschackmull Oct 8, 2026
fc2d9f3
ssa: Create TExprNode even if its read has no reaching def
asgerf Oct 8, 2026
b34d384
ssa: Grammar fix
asgerf Oct 8, 2026
d44c5ff
Rust: Clarify format of `rust_analyzer_release_tag`
paldepind Oct 8, 2026
82c2e5b
cpp: Simplify SsaImpl
asgerf Oct 7, 2026
20367be
Merge pull request #22763 from owen-mc/ql/update-tree-sitter-ql-optional
owen-mc Oct 8, 2026
e785768
Merge pull request #22769 from github/rust/update-workflow
paldepind Oct 8, 2026
9ea99f8
ssa: Only materialise if Expr is reachable (for some variable)
asgerf Oct 8, 2026
4345463
Merge pull request #22693 from asgerf/unified/supertype-fields-clean
asgerf Oct 8, 2026
9837879
Merge pull request #22692 from asgerf/unified/taint-reach
asgerf Oct 8, 2026
c3dfbaa
Unified: Use short-hand notation for concatenation
paldepind Oct 8, 2026
e08ffdd
Unified: Small tweak to macro call extraction
paldepind Oct 8, 2026
b762904
Merge pull request #22740 from github/unified/swift-macro
paldepind Oct 8, 2026
bd0ebd8
JS: Add a failing test.
MathiasVP Oct 7, 2026
2197fc3
Merge pull request #22700 from owen-mc/actions/migrate-shared-cfg
owen-mc Oct 8, 2026
b1681b0
Unified: Add additional Swift tests
paldepind Oct 8, 2026
aeca3cf
Unified: Translate callee in non-pattern context also for calls with
paldepind Oct 8, 2026
7a655ec
Fix upgrade script
owen-mc Oct 8, 2026
5ef9e37
JS: Fix parsing of Member[num] tokens
asgerf Oct 8, 2026
3f9e584
JS: Update test output
asgerf Oct 8, 2026
1874e77
Merge pull request #22746 from github/tausbn/python315-model-bytearra…
tausbn Oct 8, 2026
781d2b9
Unified: Add Swift tests with additional trailing closure
paldepind Oct 8, 2026
463d8a7
Unified: Handle `additionalTrailingClosures` for more expression kinds
paldepind Oct 8, 2026
9cf59a9
Docs: update Java customization doc to cover JSON extensions
nickrolfe Oct 5, 2026
106c800
Docs: update Go customization doc to cover JSON extensions
nickrolfe Oct 5, 2026
f9cf213
Docs: update C# customization doc to cover JSON extensions
nickrolfe Oct 5, 2026
90e597c
Docs: update C++ customization doc to cover JSON extensions
nickrolfe Oct 5, 2026
641dad0
Docs: update JS customization doc to cover JSON extensions
nickrolfe Oct 5, 2026
0780889
Docs: update Python customization doc to cover JSON extensions
nickrolfe Oct 5, 2026
aa0fd3c
Docs: update Ruby customization doc to cover JSON extensions
nickrolfe Oct 5, 2026
9f76743
Docs: update Rust customization doc to cover JSON extensions
nickrolfe Oct 5, 2026
a6d96fb
Docs: update Actions customization doc to cover JSON extensions
nickrolfe Oct 5, 2026
a5d5a4f
Unified: Add additional trailing closure in array type constructor test
paldepind Oct 8, 2026
cf9d757
Remove unnecessary variables
owen-mc Oct 8, 2026
2a29eaf
Merge pull request #22783 from owen-mc/go/fix/range-stmt-upgrade-script
owen-mc Oct 8, 2026
9e6d428
Merge pull request #22753 from github/nickrolfe/docs-json-data-extens…
nickrolfe Oct 8, 2026
e8c7105
Merge pull request #22744 from asgerf/ssa/multiple-reads-v2
asgerf Oct 8, 2026
8436a8b
Merge pull request #22785 from github/unified/swift-extractions-impro…
paldepind Oct 8, 2026
dcdf0a0
unified: Add test with flow through enums
asgerf Oct 5, 2026
7aae4bc
unified: Support flow through enum constructors
asgerf Oct 5, 2026
ce622db
unified: Model postfix "!" as a read step
asgerf Oct 5, 2026
a58747a
unified: Model more unary and cast operators
asgerf Oct 5, 2026
488f131
unified: Add basic flow through arrays
asgerf Oct 5, 2026
a0c937c
unified: Also treat "!" as a taint step and update test output
asgerf Oct 5, 2026
dca1b90
unified: Manually add one-argument version of Data.init(contentsOf:)
asgerf Oct 5, 2026
143aef9
unified: Add path-injection specific step through 'path'
asgerf Oct 5, 2026
7c4a2e8
unified: Dont show ExprPattern in path
asgerf Oct 5, 2026
61fc5fd
unified: Improve join order
asgerf Oct 7, 2026
6ab5435
unified: Record consistency errors
asgerf Oct 8, 2026
677f52e
unified: Add consistency exclusion, but record the miss in a test case
asgerf Oct 8, 2026
c811698
unified: Fix bug in test case
asgerf Oct 8, 2026
c413773
unified: Make the test case type-checkable
asgerf Oct 8, 2026
18f97f7
unified: Mention flattening behavior of 'try?'
asgerf Oct 8, 2026
f1aeecb
unified: Add test case for one-arg Data call
asgerf Oct 8, 2026
9211707
unified: Update test output after rebasing
asgerf Oct 8, 2026
303385e
unified: Fix typo
asgerf Oct 8, 2026
85a87c0
Update macOS system requirements
jketema Oct 8, 2026
3113489
C++: Fix QLDoc.
MathiasVP Oct 8, 2026
df5def1
Unified: Add more static name binding tests
hvitved Oct 8, 2026
3aa5538
Unified: Add `Member.getNameNode`
hvitved Oct 8, 2026
7bd102b
Java: isolate Maven integration test repositories
cklin Oct 8, 2026
b1200b5
Merge pull request #22732 from github/tausbn/python315-model-unicoded…
tausbn Oct 8, 2026
b1da660
Unified: Improve static name binding involving shadowing
hvitved Oct 8, 2026
3260002
Merge pull request #22782 from hvitved/unified/static-name-binding-sh…
hvitved Oct 9, 2026
cfc8be4
unified: Remove empty DataFlowConsistency.expected
asgerf Oct 9, 2026
d04059b
unified: Factor out EnumCaseClass
asgerf Oct 9, 2026
f4d4777
unified: Use EnumCaseConstructor in TypeInference
asgerf Oct 9, 2026
e103940
unified: Elaborate QLDoc for enum cases
asgerf Oct 9, 2026
6efb2a1
Merge pull request #22751 from asgerf/unified/more-data-flow
asgerf Oct 9, 2026
768c03a
unified: Bypass Optional<T> content
asgerf Oct 9, 2026
ac1fb5b
unified: Update test and remove TODO
asgerf Oct 9, 2026
b33ebeb
unified: Simplify plugin code
asgerf Oct 9, 2026
e1cbde7
unified: Model ?? operator
asgerf Oct 9, 2026
c2dd4f9
Merge pull request #22788 from jketema/jketema/macos27
jketema Oct 9, 2026
88198d7
Unified: Allow pattern-less parameters.
aschackmull Oct 9, 2026
5b98c6c
Unified: Accept test improvements.
aschackmull Oct 9, 2026
7bb3fc1
Go: Update to 1.27.2
github-actions[bot] Oct 9, 2026
2ea6fde
Merge pull request #22794 from github/workflow/go-version-update
owen-mc Oct 9, 2026
4881edc
Unified: delete empty consistency expected files.
aschackmull Oct 9, 2026
9119921
Merge pull request #22736 from github/tausbn/python315-model-new-buil…
tausbn Oct 9, 2026
f3b9fb0
Merge pull request #22735 from github/tausbn/python315-model-prefixmatch
tausbn Oct 9, 2026
4c68eb3
Merge pull request #22734 from github/tausbn/python315-model-extra-re…
tausbn Oct 9, 2026
95f69b6
Merge pull request #22733 from github/tausbn/python315-model-threadin…
tausbn Oct 9, 2026
65f9256
Merge pull request #22743 from github/fix/python-trailing-type-parame…
jketema Oct 9, 2026
14a7f46
Merge pull request #22784 from asgerf/js/fix-member-token
asgerf Oct 9, 2026
dc7b9bd
Merge pull request #22761 from hvitved/type-inference-more-base-matching
hvitved Oct 9, 2026
5d625d7
Merge pull request #22789 from github/cklin/fix-buildless-maven-flake
cklin Oct 9, 2026
eae42e6
Unified: Add `Callable.getReturnType`
hvitved Oct 8, 2026
ff7dd73
Unified: Add type inference test case for implicit struct constructor
hvitved Oct 9, 2026
e4238e6
Unified: Use `ParameterEx` in type inference
hvitved Oct 9, 2026
57e2a96
Address review comment
hvitved Oct 9, 2026
ed5f381
Merge pull request #22790 from hvitved/unified/type-inference-param-ex
hvitved Oct 9, 2026
b5b8165
Merge pull request #22654 from MathiasVP/fix-forward-interpretation
MathiasVP Oct 9, 2026
5e19208
C++: Update expected test results after frontend update
jketema Oct 2, 2026
2362c57
Cargo: Upgrade dependencies
github-actions[bot] Oct 7, 2026
39c68a1
Rust: Update rust-analyzer sources
github-actions[bot] Oct 7, 2026
7c4dc52
Rust: Update fixed toolchain
github-actions[bot] Oct 7, 2026
3b5a4a5
Bazel: Regenerate vendored cargo dependencies
github-actions[bot] Oct 7, 2026
6d010e8
Rust: Run codegen
github-actions[bot] Oct 7, 2026
8dfa3ae
Rust: Add schema upgrade and downgrade for rust-analyzer 0.0.357
github-actions[bot] Oct 7, 2026
b4d5606
Rust: Update test expectations
paldepind Oct 8, 2026
0031421
Rust: Model Rust 1.99 I/O paths
paldepind Oct 9, 2026
34b3ec4
Rust: Model the changed pin! expansion
paldepind Oct 9, 2026
3034a18
unified: Enhance toString of members
asgerf Oct 9, 2026
68e9550
unified: Update expected files
asgerf Oct 9, 2026
f66896b
unified: Fix toString for extensions
asgerf Oct 9, 2026
8834de5
Merge pull request #22795 from asgerf/unified/member-tostring
asgerf Oct 12, 2026
155341e
Merge pull request #22791 from aschackmull/unified/cfg-enumcase-param
aschackmull Oct 12, 2026
9858756
docs: guide agents working on the Kotlin extractor
andersfugmann Oct 12, 2026
4af6ba6
Merge pull request #22764 from geoffw0/destructorrelease
geoffw0 Oct 12, 2026
c03ab04
C++: Update supported compiler versions
jketema Oct 12, 2026
4812cdd
Merge pull request #22760 from jketema/jketema/frontend
jketema Oct 13, 2026
b6a9c9a
Merge pull request #22792 from asgerf/unified/bypass-optional
asgerf Oct 13, 2026
4cf3aa6
Rust: Pass --ignore-rust-version to Cargo
paldepind Oct 13, 2026
593e17a
unified: Add some tests with captured vars
asgerf Sep 29, 2026
d08e0b9
unified: Split Node into "stage 1" and "final stage"
asgerf Sep 29, 2026
2f46c31
unified: Factor out LocalVariableRefNode
asgerf Sep 29, 2026
6d4e275
unified: Add canonical callable node
asgerf Sep 29, 2026
d76cdb3
unified: Exclude function types from DataFlowCallable
asgerf Sep 29, 2026
607010a
unified: Function declaration names belong to the outer scope
asgerf Sep 29, 2026
f736b03
unified: Instantiate capture lib and enable consistency queries
asgerf Sep 29, 2026
ca6a6a8
unified: Add Stage2Node
asgerf Sep 29, 2026
058d767
unified: Use local data flow for alias detection
asgerf Sep 29, 2026
8e5b2c6
unified: Add TCaptureSsaNode
asgerf Sep 30, 2026
0ea037b
unified: Add callee param/arg position
asgerf Sep 30, 2026
0e84147
unified: Callee always has a post-update
asgerf Sep 30, 2026
bd1c743
unified: Generalize receiver nodes to implicit arg/param nodes
asgerf Sep 30, 2026
c26ebf9
unified: Add convenience getters
asgerf Sep 30, 2026
f3be2ce
unified: Mapping capture nodes to data flow nodes
asgerf Sep 30, 2026
c8ae4d3
unified: Add CapturedVariable content
asgerf Sep 30, 2026
b0c2d54
unified: Add CaptureSsa steps and post-updates
asgerf Sep 30, 2026
7e6bd55
unified: Update debug graph
asgerf Sep 30, 2026
d7130c2
unified: Add lambda flow
asgerf Sep 30, 2026
6e0a3b7
unified: Add some tests with local function declarations
asgerf Sep 30, 2026
7762b17
unified: Add test with local function used before its declaration
asgerf Sep 30, 2026
343fe76
unified: Hoist local functions
asgerf Sep 30, 2026
68d7e3e
unified: Add tests with capture declarations
asgerf Sep 30, 2026
3321c32
unified: Desugar capture declaration list
asgerf Sep 30, 2026
7b462e4
fixup! dont add unary_expr
asgerf Oct 14, 2026
f30f6c9
unified: Update test case
asgerf Sep 30, 2026
6533df1
unified: Fix scoping for capture declarations
asgerf Oct 1, 2026
4afec0c
unified: Simplify with getParentIndex
asgerf Oct 1, 2026
d0a38cb
Shared: Force join order in VariableCapture
asgerf Oct 1, 2026
7f9ebee
unified: Remove blank lines from expected file
asgerf Oct 8, 2026
f3afa24
unified: Update test after rebasing
asgerf Oct 14, 2026
d82fc83
unified: Add tests with 'unowned' captures
asgerf Oct 8, 2026
f50c74c
unified: Auto-format self_access.swift
asgerf Oct 9, 2026
1b94078
unified: Fix variable not being used in all disjuncts
asgerf Oct 9, 2026
449d672
Merge pull request #22814 from github/rust/ignore-toolchain-version
paldepind Oct 14, 2026
097d566
C++: Add support for C23 `_BitInt`s
jketema Oct 14, 2026
31362ac
Rust: Remove references to deleted IDs in downgrade script
paldepind Oct 14, 2026
9fe8eab
Fix typo: occured -> occurred
owen-mc Oct 14, 2026
01eb47d
Merge branch 'main' into kumarak/cpp-bmqa-models
geoffw0 Oct 14, 2026
1766509
Merge main into java-uri-host-allowlist
theinfosecguy Oct 14, 2026
dac9f1b
Integrate URI host comparison tests into query suites
theinfosecguy Oct 14, 2026
ae00382
Additional taint tracking for setData and setPropertiesRef
geoffw0 Oct 14, 2026
d529394
C++: Accept .expected changes following Copilot Code Review suggestions.
geoffw0 Oct 14, 2026
55705d4
Use instanceof for threat model sources
owen-mc Oct 14, 2026
88c3213
C++: Add upgrade and downgrade scripts
jketema Oct 14, 2026
3175881
C++: Add change note
jketema Oct 14, 2026
75d1cb9
C++: Update stats file
jketema Oct 14, 2026
d3a4e5c
C++: Fix DBCheck error caused by conflicting definitions in the test.
geoffw0 Oct 14, 2026
9b363ee
Make queries use ActiveThreatModelSource, not RemoteFlowSource
owen-mc Oct 14, 2026
cf4d0e1
Merge pull request #22819 from owen-mc/js/typo-occured
owen-mc Oct 14, 2026
ce648b3
Add change note
owen-mc Oct 14, 2026
3d9169f
C++: Test layout.
geoffw0 Oct 14, 2026
dd4405c
Merge pull request #22578 from theinfosecguy/java-uri-host-allowlist
owen-mc Oct 14, 2026
348d715
build(deps): bump the extractor-dependencies group across 1 directory…
dependabot[bot] Oct 15, 2026
118ecc6
Merge pull request #22821 from github/dependabot/go_modules/go/extrac…
jketema Oct 15, 2026
6b16b0b
Merge pull request #22806 from github/andersfugmann/kotlin-agent-inst…
andersfugmann Oct 15, 2026
e15ba8e
Add opt-in AI output threat model
jacknojo Oct 12, 2026
876cffb
Avoid mentioning no library coverage
jacknojo Oct 14, 2026
9ce464a
Re-order list
jacknojo Oct 14, 2026
6bcc93a
Merge pull request #22822 from owen-mc/python/fix-query-active-sources
owen-mc Oct 15, 2026
c738c0e
Merge pull request #22810 from github/jacknojo-llm-output-threat-model
jacknojo Oct 15, 2026
b76f38d
C++: Another test layout cleanup.
geoffw0 Oct 15, 2026
1ab8fcd
unified: Avoid spurious recursion in toString and getLocation
asgerf Oct 15, 2026
1a595bc
Merge pull request #22776 from github/automation/update-rust-analyzer…
paldepind Oct 15, 2026
cd6386a
unified: Add TODO about escape analysis
asgerf Oct 15, 2026
31488c0
unified: Elaborate on CapturedParameter
asgerf Oct 15, 2026
4be4ff5
unified: Add TODO in ClosureExpr
asgerf Oct 15, 2026
a8a968b
Rust: Improve the rust-analyzer update instructions
paldepind Oct 15, 2026
8237de2
Rust: Simplify workflow instructions by removing duplicated info
paldepind Oct 15, 2026
b25c458
Merge pull request #22816 from jketema/jketema/bitint
jketema Oct 15, 2026
35510a5
Merge pull request #22820 from github/copilot/bmqa-models-merge-main
geoffw0 Oct 15, 2026
48e3e11
unified: Rename get -> to
asgerf Oct 15, 2026
10853e6
unified: Preserve TODO at clearsContent
asgerf Oct 15, 2026
f666d7e
unified: Autoformat
asgerf Oct 15, 2026
89fca11
Rust: Run consistency queries and clarify statement
paldepind Oct 15, 2026
2ed987f
Merge pull request #22827 from github/rust/update-workflow
paldepind Oct 15, 2026
0c40f4d
Merge pull request #22726 from asgerf/unified/captured-variables
asgerf Oct 15, 2026
5dfcc34
Release preparation for version 2.27.3
invalid-email-address Oct 15, 2026
a1575b9
Merge pull request #22834 from github/release-prep/2.27.3
mario-campos Oct 15, 2026
c420297
Merge commit 'a1575b98a8cc19bcfa7bb6cb41be688cb3dae65c' into rehearsa…
Oct 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@
/ruby/extractor/cargo-bazel-lock.json linguist-generated=true
/ruby/extractor/cargo-bazel-lock.json -merge

# GitHub Agentic Workflows compiled output
.github/workflows/*.lock.yml linguist-generated=true

# auto-generated files for the C# build
/csharp/paket.lock linguist-generated=true
# needs eol=crlf, as `paket` touches this file and saves it as crlf
Expand Down
4 changes: 4 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Swift:
- swift/**/*
- change-notes/**/*swift*

Unified:
- unified/**/*
- change-notes/**/*unified*

Actions:
- actions/**/*
- change-notes/**/*actions*
Expand Down
175 changes: 175 additions & 0 deletions .github/skills/bazel/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
---
name: bazel
description: Conventions for editing Bazel files in the github/codeql repository: the shared `misc/bazel` helpers, `codeql_platform_select` and the `{CODEQL_PLATFORM}` packaging placeholder, adding `MODULE.bazel` dependencies, and the `semmle_code` stub that keeps the standalone build working. Use when editing any `BUILD.bazel`, `*.bzl`, `MODULE.bazel` or `.bazelrc` here, and before validating such an edit.
---

# Bazel in the codeql repository

A bzlmod module named `ql`, repo name `@codeql` ([`MODULE.bazel`](../../../MODULE.bazel)). It builds standalone, and is
also consumed by an internal module; standalone builds replace that module with a stub.

## Traps

Things that will waste your time or produce a wrong edit here. Read this section even if you skip the rest.

* **`//...` does not work.** `bazel build //...`, and even `bazel query //...`, fail at the repo root: the patched
modules under [`misc/bazel/registry`](../../../misc/bazel/registry) are real packages referencing repos that are not
visible from the main repo, and [`.bazelrc`](../../../.bazelrc) notes separately that transitions break `...` builds.
The error names a registry directory unrelated to your edit, so it is easy to misdiagnose. **Validate the specific
target or package you changed**, not a recursive pattern.
* **There is no `MODULE.bazel.lock`, deliberately.** [`.bazelrc`](../../../.bazelrc) sets `--lockfile_mode=off` because
the workspace-relative module override makes a lockfile unstable. Do not add one, and do not "fix" its absence.
* **`linux_arm64` vs `linux-arm64`.** The keyword argument and config setting use an underscore; the platform *string*
substituted into paths and zip names uses a hyphen. They are not interchangeable.
* **Do not stub your way out of a missing internal dependency.** See [Building standalone](#building-standalone) for the
one narrow case where extending the stub is correct.

## Conventions

* **Copy a neighboring target rather than inventing a shape.** Packaging is not uniform: some packages use the
`codeql_*` wrappers, others still use `pkg_files` directly. Copy the closest *working* neighbor, and prefer the
wrapper for new code.
* **Pin anything fetched over the network** with `sha256` or `integrity`. Bazel only *warns* on an unpinned download, so
nothing fails loudly, but the build stops being reproducible and a retagged upstream release silently changes what you
build. `lfs_archive` is the exception: content is pinned by git object.
* **Format with `bazel run //misc/bazel/buildifier`.** It rewrites in place, so do not hand-tune formatting. Also wired
as a `pre-commit` hook ([`.pre-commit-config.yaml`](../../../.pre-commit-config.yaml)).

## Where new code goes

Bazel's own macro / rule / repository-rule distinction applies as usual. What is repo-specific:

| Adding | Goes in |
| --- | --- |
| a new packaging shape | extend [`misc/bazel/pkg.bzl`](../../../misc/bazel/pkg.bzl), do not fork `pkg_files` |
| a new OS or arch split | [`misc/bazel/os.bzl`](../../../misc/bazel/os.bzl), do not hand-roll a `select()` over `@platforms//` |
| a fetch of something external | a repository rule ([`lfs.bzl`](../../../misc/bazel/lfs.bzl), [`ripunzip.bzl`](../../../misc/ripunzip/ripunzip.bzl)), not a `genrule` |
| a wrapper used by one language | next to that language ([`swift/rules.bzl`](../../../swift/rules.bzl)) |
| a wrapper used across languages | `misc/bazel/` |

Prefer inline rules in `BUILD.bazel`. A `.bzl` file earns its `load()` only when the shape repeats across packages or a
value must be computed: [`rust.bzl`](../../../misc/bazel/rust.bzl) is worth it because every Rust binary that ships in a
pack must get the same universal-binary wrapper and symbols test, and forgetting either is a release bug. A local
debugging aid opts out and declares a plain `rust_binary`; see `swift-syntax-parse` in
[`unified/swift-syntax-rs/BUILD.bazel`](../../../unified/swift-syntax-rs/BUILD.bazel). The `_gen_binaries` list in
[`go/BUILD.bazel`](../../../go/BUILD.bazel) does not earn a `.bzl`, because it is shared within a single file, where a
local variable does the job.

Macros here are typically a thin public wrapper around a private rule (`codeql_csharp_binary`, `swift_cc_binary`). Keep
the rule narrow and the ergonomics in the macro. Each macro decorates the caller's `name` to mint its helper targets,
for example `internal/<name>` or `single_arch/<name>`. Their visibility is that macro's choice (private, package
default, or the caller's own), so read the macro instead of assuming. When an error names a target you cannot find in
any source file, a macro minted it: grep the suffix under `misc/bazel/`.

## Shared helpers

Frequently-used pieces, so you load the existing one instead of rewriting it. Read the file for its actual exports.

| `load()` path | Covers |
| --- | --- |
| `//misc/bazel:pkg.bzl` | CodeQL packs and packaging |
| `//misc/bazel:os.bzl` | platform and architecture selection |
| `//misc/bazel:lfs.bzl` | on-demand git-LFS repositories |
| `//misc/bazel:rust.bzl` | Rust binary wrapper |
| `//misc/bazel:csharp.bzl` | C# binary/library/test wrappers |
| `//misc/bazel:utils.bzl` | `select_os`; prefer `os.bzl`'s `os_select` in new code |

[`defs.bzl`](../../../defs.bzl) at the root exports `codeql_platform` for *dependent* modules. It is not the way to get
the platform string here; use `os.bzl`.

## Platform selection

[`codeql_platform_select`](../../../misc/bazel/os.bzl) takes one keyword argument per CodeQL platform: `linux64`,
`linux_arm64`, `osx64` and `win64`. `otherwise` supplies the value for whichever of those you leave unset; it is **not**
a `//conditions:default`. **There is deliberately no fallback from `linux_arm64` to `linux64`.** If you only care about
the OS, use `os_select`, which gives Linux the same value on both architectures and has a `posix` shorthand for the
shared Linux/macOS value.

In a macro (no `ctx`) it returns a `select()`:

```python
load("//misc/bazel:os.bzl", "codeql_platform_select")
load("//misc/bazel:pkg.bzl", "codeql_pkg_files")

codeql_pkg_files(
name = "extractor-arch",
exes = codeql_platform_select(
otherwise = ["//unified/extractor"],
win64 = ["//unified/extractor-unsupported-os:extractor"],
),
prefix = "tools/{CODEQL_PLATFORM}",
)
```

If implementation code needs to *branch* on the value rather than pass it through, pass `ctx` and add
`OS_DETECTION_ATTRS` to the rule's attributes. The value is then resolved eagerly instead of being an opaque `select()`:

```python
load("//misc/bazel:os.bzl", "OS_DETECTION_ATTRS", "os_select")

def _impl(ctx):
ext = os_select(ctx, windows = ".exe", posix = "")
...

my_rule = rule(
implementation = _impl,
attrs = {"src": attr.label()} | OS_DETECTION_ATTRS,
)
```

## Packs

`codeql_pack` assembles the files that become an extractor pack. See [`unified/BUILD.bazel`](../../../unified/BUILD.bazel)
for a minimal complete example and [`pkg.bzl`](../../../misc/bazel/pkg.bzl) for the arguments. The non-obvious parts:

* **`{CODEQL_PLATFORM}` in a destination path is the routing mechanism**, not just a substitution. A path containing it
is *arch-specific* and lands in the per-architecture zip; every other path is *common*. So `prefix =
"tools/{CODEQL_PLATFORM}"` both places the file and marks it arch-specific. `arch_overrides` forces named
destinations into the arch-specific part without a placeholder.
* **`codeql_pkg_files` splits `srcs` (plain) from `exes` (mode 755)** and **rejects `attributes =`** with an explicit
error. Use `exes` rather than hand-rolling `pkg_attributes(mode = "755")`.
* **`pkg_dirs` and `pkg_symlinks` are unsupported** and fail at analysis time.
* `codeql_pack` also generates an installer and an `install` alias, hence `bazel run //unified:install`. Pass
`installer_alias = None` if one package defines several packs.
* `codeql_pack_group` exists for bundling packs into distribution zips, but nothing in this repo instantiates it.

## Adding a dependency

In order of preference:

1. **A [Bazel Central Registry](https://registry.bazel.build/) module.** Add a `bazel_dep` in
[`MODULE.bazel`](../../../MODULE.bazel).
2. **A patched upstream module.** Add it under [`misc/bazel/registry`](../../../misc/bazel/registry), which `.bazelrc`
puts ahead of the BCR. Put patches in `modules/<repo>/<version>/patches`, rename the version with a `-codeql.N`
suffix, and run [`fix.py`](../../../misc/bazel/registry/fix.py) to realign the metadata.
3. **A raw archive.** Use `http_archive` via `use_repo_rule`, or a repository rule. Copy an adjacent declaration and
keep its checksum field populated.

Vendored Rust crates under [`misc/bazel/3rdparty`](../../../misc/bazel/3rdparty) are generated. Regenerate with
[`update_cargo_deps.sh`](../../../misc/bazel/3rdparty/update_cargo_deps.sh) rather than editing, and keep the
`use_repo` lists in sync, which `bazel mod tidy` does for module extensions.

## Building standalone

[`MODULE.bazel`](../../../MODULE.bazel) declares `semmle_code` with a `local_path_override` pointing at `..`, which
resolves when this repo is checked out inside the internal module. [`.bazelrc`](../../../.bazelrc), which Bazel reads
when invoked in *this* workspace, overrides that with a stub. This line is the whole reason a standalone build resolves:

```
common --override_module=semmle_code=%workspace%/misc/bazel/semmle_code_stub
```

Do not change either the override path or the `local_path_override`; they work as a pair.

[`misc/bazel/semmle_code_stub`](../../../misc/bazel/semmle_code_stub) is an otherwise empty module supplying no-op
versions of the internal helpers that shared `.bzl` files load *unconditionally*. That is its only job, and it is small
enough to read.

**Extend the stub only when a `.bzl` file every standalone target loads gains a new internal `load()`**, which breaks
package loading outright, for everyone. Prefer not needing one. **Never add a stub so that an internal-only target
appears to build**: some targets depend on internal libraries (`grep -rl @semmle_code --include=*.bazel` finds them) and
are correctly unbuildable here. Unlike a `load()`, such a dependency only fails when that target is actually requested.

[`.bazelrc.internal`](../../../.bazelrc.internal) is **not** read here; it carries settings for the internal build. A
setting needed by both has to be written in both files, with paths differing because this repo sits at a different depth
there.
8 changes: 8 additions & 0 deletions .github/workflows/csharp-qltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
paths:
- "csharp/**"
- "shared/**"
- "!shared/tree-sitter-extractor/**"
- "!shared/yeast/**"
- "!shared/yeast-macros/**"
- "!shared/yeast-schema/**"
- "misc/bazel/**"
- .github/actions/fetch-codeql/action.yml
- codeql-workspace.yml
Expand All @@ -16,6 +20,10 @@ on:
paths:
- "csharp/**"
- "shared/**"
- "!shared/tree-sitter-extractor/**"
- "!shared/yeast/**"
- "!shared/yeast-macros/**"
- "!shared/yeast-schema/**"
- "misc/bazel/**"
- .github/workflows/csharp-qltest.yml
- .github/actions/fetch-codeql/action.yml
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
- "go/**"
- "!go/documentation/**"
- "shared/**"
- "!shared/tree-sitter-extractor/**"
- "!shared/yeast/**"
- "!shared/yeast-macros/**"
- "!shared/yeast-schema/**"
- .github/workflows/go-tests.yml
- .github/actions/**
- codeql-workspace.yml
Expand Down
120 changes: 120 additions & 0 deletions .github/workflows/label-external-contributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Label external contributions

on:
schedule:
- cron: "7,22,37,52 * * * *"
workflow_dispatch:

permissions: {}

concurrency:
group: label-external-contributions
cancel-in-progress: false

jobs:
label:
if: github.ref_name == github.event.repository.default_branch
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
pull-requests: write

steps:
- name: Create organization membership token
id: membership-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
client-id: ${{ vars.CODEQL_ORG_MEMBERS_APP_CLIENT_ID }}
private-key: ${{ secrets.CODEQL_ORG_MEMBERS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
permission-members: read

- name: Label external contributions
env:
API_URL: ${{ github.api_url }}
GH_TOKEN: ${{ github.token }}
MEMBERS_TOKEN: ${{ steps.membership-token.outputs.token }}
ORG: ${{ github.repository_owner }}
REPO: ${{ github.repository }}
run: |
set -euo pipefail

label="external-contribution"
updated_cutoff=$(date -u -d "1 hour ago" "+%Y-%m-%dT%H:%M:%SZ")

while IFS= read -r pr_number; do
if [[ ! "$pr_number" =~ ^[1-9][0-9]*$ ]]; then
echo "Skipping malformed pull request number."
continue
fi

pr_json=$(gh api "repos/$REPO/pulls/$pr_number")
if ! jq -e \
--arg repo "$REPO" \
--arg label "$label" \
'.state == "open" and
.draft == false and
.base.repo.full_name == $repo and
(.head.repo.full_name | type == "string") and
.head.repo.full_name != $repo and
.user.type == "User" and
(.user.login | type == "string" and length > 0) and
(any(.labels[]?; .name == $label) | not)' \
>/dev/null <<<"$pr_json"; then
continue
fi

author=$(jq -r '.user.login' <<<"$pr_json")
events=$(gh api --paginate \
"repos/$REPO/issues/$pr_number/events?per_page=100" |
jq -cs 'add')

if jq -e --arg label "$label" \
'any(.[]; .event == "labeled" and .label.name == $label)' \
>/dev/null <<<"$events"; then
continue
fi

if ! membership_status=$(curl \
--silent \
--show-error \
--output /dev/null \
--write-out '%{http_code}' \
--connect-timeout 10 \
--max-time 30 \
--header "Accept: application/vnd.github+json" \
--header "Authorization: Bearer $MEMBERS_TOKEN" \
--header "X-GitHub-Api-Version: 2022-11-28" \
"$API_URL/orgs/$ORG/members/$author"); then
echo "::error::Membership check failed for pull request #$pr_number."
exit 1
fi

case "$membership_status" in
204)
echo "Pull request #$pr_number was opened by an organization member; skipping."
continue
;;
404)
;;
*)
echo "::error::Membership check for pull request #$pr_number returned HTTP $membership_status."
exit 1
;;
esac

jq -n --arg label "$label" '{labels: [$label]}' |
gh api --method POST \
"repos/$REPO/issues/$pr_number/labels" \
--input - \
>/dev/null
echo "Labelled pull request #$pr_number."
done < <(
gh api --method GET --paginate "repos/$REPO/issues" \
-f state=open \
-f since="$updated_cutoff" \
-f sort=updated \
-f direction=desc \
-f per_page=100 |
jq -r '.[] | select(.pull_request != null) | .number'
)
5 changes: 2 additions & 3 deletions .github/workflows/ql-for-ql-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ jobs:
fetch-depth: 0
- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@main
uses: github/codeql-action/setup-codeql@main
with:
languages: javascript # does not matter
tools: nightly
- uses: ./.github/actions/os-version
id: os_version
Expand Down Expand Up @@ -61,7 +60,7 @@ jobs:
- name: Make database and analyze
run: |
./ql/target/release/buramu | tee deprecated.blame # Add a blame file for the extractor to parse.
${CODEQL} database create -l=ql ${DB} --search-path "${{ github.workspace }}"
${CODEQL} database create --threads=0 -l=ql ${DB} --search-path "${{ github.workspace }}"
${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 }}"
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/ql-for-ql-dataset_measure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ permissions:

jobs:
measure:
env:
CODEQL_THREADS: 4 # TODO: remove this once it's set by the CLI
strategy:
matrix:
repo:
Expand All @@ -29,9 +27,7 @@ jobs:

- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@main
with:
languages: javascript # does not matter
uses: github/codeql-action/setup-codeql@main
- uses: ./.github/actions/os-version
id: os_version
- uses: actions/cache@v3
Expand Down
Loading
Loading