Skip to content

Commit 95c9f89

Browse files
authored
Merge branch 'main' into patch-1
2 parents d9826c5 + d5682f1 commit 95c9f89

File tree

9,867 files changed

+974640
-309220
lines changed

Some content is hidden

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

9,867 files changed

+974640
-309220
lines changed

.codeqlmanifest.json

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
1-
{ "provide": [ "*/ql/src/qlpack.yml",
2-
"*/ql/test/qlpack.yml",
3-
"*/ql/examples/qlpack.yml",
4-
"*/upgrades/qlpack.yml",
5-
"misc/legacy-support/*/qlpack.yml",
6-
"misc/suite-helpers/qlpack.yml" ] }
1+
{
2+
"provide": [
3+
"*/ql/src/qlpack.yml",
4+
"*/ql/lib/qlpack.yml",
5+
"*/ql/test/qlpack.yml",
6+
"*/ql/examples/qlpack.yml",
7+
"*/upgrades/qlpack.yml",
8+
"cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted/qlpack.yml",
9+
"javascript/ql/experimental/adaptivethreatmodeling/lib/qlpack.yml",
10+
"javascript/ql/experimental/adaptivethreatmodeling/src/qlpack.yml",
11+
"csharp/ql/campaigns/Solorigate/lib/qlpack.yml",
12+
"csharp/ql/campaigns/Solorigate/src/qlpack.yml",
13+
"csharp/ql/campaigns/Solorigate/test/qlpack.yml",
14+
"misc/legacy-support/*/qlpack.yml",
15+
"misc/suite-helpers/qlpack.yml",
16+
"ruby/extractor-pack/codeql-extractor.yml",
17+
"ruby/ql/consistency-queries/qlpack.yml",
18+
"ql/ql/consistency-queries/qlpack.yml",
19+
"ql/extractor-pack/codeql-extractor.yml"
20+
],
21+
"versionPolicies": {
22+
"default": {
23+
"requireChangeNotes": true,
24+
"committedPrereleaseSuffix": "dev",
25+
"committedVersion": "nextPatchRelease"
26+
}
27+
}
28+
}

