Skip to content

Commit 3d0c9c4

Browse files
committed
Merge branch 'main' into test-ci
2 parents cd770e0 + 594b7ef commit 3d0c9c4

File tree

461 files changed

+13677
-61456
lines changed

Some content is hidden

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

461 files changed

+13677
-61456
lines changed

.github/ISSUE_TEMPLATE/ql---general.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ assignees: ''
1010
**Description of the issue**
1111

1212
<!-- Please explain briefly what is the problem.
13-
If it is about an LGTM project, please include its URL.-->
13+
If it is about a GitHub project, please include its URL. -->
1414

.github/actions/cache-query-compilation/action.yml

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,18 @@ outputs:
1414
runs:
1515
using: composite
1616
steps:
17-
# Cache the query compilation caches.
18-
# calculate the merge-base with main, in a way that works both on PRs and pushes to main.
19-
- name: Calculate merge-base
20-
shell: bash
21-
if: ${{ github.event_name == 'pull_request' }}
22-
env:
23-
BASE_BRANCH: ${{ github.base_ref }}
24-
run: |
25-
MERGE_BASE=$(git cat-file commit $GITHUB_SHA | grep '^parent ' | head -1 | cut -f 2 -d " ")
26-
echo "merge_base=$MERGE_BASE" >> $GITHUB_ENV
27-
- name: Read CodeQL query compilation - PR
28-
if: ${{ github.event_name == 'pull_request' }}
29-
uses: erik-krogh/actions-cache@a88d0603fe5fb5606db9f002dfcadeb32b5f84c6
17+
- name: Cache the query compilation caches
18+
uses: ./.github/actions/incremental-cache
3019
with:
3120
path: '**/.cache'
32-
read-only: true
33-
key: codeql-compile-${{ inputs.key }}-pr-${{ github.sha }} # deliberately not using the `compile-compile-main` keys here.
34-
restore-keys: |
35-
codeql-compile-${{ inputs.key }}-${{ github.base_ref }}-${{ env.merge_base }}
36-
codeql-compile-${{ inputs.key }}-${{ github.base_ref }}-
37-
codeql-compile-${{ inputs.key }}-main-
38-
- name: Fill CodeQL query compilation cache - main
39-
if: ${{ github.event_name != 'pull_request' }}
40-
uses: erik-krogh/actions-cache@a88d0603fe5fb5606db9f002dfcadeb32b5f84c6
41-
with:
42-
path: '**/.cache'
43-
key: codeql-compile-${{ inputs.key }}-${{ github.ref_name }}-${{ github.sha }} # just fill on main
44-
restore-keys: | # restore from another random commit, to speed up compilation.
45-
codeql-compile-${{ inputs.key }}-${{ github.ref_name }}-
46-
codeql-compile-${{ inputs.key }}-main-
21+
key: codeql-compile-${{ inputs.key }}
4722
- name: Fill compilation cache directory
4823
id: fill-compilation-dir
49-
shell: bash
24+
shell: bash
5025
run: |
5126
# Move all the existing cache into another folder, so we only preserve the cache for the current queries.
5227
node $GITHUB_WORKSPACE/.github/actions/cache-query-compilation/move-caches.js ${COMBINED_CACHE_DIR}
5328
5429
echo "compdir=${COMBINED_CACHE_DIR}" >> $GITHUB_OUTPUT
55-
env:
56-
COMBINED_CACHE_DIR: ${{ runner.temp }}/compilation-dir
30+
env:
31+
COMBINED_CACHE_DIR: ${{ runner.temp }}/compilation-dir
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Setup an incremental cache
2+
description: Special cache wrapper to be run on pull requests and pushes, that will try to restore
3+
a cache as close as possible to the merge base
4+
5+
inputs:
6+
path:
7+
description: 'The path to cache'
8+
required: true
9+
key:
10+
description: 'The cache key to use - should be unique to the workflow'
11+
required: true
12+
13+
runs:
14+
using: composite
15+
steps:
16+
# calculate the merge-base with main, in a way that works both on PRs and pushes to main.
17+
- name: Calculate merge-base
18+
shell: bash
19+
if: ${{ github.event_name == 'pull_request' }}
20+
env:
21+
BASE_BRANCH: ${{ github.base_ref }}
22+
run: |
23+
MERGE_BASE=$(git cat-file commit $GITHUB_SHA | grep '^parent ' | head -1 | cut -f 2 -d " ")
24+
echo "merge_base=$MERGE_BASE" >> $GITHUB_ENV
25+
- name: Restore read-only cache (PR)
26+
if: ${{ github.event_name == 'pull_request' }}
27+
uses: erik-krogh/actions-cache@a88d0603fe5fb5606db9f002dfcadeb32b5f84c6
28+
with:
29+
path: ${{ inputs.path }}
30+
read-only: true
31+
key: ${{ inputs.key }}-pr-${{ github.sha }}
32+
restore-keys: |
33+
${{ inputs.key }}-${{ github.base_ref }}-${{ env.merge_base }}
34+
${{ inputs.key }}-${{ github.base_ref }}-
35+
${{ inputs.key }}-main-
36+
- name: Fill cache (push)
37+
if: ${{ github.event_name != 'pull_request' }}
38+
uses: erik-krogh/actions-cache@a88d0603fe5fb5606db9f002dfcadeb32b5f84c6
39+
with:
40+
path: ${{ inputs.path }}
41+
key: ${{ inputs.key }}-${{ github.ref_name }}-${{ github.sha }} # just fill on main
42+
restore-keys: | # restore the latest cache if the exact cache is unavailable, to speed up compilation.
43+
${{ inputs.key }}-${{ github.ref_name }}-
44+
${{ inputs.key }}-main-

