Skip to content

Commit d001cc4

Browse files
committed
Merge branch 'main' into py-shell
2 parents 7598549 + 705691b commit d001cc4

File tree

3,747 files changed

+278371
-216931
lines changed

Some content is hidden

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

3,747 files changed

+278371
-216931
lines changed

.git-blame-ignore-revs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# .git-blame-ignore-revs
2+
# Auto-formatted Java
3+
730eae952139209fe9fdf598541d608f4c0c0c84
4+
# Auto-formatted C#
5+
5ad7ed49dd3de03ec6dcfcb6848758a6a987e11c
6+
# Auto-formatted C/C++
7+
ef97e539ec1971494d4bba5cafe82e00bc8217ac
8+
# Auto-formatted Python
9+
21d5fa836b3a7d020ba45e8b8168b145a9772131
10+
# Auto-formatted JavaScript
11+
8d97fe9ed327a9546ff2eaf515cf0f5214deddd9
12+
# Auto-formatted Ruby
13+
a5d229903d2f12d45f2c2c38822f1d0e7504ae7f
14+
# Auto-formatted Go
15+
08c658e66bf867090033ea096e244a93d46c0aa7
16+
# Auto-formatted Swift
17+
711d7057f79fb7d72fc3b35e010bd018f9009169
18+
# Auto-formatted shared ql packs
19+
3640b6d3a8ce9edf8e1d3ed106fe8526cf255bc0
20+
# Auto-formatted taint tracking files
21+
159d8e978c51959b380838c080d891b66e763b19

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

Lines changed: 103 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ inputs:
99
outputs:
1010
cache-dir:
1111
description: "The directory where the cache was stored"
12-
value: ${{ steps.fill-compilation-dir.outputs.compdir }}
12+
value: ${{ steps.output-compilation-dir.outputs.compdir }}
1313

1414
runs:
1515
using: composite
@@ -27,7 +27,9 @@ runs:
2727
if: ${{ github.event_name == 'pull_request' }}
2828
uses: actions/cache/restore@v3
2929
with:
30-
path: '**/.cache'
30+
path: |
31+
**/.cache
32+
~/.codeql/compile-cache
3133
key: codeql-compile-${{ inputs.key }}-pr-${{ github.sha }}
3234
restore-keys: |
3335
codeql-compile-${{ inputs.key }}-${{ github.base_ref }}-${{ env.merge_base }}
@@ -37,18 +39,111 @@ runs:
3739
if: ${{ github.event_name != 'pull_request' }}
3840
uses: actions/cache@v3
3941
with:
40-
path: '**/.cache'
42+
path: |
43+
**/.cache
44+
~/.codeql/compile-cache
4145
key: codeql-compile-${{ inputs.key }}-${{ github.ref_name }}-${{ github.sha }} # just fill on main
4246
restore-keys: | # restore the latest cache if the exact cache is unavailable, to speed up compilation.
4347
codeql-compile-${{ inputs.key }}-${{ github.ref_name }}-
4448
codeql-compile-${{ inputs.key }}-main-
45-
- name: Fill compilation cache directory
46-
id: fill-compilation-dir
49+
- name: Output-compilationdir
50+
id: output-compilation-dir
4751
shell: bash
4852
run: |
49-
# Move all the existing cache into another folder, so we only preserve the cache for the current queries.
50-
node $GITHUB_WORKSPACE/.github/actions/cache-query-compilation/move-caches.js ${COMBINED_CACHE_DIR}
51-
5253
echo "compdir=${COMBINED_CACHE_DIR}" >> $GITHUB_OUTPUT
5354
env:
5455
COMBINED_CACHE_DIR: ${{ runner.temp }}/compilation-dir
56+
- name: Fill compilation cache directory
57+
id: fill-compilation-dir
58+
uses: actions/github-script@v6
59+
env:
60+
COMBINED_CACHE_DIR: ${{ runner.temp }}/compilation-dir
61+
with:
62+
script: |
63+
// # Move all the existing cache into another folder, so we only preserve the cache for the current queries.
64+
// mkdir -p ${COMBINED_CACHE_DIR}
65+
// rm -f **/.cache/{lock,size} # -f to avoid errors if the cache is empty.
66+
// # copy the contents of the .cache folders into the combined cache folder.
67+
// cp -r **/.cache/* ${COMBINED_CACHE_DIR}/ || : # ignore missing files
68+
// # clean up the .cache folders
69+
// rm -rf **/.cache/*
70+
71+
const fs = require("fs");
72+
const path = require("path");
73+
const os = require("os");
74+
75+
// the first argv is the cache folder to create.
76+
const COMBINED_CACHE_DIR = process.env.COMBINED_CACHE_DIR;
77+
78+
function* walkCaches(dir) {
79+
const files = fs.readdirSync(dir, { withFileTypes: true });
80+
for (const file of files) {
81+
if (file.isDirectory()) {
82+
const filePath = path.join(dir, file.name);
83+
yield* walkCaches(filePath);
84+
if (file.name === ".cache") {
85+
yield filePath;
86+
}
87+
}
88+
}
89+
}
90+
91+
async function copyDir(src, dest) {
92+
for await (const file of await fs.promises.readdir(src, { withFileTypes: true })) {
93+
const srcPath = path.join(src, file.name);
94+
const destPath = path.join(dest, file.name);
95+
if (file.isDirectory()) {
96+
if (!fs.existsSync(destPath)) {
97+
fs.mkdirSync(destPath);
98+
}
99+
await copyDir(srcPath, destPath);
100+
} else {
101+
await fs.promises.copyFile(srcPath, destPath);
102+
}
103+
}
104+
}
105+
106+
async function main() {
107+
const cacheDirs = [...walkCaches(".")];
108+
109+
for (const dir of cacheDirs) {
110+
console.log(`Found .cache dir at ${dir}`);
111+
}
112+
113+
const globalCacheDir = path.join(os.homedir(), ".codeql", "compile-cache");
114+
if (fs.existsSync(globalCacheDir)) {
115+
console.log("Found global home dir: " + globalCacheDir);
116+
cacheDirs.push(globalCacheDir);
117+
}
118+
119+
if (cacheDirs.length === 0) {
120+
console.log("No cache dirs found");
121+
return;
122+
}
123+
124+
// mkdir -p ${COMBINED_CACHE_DIR}
125+
fs.mkdirSync(COMBINED_CACHE_DIR, { recursive: true });
126+
127+
// rm -f **/.cache/{lock,size} # -f to avoid errors if the cache is empty.
128+
await Promise.all(
129+
cacheDirs.map((cacheDir) =>
130+
(async function () {
131+
await fs.promises.rm(path.join(cacheDir, "lock"), { force: true });
132+
await fs.promises.rm(path.join(cacheDir, "size"), { force: true });
133+
})()
134+
)
135+
);
136+
137+
// # copy the contents of the .cache folders into the combined cache folder.
138+
// cp -r **/.cache/* ${COMBINED_CACHE_DIR}/ || : # ignore missing files
139+
await Promise.all(
140+
cacheDirs.map((cacheDir) => copyDir(cacheDir, COMBINED_CACHE_DIR))
141+
);
142+
143+
// # clean up the .cache folders
144+
// rm -rf **/.cache/*
145+
await Promise.all(
146+
cacheDirs.map((cacheDir) => fs.promises.rm(cacheDir, { recursive: true }))
147+
);
148+
}
149+
main();

