Skip to content

Commit 6b1865d

Browse files
authored
Merge branch 'main' into p--ruby-kernel-open-addition
2 parents deb3acc + 0cd50aa commit 6b1865d

File tree

65 files changed

+1535
-990
lines changed

Some content is hidden

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

65 files changed

+1535
-990
lines changed

.github/ISSUE_TEMPLATE/ql--false-positive.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: CodeQL False positive
2+
name: CodeQL false positive
33
about: Report CodeQL alerts that you think should not have been detected (not applicable, not exploitable, etc.)
44
title: False positive
55
labels: false-positive
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: "Go: Run Tests - Other OS"
2+
on:
3+
pull_request:
4+
paths:
5+
- "go/**"
6+
- "!go/ql/**" # don't run other-os if only ql/ files changed
7+
- .github/workflows/go-tests-other-os.yml
8+
- .github/actions/fetch-codeql/action.yml
9+
- .github/actions/cache-query-compilation/action.yml
10+
- codeql-workspace.yml
11+
jobs:
12+
test-mac:
13+
name: Test MacOS
14+
runs-on: macos-latest
15+
steps:
16+
- name: Set up Go 1.19
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version: 1.19
20+
id: go
21+
22+
- name: Check out code
23+
uses: actions/checkout@v2
24+
25+
- name: Set up CodeQL CLI
26+
uses: ./.github/actions/fetch-codeql
27+
28+
- name: Enable problem matchers in repository
29+
shell: bash
30+
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
31+
32+
- name: Build
33+
run: |
34+
cd go
35+
make
36+
37+
- name: Cache compilation cache
38+
id: query-cache
39+
uses: ./.github/actions/cache-query-compilation
40+
with:
41+
key: go-qltest
42+
- name: Test
43+
run: |
44+
cd go
45+
make test cache="${{ steps.query-cache.outputs.cache-dir }}"
46+
47+
test-win:
48+
name: Test Windows
49+
runs-on: windows-latest-xl
50+
steps:
51+
- name: Set up Go 1.19
52+
uses: actions/setup-go@v3
53+
with:
54+
go-version: 1.19
55+
id: go
56+
57+
- name: Check out code
58+
uses: actions/checkout@v2
59+
60+
- name: Set up CodeQL CLI
61+
uses: ./.github/actions/fetch-codeql
62+
63+
- name: Enable problem matchers in repository
64+
shell: bash
65+
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
66+
67+
- name: Build
68+
run: |
69+
cd go
70+
make
71+
72+
- name: Cache compilation cache
73+
id: query-cache
74+
uses: ./.github/actions/cache-query-compilation
75+
with:
76+
key: go-qltest
77+
78+
- name: Test
79+
run: |
80+
cd go
81+
make test cache="${{ steps.query-cache.outputs.cache-dir }}"

.github/workflows/go-tests.yml

Lines changed: 19 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
name: "Go: Run Tests"
22
on:
3+
push:
4+
paths:
5+
- "go/**"
6+
- .github/workflows/go-tests.yml
7+
- .github/actions/fetch-codeql/action.yml
8+
- .github/actions/cache-query-compilation/action.yml
9+
- codeql-workspace.yml
10+
branches:
11+
- main
12+
- "rc/*"
313
pull_request:
414
paths:
515
- "go/**"
616
- .github/workflows/go-tests.yml
717
- .github/actions/fetch-codeql/action.yml
18+
- .github/actions/cache-query-compilation/action.yml
819
- codeql-workspace.yml
920
jobs:
1021
test-linux:
1122
name: Test Linux (Ubuntu)
12-
runs-on: ubuntu-latest
23+
runs-on: ubuntu-latest-xl
1324
steps:
1425
- name: Set up Go 1.19
1526
uses: actions/setup-go@v3
@@ -32,7 +43,7 @@ jobs:
3243
cd go
3344
make
3445
35-
- name: Check that all QL and Go code is autoformatted
46+
- name: Check that all Go code is autoformatted
3647
run: |
3748
cd go
3849
make check-formatting
@@ -48,67 +59,13 @@ jobs:
4859
name: qhelp-markdown
4960
path: go/qhelp-out/**/*.md
5061