.devcontainer/devcontainer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
"extensions": [
3+
"rust-lang.rust",
4+
"bungcip.better-toml",
35
"github.vscode-codeql",
46
"slevesque.vscode-zipexplorer"
57
],
68
"settings": {
9+
"files.watcherExclude": {
10+
"**/target/**": true
11+
},
712
"codeQL.runningQueries.memory": 2048
813
}
914
}

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@
4848
*.gif -text
4949
*.dll -text
5050
*.pdb -text
51+
52+
java/ql/test/stubs/**/*.java linguist-generated=true
53+
java/ql/test/experimental/stubs/**/*.java linguist-generated=true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Fetch CodeQL
2+
description: Fetches the latest version of CodeQL
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Fetch CodeQL
7+
shell: bash
8+
run: |
9+
LATEST=$(gh release list --repo https://github.com/github/codeql-cli-binaries | cut -f 1 | grep -v beta | sort --version-sort | tail -1)
10+
gh release download --repo https://github.com/github/codeql-cli-binaries --pattern codeql-linux64.zip "$LATEST"
11+
unzip -q -d "${RUNNER_TEMP}" codeql-linux64.zip
12+
echo "${RUNNER_TEMP}/codeql" >> "${GITHUB_PATH}"
13+
env:
14+
GITHUB_TOKEN: ${{ github.token }}

.github/dependabot.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
directory: "ruby/node-types"
5+
schedule:
6+
interval: "daily"
7+
- package-ecosystem: "cargo"
8+
directory: "ruby/generator"
9+
schedule:
10+
interval: "daily"
11+
- package-ecosystem: "cargo"
12+
directory: "ruby/extractor"
13+
schedule:
14+
interval: "daily"
15+
- package-ecosystem: "cargo"
16+
directory: "ruby/autobuilder"
17+
schedule:
18+
interval: "daily"

.github/labeler.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ Python:
1818
- python/**/*
1919
- change-notes/**/*python*
2020

21+
Ruby:
22+
- ruby/**/*
23+
- change-notes/**/*ruby*
24+
2125
documentation:
2226
- "**/*.qhelp"
2327
- "**/*.md"
2428
- docs/**/*
29+
30+
"QL-for-QL":
31+
- ql/**/*

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- "*/ql/src/**/*.ql"
88
- "*/ql/src/**/*.qll"
99
- "!**/experimental/**"
10+
- "!ql/**"
1011

1112
jobs:
1213
check-change-note:
@@ -19,5 +20,5 @@ jobs:
1920
env:
2021
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2122
run: |
22-
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate |
23-
jq 'any(.[].filename ; test("/change-notes/.*[.]md$"))' --exit-status
23+
gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq 'any(.[].filename ; test("/change-notes/.*[.]md$"))' |
24+
grep true -c

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
- 'rc/*'
1212
paths:
1313
- 'csharp/**'
14+
- '.github/codeql/**'
15+
- '.github/workflows/codeql-analysis.yml'
1416
schedule:
1517
- cron: '0 9 * * 1'
1618

@@ -38,8 +40,8 @@ jobs:
3840

3941
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
4042
# If this step fails, then you should remove it and run the build manually (see below)
41-
- name: Autobuild
42-
uses: github/codeql-action/autobuild@main
43+
#- name: Autobuild
44+
# uses: github/codeql-action/autobuild@main
4345

4446
# ℹ️ Command-line programs to run using the OS shell.
4547
# 📚 https://git.io/JvXDl
@@ -48,9 +50,8 @@ jobs:
4850
# and modify them (or add more) to build your code if your project
4951
# uses a compiled language
5052

51-
#- run: |
52-
# make bootstrap
53-
# make release
53+
- run: |
54+
dotnet build csharp
5455
5556
- name: Perform CodeQL Analysis
5657
uses: github/codeql-action/analyze@main
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Check framework coverage changes
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '.github/workflows/csv-coverage-pr-comment.yml'
7+
- '*/ql/src/**/*.ql'
8+
- '*/ql/src/**/*.qll'
9+
- '*/ql/lib/**/*.ql'
10+
- '*/ql/lib/**/*.qll'
11+
- 'misc/scripts/library-coverage/*.py'
12+
# input data files
13+
- '*/documentation/library-coverage/cwe-sink.csv'
14+
- '*/documentation/library-coverage/frameworks.csv'
15+
branches:
16+
- main
17+
- 'rc/*'
18+
19+
jobs:
20+
generate:
21+
name: Generate framework coverage artifacts
22+
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Dump GitHub context
27+
env:
28+
GITHUB_CONTEXT: ${{ toJSON(github.event) }}
29+
run: echo "$GITHUB_CONTEXT"
30+
- name: Clone self (github/codeql) - MERGE
31+
uses: actions/checkout@v2
32+
with:
33+
path: merge
34+
- name: Clone self (github/codeql) - BASE
35+
uses: actions/checkout@v2
36+
with:
37+
fetch-depth: 2
38+
path: base
39+
- run: |
40+
git checkout HEAD^1
41+
git log -1 --format='%H'
42+
working-directory: base
43+
- name: Set up Python 3.8
44+
uses: actions/setup-python@v2
45+
with:
46+
python-version: 3.8
47+
- name: Download CodeQL CLI
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
run: |
51+
gh release download --repo "github/codeql-cli-binaries" --pattern "codeql-linux64.zip"
52+
- name: Unzip CodeQL CLI
53+
run: unzip -d codeql-cli codeql-linux64.zip
54+
- name: Generate CSV files on merge commit of the PR
55+
run: |
56+
echo "Running generator on merge"
57+
PATH="$PATH:codeql-cli/codeql" python merge/misc/scripts/library-coverage/generate-report.py ci merge merge
58+
mkdir out_merge
59+
cp framework-coverage-*.csv out_merge/
60+
cp framework-coverage-*.rst out_merge/
61+
- name: Generate CSV files on base commit of the PR
62+
run: |
63+
echo "Running generator on base"
64+
PATH="$PATH:codeql-cli/codeql" python base/misc/scripts/library-coverage/generate-report.py ci base base
65+
mkdir out_base
66+
cp framework-coverage-*.csv out_base/
67+
cp framework-coverage-*.rst out_base/
68+
- name: Generate diff of coverage reports
69+
run: |
70+
python base/misc/scripts/library-coverage/compare-folders.py out_base out_merge comparison.md
71+
- name: Upload CSV package list
72+
uses: actions/upload-artifact@v2
73+
with:
74+
name: csv-framework-coverage-merge
75+
path: |
76+
out_merge/framework-coverage-*.csv
77+
out_merge/framework-coverage-*.rst
78+
- name: Upload CSV package list
79+
uses: actions/upload-artifact@v2
80+
with:
81+
name: csv-framework-coverage-base
82+
path: |
83+
out_base/framework-coverage-*.csv
84+
out_base/framework-coverage-*.rst
85+
- name: Upload comparison results
86+
uses: actions/upload-artifact@v2
87+
with:
88+
name: comparison
89+
path: |
90+
comparison.md
91+
- name: Save PR number
92+
run: |
93+
mkdir -p pr
94+
echo ${{ github.event.pull_request.number }} > pr/NR
95+
- name: Upload PR number
96+
uses: actions/upload-artifact@v2
97+
with:
98+
name: pr
99+
path: pr/
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Comment on PR with framework coverage changes
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Check framework coverage changes"]
6+
types:
7+
- completed
8+
9+
jobs:
10+
check:
11+
name: Check framework coverage differences and comment
12+
runs-on: ubuntu-latest
13+
if: >
14+
${{ github.event.workflow_run.event == 'pull_request' &&
15+
github.event.workflow_run.conclusion == 'success' }}
16+
17+
steps:
18+
- name: Dump GitHub context
19+
env:
20+
GITHUB_CONTEXT: ${{ toJSON(github.event) }}
21+
run: echo "$GITHUB_CONTEXT"
22+
- name: Clone self (github/codeql)
23+
uses: actions/checkout@v2
24+
- name: Set up Python 3.8
25+
uses: actions/setup-python@v2
26+
with:
27+
python-version: 3.8
28+
29+
- name: Check coverage difference file and comment
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
RUN_ID: ${{ github.event.workflow_run.id }}
33+
run: |
34+
python misc/scripts/library-coverage/comment-pr.py "$GITHUB_REPOSITORY" "$RUN_ID"

0 commit comments

Comments
 (0)