.github/workflows/go-tests-other-os.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ on:
55
- "go/**"
66
- "!go/ql/**" # don't run other-os if only ql/ files changed
77
- .github/workflows/go-tests-other-os.yml
8-
- .github/actions/fetch-codeql/action.yml
9-
- .github/actions/cache-query-compilation/action.yml
8+
- .github/actions/**
109
- codeql-workspace.yml
1110
jobs:
1211
test-mac:

.github/workflows/go-tests.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ on:
44
paths:
55
- "go/**"
66
- .github/workflows/go-tests.yml
7-
- .github/actions/fetch-codeql/action.yml
8-
- .github/actions/cache-query-compilation/action.yml
7+
- .github/actions/**
98
- codeql-workspace.yml
109
branches:
1110
- main
@@ -14,8 +13,7 @@ on:
1413
paths:
1514
- "go/**"
1615
- .github/workflows/go-tests.yml
17-
- .github/actions/fetch-codeql/action.yml
18-
- .github/actions/cache-query-compilation/action.yml
16+
- .github/actions/**
1917
- codeql-workspace.yml
2018
jobs:
2119
test-linux:
@@ -64,7 +62,7 @@ jobs:
6462
uses: ./.github/actions/cache-query-compilation
6563
with:
6664
key: go-qltest
67-
65+
6866
- name: Test
6967
run: |
7068
cd go

.github/workflows/swift.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ on:
77
- "misc/bazel/**"
88
- "*.bazel*"
99
- .github/workflows/swift.yml
10-
- .github/actions/fetch-codeql/action.yml
11-
- .github/actions/cache-query-compilation/action.yml
10+
- .github/actions/**
1211
- codeql-workspace.yml
1312
- .pre-commit-config.yaml
1413
- "!**/*.md"
@@ -22,8 +21,7 @@ on:
2221
- "misc/bazel/**"
2322
- "*.bazel*"
2423
- .github/workflows/swift.yml
25-
- .github/actions/fetch-codeql/action.yml
26-
- .github/actions/cache-query-compilation/action.yml
24+
- .github/actions/**
2725
- codeql-workspace.yml
2826
- "!**/*.md"
2927
- "!**/*.qhelp"
@@ -35,20 +33,15 @@ jobs:
3533
# not using a matrix as you cannot depend on a specific job in a matrix, and we want to start linux checks
3634
# without waiting for the macOS build
3735
build-and-test-macos:
38-
if: ${{ github.event_name == 'pull_request' }}
3936
runs-on: macos-12-xl
4037
steps:
4138
- uses: actions/checkout@v3
42-
- uses: ./swift/actions/create-extractor-pack
43-
- uses: ./swift/actions/run-quick-tests
44-
- uses: ./swift/actions/print-unextracted
39+
- uses: ./swift/actions/build-and-test
4540
build-and-test-linux:
4641
runs-on: ubuntu-latest-xl
4742
steps:
4843
- uses: actions/checkout@v3
49-
- uses: ./swift/actions/create-extractor-pack
50-
- uses: ./swift/actions/run-quick-tests
51-
- uses: ./swift/actions/print-unextracted
44+
- uses: ./swift/actions/build-and-test
5245
qltests-linux:
5346
needs: build-and-test-linux
5447
runs-on: ubuntu-latest-xl
@@ -80,7 +73,10 @@ jobs:
8073
runs-on: ubuntu-latest
8174
steps:
8275
- uses: actions/checkout@v3
83-
- uses: ./swift/actions/setup-env
76+
- uses: bazelbuild/setup-bazelisk@v2
77+
- uses: actions/setup-python@v4
78+
with:
79+
python-version-file: 'swift/.python-version'
8480
- uses: pre-commit/[email protected]
8581
name: Check that python code is properly formatted
8682
with:

cpp/ql/lib/definitions.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import IDEContextual
1212
*
1313
* In some cases it is preferable to modify locations (the
1414
* `hasLocationInfo()` predicate) so that they are short, and
15-
* non-overlapping with other locations that might be highlighted in
16-
* the LGTM interface.
15+
* non-overlapping with other locations that might be reported as
16+
* code scanning alerts on GitHub.
1717
*
1818
* We need to give locations that may not be in the database, so
1919
* we use `hasLocationInfo()` rather than `getLocation()`.

cpp/ql/src/Likely Bugs/RedundantNullCheckSimple.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
*/
1313

1414
/*
15-
* Note: this query is not assigned a precision yet because we don't want it on
16-
* LGTM until its performance is well understood.
15+
* Note: this query is not assigned a precision yet because we don't want it
16+
* to be included in query suites until its performance is well understood.
1717
*/
1818

1919
import cpp

cpp/ql/src/Metrics/Dependencies/ExternalDependencies.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class Library extends LibraryT {
5252
// The versions reported for C/C++ dependencies are just the versions that
5353
// happen to be installed on the system where the build takes place.
5454
// Reporting those versions is likely to cause misunderstandings, both for
55-
// people reading them and for the vulnerability checker of lgtm.
55+
// people reading them and for vulnerability checkers.
5656
result = "unknown"
5757
}
5858

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Console.WriteLine(args[0]);

0 commit comments

Comments
 (0)