51-
- name: Test
52-
run: |
53-
cd go
54-
make test
55-
56-
test-mac:
57-
name: Test MacOS
58-
runs-on: macos-latest
59-
steps:
60-
- name: Set up Go 1.19
61-
uses: actions/setup-go@v3
62-
with:
63-
go-version: 1.19
64-
id: go
65-
66-
- name: Check out code
67-
uses: actions/checkout@v2
68-
69-
- name: Set up CodeQL CLI
70-
uses: ./.github/actions/fetch-codeql
71-
72-
- name: Enable problem matchers in repository
73-
shell: bash
74-
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
75-
76-
- name: Build
77-
run: |
78-
cd go
79-
make
80-
81-
- name: Test
82-
run: |
83-
cd go
84-
make test
85-
86-
test-win:
87-
name: Test Windows
88-
runs-on: windows-2019
89-
steps:
90-
- name: Set up Go 1.19
91-
uses: actions/setup-go@v3
62+
- name: Cache compilation cache
63+
id: query-cache
64+
uses: ./.github/actions/cache-query-compilation
9265
with:
93-
go-version: 1.19
94-
id: go
95-
96-
- name: Check out code
97-
uses: actions/checkout@v2
98-
99-
- name: Set up CodeQL CLI
100-
uses: ./.github/actions/fetch-codeql
101-
102-
- name: Enable problem matchers in repository
103-
shell: bash
104-
run: 'find .github/problem-matchers -name \*.json -exec echo "::add-matcher::{}" \;'
105-
106-
- name: Build
107-
run: |
108-
cd go
109-
make
110-
66+
key: go-qltest
67+
11168
- name: Test
11269
run: |
11370
cd go
114-
make test
71+
make test cache="${{ steps.query-cache.outputs.cache-dir }}"

.github/workflows/swift.yml

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,92 +8,76 @@ on:
88
- "*.bazel*"
99
- .github/workflows/swift.yml
1010
- .github/actions/fetch-codeql/action.yml
11+
- .github/actions/cache-query-compilation/action.yml
1112
- codeql-workspace.yml
1213
- .pre-commit-config.yaml
1314
- "!**/*.md"
1415
- "!**/*.qhelp"
1516
branches:
1617
- main
18+
- rc/*
19+
push:
20+
paths:
21+
- "swift/**"
22+
- "misc/bazel/**"
23+
- "*.bazel*"
24+
- .github/workflows/swift.yml
25+
- .github/actions/fetch-codeql/action.yml
26+
- .github/actions/cache-query-compilation/action.yml
27+
- codeql-workspace.yml
28+
- "!**/*.md"
29+
- "!**/*.qhelp"
30+
branches:
31+
- main
32+
- rc/*
1733

1834
jobs:
19-
changes:
20-
runs-on: ubuntu-latest
21-
outputs:
22-
codegen: ${{ steps.filter.outputs.codegen }}
23-
ql: ${{ steps.filter.outputs.ql }}
24-
steps:
25-
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50
26-
id: filter
27-
with:
28-
filters: |
29-
codegen:
30-
- '.github/workflows/swift.yml'
31-
- "misc/bazel/**"
32-
- "*.bazel*"
33-
- 'swift/actions/setup-env/**'
34-
- '.pre-commit-config.yaml'
35-
- 'swift/codegen/**'
36-
- 'swift/schema.py'
37-
- 'swift/**/*.dbscheme'
38-
- 'swift/ql/lib/codeql/swift/elements.qll'
39-
- 'swift/ql/lib/codeql/swift/elements/**'
40-
- 'swift/ql/lib/codeql/swift/generated/**'
41-
- 'swift/ql/test/extractor-tests/generated/**'
42-
- 'swift/ql/.generated.list'
43-
ql:
44-
- 'github/workflows/swift.yml'
45-
- 'swift/**/*.ql'
46-
- 'swift/**/*.qll'
4735
# not using a matrix as you cannot depend on a specific job in a matrix, and we want to start linux checks
4836
# without waiting for the macOS build
4937
build-and-test-macos:
38+
if: ${{ github.event_name == 'pull_request' }}
5039
runs-on: macos-12-xl
5140
steps:
5241
- uses: actions/checkout@v3
5342
- uses: ./swift/actions/create-extractor-pack
5443
- uses: ./swift/actions/run-quick-tests
5544
- uses: ./swift/actions/print-unextracted
5645
build-and-test-linux:
57-
runs-on: ubuntu-20.04
46+
runs-on: ubuntu-latest-xl
5847
steps:
5948
- uses: actions/checkout@v3
6049
- uses: ./swift/actions/create-extractor-pack
6150
- uses: ./swift/actions/run-quick-tests
6251
- uses: ./swift/actions/print-unextracted
6352
qltests-linux:
6453
needs: build-and-test-linux
65-
runs-on: ubuntu-latest
54+
runs-on: ubuntu-latest-xl
6655
steps:
6756
- uses: actions/checkout@v3
6857
- uses: ./swift/actions/run-ql-tests
6958
qltests-macos:
59+
if : ${{ github.event_name == 'pull_request' }}
7060
needs: build-and-test-macos
7161
runs-on: macos-12-xl
72-
strategy:
73-
fail-fast: false
74-
matrix:
75-
slice: ["1/2", "2/2"]
7662
steps:
7763
- uses: actions/checkout@v3
7864
- uses: ./swift/actions/run-ql-tests
79-
with:
80-
flags: --slice ${{ matrix.slice }}
8165
integration-tests-linux:
8266
needs: build-and-test-linux
83-
runs-on: ubuntu-latest
67+
runs-on: ubuntu-latest-xl
8468
steps:
8569
- uses: actions/checkout@v3
8670
- uses: ./swift/actions/run-integration-tests
8771
integration-tests-macos:
72+
if : ${{ github.event_name == 'pull_request' }}
8873
needs: build-and-test-macos
8974
runs-on: macos-12-xl
9075
steps:
9176
- uses: actions/checkout@v3
9277
- uses: ./swift/actions/run-integration-tests
9378
codegen:
79+
if : ${{ github.event_name == 'pull_request' }}
9480
runs-on: ubuntu-latest
95-
needs: changes
96-
if: ${{ needs.changes.outputs.codegen == 'true' }}
9781
steps:
9882
- uses: actions/checkout@v3
9983
- uses: ./swift/actions/setup-env
@@ -114,6 +98,7 @@ jobs:
11498
name: swift-generated-cpp-files
11599
path: generated-cpp-files/**
116100
database-upgrade-scripts:
101+
if : ${{ github.event_name == 'pull_request' }}
117102
runs-on: ubuntu-latest
118103
steps:
119104
- uses: actions/checkout@v3

codeql-workspace.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ provide:
2525
- "misc/suite-helpers/qlpack.yml"
2626
- "ruby/extractor-pack/codeql-extractor.yml"
2727
- "swift/extractor-pack/codeql-extractor.yml"
28+
- "swift/integration-tests/qlpack.yml"
2829
- "ql/extractor-pack/codeql-extractor.yml"
2930

3031
versionPolicies:

go/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ autoformat:
3434
find . -path '**/vendor' -prune -or -type f -iname '*.go' ! -empty -print0 | xargs -0 grep -L "//\s*autoformat-ignore" | xargs gofmt -w
3535