.github/actions/cache-query-compilation/move-caches.js

Lines changed: 0 additions & 75 deletions
This file was deleted.

.github/actions/find-latest-bundle/action.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/check-qldoc.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ jobs:
2626
shell: bash
2727
run: |
2828
EXIT_CODE=0
29-
# TODO: remove the swift exception from the regex when we fix generated QLdoc
3029
# TODO: remove the shared exception from the regex when coverage of qlpacks without dbschemes is supported
31-
changed_lib_packs="$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | { grep -Po '^(?!(swift|shared))[a-z]*/ql/lib' || true; } | sort -u)"
30+
changed_lib_packs="$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | { grep -Po '^(?!(shared))[a-z]*/ql/lib' || true; } | sort -u)"
3231
for pack_dir in ${changed_lib_packs}; do
3332
lang="${pack_dir%/ql/lib}"
3433
codeql generate library-doc-coverage --output="${RUNNER_TEMP}/${lang}-current.txt" --dir="${pack_dir}"

.github/workflows/compile-queries.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ jobs:
2424
with:
2525
key: all-queries
2626
- name: check formatting
27-
run: find */ql -type f \( -name "*.qll" -o -name "*.ql" \) -print0 | xargs -0 codeql query format --check-only
27+
run: find */ql -type f \( -name "*.qll" -o -name "*.ql" \) -print0 | xargs -0 -n 3000 -P 10 codeql query format -q --check-only
2828
- name: compile queries - check-only
2929
# run with --check-only if running in a PR (github.sha != main)
3030
if : ${{ github.event_name == 'pull_request' }}
3131
shell: bash
32-
run: codeql query compile -j0 */ql/{src,examples} --keep-going --warnings=error --check-only --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
32+
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --check-only --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
3333
- name: compile queries - full
3434
# do full compile if running on main - this populates the cache
3535
if : ${{ github.event_name != 'pull_request' }}
3636
shell: bash
37-
run: codeql query compile -j0 */ql/{src,examples} --keep-going --warnings=error --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"
37+
run: codeql query compile -q -j0 */ql/{src,examples} --keep-going --warnings=error --compilation-cache "${{ steps.query-cache.outputs.cache-dir }}"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
name: Test MacOS
1313
runs-on: macos-latest
1414
steps:
15-
- name: Set up Go 1.19
15+
- name: Set up Go 1.20
1616
uses: actions/setup-go@v3
1717
with:
18-
go-version: 1.19
18+
go-version: 1.20.0
1919
id: go
2020

2121
- name: Check out code
@@ -47,10 +47,10 @@ jobs:
4747
name: Test Windows
4848
runs-on: windows-latest-xl
4949
steps:
50-
- name: Set up Go 1.19
50+
- name: Set up Go 1.20
5151
uses: actions/setup-go@v3
5252
with:
53-
go-version: 1.19
53+
go-version: 1.20.0
5454
id: go
5555

5656
- name: Check out code

.github/workflows/go-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
name: Test Linux (Ubuntu)
2121
runs-on: ubuntu-latest-xl
2222
steps:
23-
- name: Set up Go 1.19
23+
- name: Set up Go 1.20
2424
uses: actions/setup-go@v3
2525
with:
26-
go-version: 1.19
26+
go-version: 1.20.0
2727
id: go
2828

2929
- name: Check out code

0 commit comments

Comments
 (0)