Skip to content

Commit 63c3a71

Browse files
authored
Merge branch 'main' into active-threat-model-source
2 parents 13a4df9 + e48e18a commit 63c3a71

File tree

4,001 files changed

+128739
-48151
lines changed

Some content is hidden

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

4,001 files changed

+128739
-48151
lines changed

.github/labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ Ruby:
3030
- ruby/**/*
3131
- change-notes/**/*ruby*
3232

33+
Rust:
34+
- rust/**/*
35+
- change-notes/**/*rust*
36+
3337
Swift:
3438
- swift/**/*
3539
- change-notes/**/*swift*

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111

1212
- [ ] Autofixes generated based on these changes are valid, only needed if this PR makes significant changes to `.ql`, `.qll`, or `.qhelp` files. See [the documentation](https://github.com/github/codeql-team/blob/main/docs/best-practices/validating-autofix-for-query-changes.md) (internal access required).
1313
- [ ] Changes are validated [at scale](https://github.com/github/codeql-dca/) (internal access required).
14+
- [ ] Adding a new query? Consider also [adding the query to autofix](https://github.com/github/codeml-autofix/blob/main/docs/updating-query-support.md#adding-a-new-query-to-the-query-suite).

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ on:
1616
- "shared/**/*.qll"
1717
- "!**/experimental/**"
1818
- "!ql/**"
19+
- "!rust/**"
1920
- ".github/workflows/check-change-note.yml"
2021

2122
jobs:
2223
check-change-note:
23-
env:
24+
env:
2425
REPO: ${{ github.repository }}
2526
PULL_REQUEST_NUMBER: ${{ github.event.number }}
2627
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -33,7 +34,7 @@ jobs:
3334
!contains(github.event.pull_request.labels.*.name, 'no-change-note-required')
3435
run: |
3536
change_note_files=$(gh api "repos/$REPO/pulls/$PULL_REQUEST_NUMBER/files" --paginate --jq '.[].filename | select(test("/change-notes/.*[.]md$"))')
36-
37+
3738
if [ -z "$change_note_files" ]; then
3839
echo "No change note found. Either add one, or add the 'no-change-note-required' label."
3940
exit 1

.github/workflows/go-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
paths:
55
- "go/**"
6+
- "shared/**"
67
- .github/workflows/go-tests.yml
78
- .github/actions/**
89
- codeql-workspace.yml
@@ -12,6 +13,7 @@ on:
1213
pull_request:
1314
paths:
1415
- "go/**"
16+
- "shared/**"
1517
- .github/workflows/go-tests.yml
1618
- .github/actions/**
1719
- codeql-workspace.yml

.github/workflows/ruby-build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ jobs:
6565
id: cache-extractor
6666
with:
6767
path: |
68-
ruby/extractor/target/release/codeql-extractor-ruby
69-
ruby/extractor/target/release/codeql-extractor-ruby.exe
68+
target/release/codeql-extractor-ruby
69+
target/release/codeql-extractor-ruby.exe
7070
ruby/extractor/ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
7171
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-extractor-${{ hashFiles('ruby/extractor/rust-toolchain.toml', 'ruby/extractor/Cargo.lock') }}-${{ hashFiles('shared/tree-sitter-extractor') }}-${{ hashFiles('ruby/extractor/**/*.rs') }}
7272
- uses: actions/cache@v3
@@ -75,7 +75,7 @@ jobs:
7575
path: |
7676
~/.cargo/registry
7777
~/.cargo/git
78-
ruby/target
78+
target
7979
key: ${{ runner.os }}-${{ steps.os_version.outputs.version }}-ruby-rust-cargo-${{ hashFiles('ruby/extractor/rust-toolchain.toml', 'ruby/extractor/**/Cargo.lock') }}
8080
- name: Check formatting
8181
if: steps.cache-extractor.outputs.cache-hit != 'true'
@@ -91,7 +91,7 @@ jobs:
9191
run: cd extractor && cargo build --release
9292
- name: Generate dbscheme
9393
if: ${{ matrix.os == 'ubuntu-latest' && steps.cache-extractor.outputs.cache-hit != 'true'}}
94-
run: extractor/target/release/codeql-extractor-ruby generate --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
94+
run: ../target/release/codeql-extractor-ruby generate --dbscheme ql/lib/ruby.dbscheme --library ql/lib/codeql/ruby/ast/internal/TreeSitter.qll
9595
- uses: actions/upload-artifact@v3
9696
if: ${{ matrix.os == 'ubuntu-latest' }}
9797
with:
@@ -106,8 +106,8 @@ jobs:
106106
with:
107107
name: extractor-${{ matrix.os }}
108108
path: |
109-
ruby/extractor/target/release/codeql-extractor-ruby
110-
ruby/extractor/target/release/codeql-extractor-ruby.exe
109+
target/release/codeql-extractor-ruby
110+
target/release/codeql-extractor-ruby.exe
111111
retention-days: 1
112112
compile-queries:
113113
if: github.repository_owner == 'github'

.github/workflows/rust.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: "Rust"
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "rust/**"
7+
- "misc/bazel/**"
8+
- "misc/codegen/**"
9+
- "shared/**"
10+
- "MODULE.bazel"
11+
- .github/workflows/rust.yml
12+
- .github/actions/**
13+
- codeql-workspace.yml
14+
- "!**/*.md"
15+
- "!**/*.qhelp"
16+
branches:
17+
- rust-experiment
18+
- main
19+
- rc/*
20+
- codeql-cli-*
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
rust-code:
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
- name: Format
32+
working-directory: rust/extractor
33+
shell: bash
34+
run: |
35+
cargo fmt --check
36+
- name: Compilation
37+
working-directory: rust/extractor
38+
shell: bash
39+
run: cargo check
40+
- name: Clippy
41+
working-directory: rust/extractor
42+
shell: bash
43+
run: |
44+
cargo clippy --fix
45+
git diff --exit-code
46+
rust-codegen:
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v4
51+
- name: Install CodeQL
52+
uses: ./.github/actions/fetch-codeql
53+
- name: Code generation
54+
shell: bash
55+
run: |
56+
bazel run //rust/codegen
57+
git add .
58+
git diff --exit-code HEAD

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,9 @@ node_modules/
6565

6666
# bazel-built in-tree extractor packs
6767
/*/extractor-pack
68+
69+
# Jetbrains IDE files
70+
.idea
71+
72+
# cargo build directory
73+
/target

.pre-commit-config.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ repos:
55
rev: v3.2.0
66
hooks:
77
- id: trailing-whitespace
8-
exclude: /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)|.*\.patch
8+
exclude: /test/.*$(?<!\.qlref)|.*\.patch$|.*\.qll?$
99
- id: end-of-file-fixer
10-
exclude: /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)|.*\.patch
10+
exclude: /test/.*$(?<!\.qlref)|.*\.patch$|.*\.qll?$
1111

1212
- repo: https://github.com/pre-commit/mirrors-clang-format
1313
rev: v17.0.6
1414
hooks:
1515
- id: clang-format
1616

1717
- repo: https://github.com/pre-commit/mirrors-autopep8
18-
rev: v1.6.0
18+
rev: v2.0.4
1919
hooks:
2020
- id: autopep8
2121
files: ^misc/codegen/.*\.py
@@ -45,7 +45,7 @@ repos:
4545

4646
- id: sync-files
4747
name: Fix files required to be identical
48-
files: \.(qll?|qhelp|swift)$|^config/identical-files\.json$
48+
files: \.(qll?|qhelp|swift|toml)$|^config/identical-files\.json$
4949
language: system
5050
entry: python3 config/sync-files.py --latest
5151
pass_filenames: false
@@ -58,7 +58,7 @@ repos:
5858

5959
- id: swift-codegen
6060
name: Run Swift checked in code generation
61-
files: ^swift/(schema.py$|codegen/|.*/generated/|ql/lib/(swift\.dbscheme$|codeql/swift/elements)|ql/\.generated.list)
61+
files: ^misc/codegen/|^swift/(schema.py$|codegen/|.*/generated/|ql/lib/(swift\.dbscheme$|codeql/swift/elements)|ql/\.generated.list)
6262
language: system
6363
entry: bazel run //swift/codegen -- --quiet
6464
pass_filenames: false
@@ -69,3 +69,17 @@ repos:
6969
language: system
7070
entry: bazel test //misc/codegen/test
7171
pass_filenames: false
72+
73+
- id: rust-codegen
74+
name: Run Rust checked in code generation
75+
files: ^misc/codegen/|^rust/(schema.py$|codegen/|.*/generated/|ql/lib/(rust\.dbscheme$|codeql/rust/elements)|\.generated.list)
76+
language: system
77+
entry: bazel run //rust/codegen -- --quiet
78+
pass_filenames: false
79+
80+
- id: rust-lint
81+
name: Run fmt and clippy on Rust code
82+
files: ^rust/extractor/(.*rs|Cargo.toml)$
83+
language: system
84+
entry: python3 rust/lint.py
85+
pass_filenames: false

0 commit comments

Comments
 (0)