3636
check-formatting:
37-
find ql -iregex '.*\.qll?' -print0 | xargs -0 codeql query format --check-only
3837
test -z "$$(find . -path '**/vendor' -prune -or -type f -iname '*.go' ! -empty -print0 | xargs -0 grep -L "//\s*autoformat-ignore" | xargs gofmt -l)"
3938

4039
install-deps:
@@ -117,9 +116,9 @@ ql/lib/go.dbscheme.stats: ql/lib/go.dbscheme build/stats/src.stamp extractor
117116
codeql dataset measure -o $@ build/stats/database/db-go
118117

119118
test: all build/testdb/check-upgrade-path
120-
codeql test run ql/test --search-path build/codeql-extractor-go --consistency-queries ql/test/consistency
119+
codeql test run -j0 ql/test --search-path build/codeql-extractor-go --consistency-queries ql/test/consistency --compilation-cache=$(cache)
121120
# use GOOS=linux because GOOS=darwin GOARCH=386 is no longer supported
122-
env GOOS=linux GOARCH=386 codeql$(EXE) test run ql/test/query-tests/Security/CWE-681 --search-path build/codeql-extractor-go --consistency-queries ql/test/consistency
121+
env GOOS=linux GOARCH=386 codeql$(EXE) test run -j0 ql/test/query-tests/Security/CWE-681 --search-path build/codeql-extractor-go --consistency-queries ql/test/consistency --compilation-cache=$(cache)
123122
cd extractor; go test -mod=vendor ./... | grep -vF "[no test files]"
124123
bash extractor-smoke-test/test.sh || (echo "Extractor smoke test FAILED"; exit 1)
125124

java/kotlin-extractor/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
kotlin.code.style=official
2-
kotlinVersion=1.7.0
2+
kotlinVersion=1.7.21
33

44
GROUP=com.github.codeql
55
VERSION_NAME=0.0.1

java/kotlin-extractor/kotlin_plugin_versions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ def version_string_to_tuple(version):
2222
return tuple([int(m.group(i)) for i in range(1, 4)] + [m.group(4)])
2323

2424
# Version number used by CI. It needs to be one of the versions in many_versions.
25-
ci_version = '1.7.0'
25+
ci_version = '1.7.20'
2626

2727
# Version numbers in the list need to be in semantically increasing order
28-
many_versions = [ '1.4.32', '1.5.0', '1.5.10', '1.5.20', '1.5.30', '1.6.0', '1.6.20', '1.7.0', '1.7.20-Beta' ]
28+
many_versions = [ '1.4.32', '1.5.0', '1.5.10', '1.5.20', '1.5.30', '1.6.0', '1.6.20', '1.7.0', '1.7.20' ]
2929

3030
many_versions_tuples = [version_string_to_tuple(v) for v in many_versions]
3131

0 commit comments

Comments
 (0)