Skip to content

Commit 8936221

Browse files
committed
Merge branch 'main' into lcartey/rule-11-4-improvements
2 parents 49d0aef + 4345ca0 commit 8936221

File tree

1,557 files changed

+19715
-5257
lines changed

Some content is hidden

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

1,557 files changed

+19715
-5257
lines changed

.codeqlmanifest.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1-
{ "provide": [ "cpp/*/src/qlpack.yml", "cpp/*/test/qlpack.yml", "c/*/src/qlpack.yml", "c/*/test/qlpack.yml", "scripts/generate_modules/queries/qlpack.yml" ] }
1+
{
2+
"provide": [
3+
"cpp/*/src/qlpack.yml",
4+
"cpp/*/test/qlpack.yml",
5+
"c/*/src/qlpack.yml",
6+
"c/*/test/qlpack.yml",
7+
"scripts/generate_modules/queries/qlpack.yml"
8+
]
9+
}

.github/workflows/bump-version.yml

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

.github/workflows/code-scanning-pack-gen.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,48 @@ name: Code Scanning Query Pack Generation
22

33
on:
44
merge_group:
5+
types: [checks_requested]
56
pull_request:
67
branches:
78
- main
8-
- "rc/**"
99
- next
10+
- "rc/**"
1011

1112
push:
1213
branches:
1314
- main
14-
- "rc/**"
1515
- next
16+
- "rc/**"
1617

1718
env:
1819
XARGS_MAX_PROCS: 4
1920

2021
jobs:
22+
2123
prepare-code-scanning-pack-matrix:
2224
name: Prepare CodeQL Code Scanning pack matrix
2325
runs-on: ubuntu-22.04
2426
outputs:
2527
matrix: ${{ steps.export-code-scanning-pack-matrix.outputs.matrix }}
2628
steps:
2729
- name: Checkout repository
28-
uses: actions/checkout@v2
29-
30+
uses: actions/checkout@v4
3031
- name: Export Code Scanning pack matrix
3132
id: export-code-scanning-pack-matrix
3233
run: |
33-
echo "::set-output name=matrix::$(
34+
echo "matrix=$(
3435
jq --compact-output '.supported_environment | {include: .}' supported_codeql_configs.json
35-
)"
36+
)" >> $GITHUB_OUTPUT
3637
3738
create-code-scanning-pack:
3839
name: Create Code Scanning pack
3940
needs: prepare-code-scanning-pack-matrix
40-
runs-on: ubuntu-20.04-xl
41+
runs-on: ubuntu-latest-xl
4142
strategy:
4243
fail-fast: false
4344
matrix: ${{ fromJSON(needs.prepare-code-scanning-pack-matrix.outputs.matrix) }}
4445
steps:
45-
- uses: actions/checkout@v2
46+
- uses: actions/checkout@v4
4647

4748
- name: Cache CodeQL
4849
id: cache-codeql
@@ -65,18 +66,28 @@ jobs:
6566
with:
6667
cli_path: ${{ github.workspace }}/codeql_home/codeql
6768

69+
- name: Determine ref for external help files
70+
id: determine-ref
71+
run: |
72+
if [[ $GITHUB_EVENT_NAME == "pull_request" || $GITHUB_EVENT_NAME == "merge_group" ]]; then
73+
echo "EXTERNAL_HELP_REF=$GITHUB_HEAD_REF" >> "$GITHUB_ENV"
74+
else
75+
echo "EXTERNAL_HELP_REF=$GITHUB_REF" >> "$GITHUB_ENV"
76+
fi
77+
echo "Using ref $EXTERNAL_HELP_REF for external help files."
78+
6879
- name: Checkout external help files
6980
continue-on-error: true
7081
id: checkout-external-help-files
71-
uses: actions/checkout@v2
82+
uses: actions/checkout@v4
7283
with:
7384
ssh-key: ${{ secrets.CODEQL_CODING_STANDARDS_HELP_KEY }}
7485
repository: "github/codeql-coding-standards-help"
75-
ref: ${{ github.head_ref }}
86+
ref: ${{ env.EXTERNAL_HELP_REF }}
7687
path: external-help-files
7788

7889
- name: Include external help files
79-
if: ${{ steps.checkout-external-help-files.outcome == 'success' }}
90+
if: steps.checkout-external-help-files.outcome == 'success'
8091
run: |
8192
pushd external-help-files
8293
find . -name '*.md' -exec rsync -av --relative {} "$GITHUB_WORKSPACE" \;
@@ -88,11 +99,11 @@ jobs:
8899
run: |
89100
PATH=$PATH:$CODEQL_HOME/codeql
90101
91-
codeql query compile --threads 0 cpp
92-
codeql query compile --threads 0 c
102+
codeql query compile --precompile --threads 0 cpp
103+
codeql query compile --precompile --threads 0 c
93104
94105
cd ..
95-
zip -r codeql-coding-standards/code-scanning-cpp-query-pack.zip codeql-coding-standards/c/ codeql-coding-standards/cpp/ codeql-coding-standards/.codeqlmanifest.json codeql-coding-standards/supported_codeql_configs.json codeql-coding-standards/scripts/configuration codeql-coding-standards/scripts/reports codeql-coding-standards/scripts/shared codeql-coding-standards/scripts/guideline_recategorization codeql-coding-standards/scripts/shared codeql-coding-standards/scripts/schemas
106+
zip -r codeql-coding-standards/code-scanning-cpp-query-pack.zip codeql-coding-standards/c/ codeql-coding-standards/cpp/ codeql-coding-standards/.codeqlmanifest.json codeql-coding-standards/supported_codeql_configs.json codeql-coding-standards/scripts/configuration codeql-coding-standards/scripts/reports codeql-coding-standards/scripts/shared codeql-coding-standards/scripts/guideline_recategorization codeql-coding-standards/schemas
96107
97108
- name: Upload GHAS Query Pack
98109
uses: actions/upload-artifact@v2

.github/workflows/codeql_unit_tests.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,37 @@ name: CodeQL Unit Testing
22

33
on:
44
merge_group:
5+
types: [checks_requested]
56
push:
67
branches:
78
- main
8-
- "rc/**"
99
- next
10+
- "rc/**"
1011
pull_request:
1112
branches:
12-
- "**"
13-
workflow_dispatch:
13+
- main
14+
- next
15+
- "rc/**"
1416

1517
jobs:
18+
1619
prepare-unit-test-matrix:
1720
name: Prepare CodeQL unit test matrix
1821
runs-on: ubuntu-22.04
1922
outputs:
2023
matrix: ${{ steps.export-unit-test-matrix.outputs.matrix }}
2124
steps:
2225
- name: Checkout repository
23-
uses: actions/checkout@v2
26+
uses: actions/checkout@v4
2427

2528
- name: Export unit test matrix
2629
id: export-unit-test-matrix
2730
run: |
2831
echo "Merging Result:"
2932
python scripts/create_language_matrix.py
30-
echo "::set-output name=matrix::$(
33+
echo "matrix=$(
3134
python scripts/create_language_matrix.py | \
32-
jq --compact-output 'map([.+{os: "ubuntu-20.04-xl", codeql_standard_library_ident : .codeql_standard_library | sub("\/"; "_")}]) | flatten | {include: .}')"
35+
jq --compact-output 'map([.+{os: "ubuntu-latest-xl", codeql_standard_library_ident : .codeql_standard_library | sub("\/"; "_")}]) | flatten | {include: .}')" >> $GITHUB_OUTPUT
3336
3437
run-test-suites:
3538
name: Run unit tests
@@ -39,22 +42,22 @@ jobs:
3942
strategy:
4043
fail-fast: false
4144
matrix: ${{ fromJSON(needs.prepare-unit-test-matrix.outputs.matrix) }}
42-
45+
4346
steps:
4447
- name: Checkout repository
45-
uses: actions/checkout@v2
48+
uses: actions/checkout@v4
4649

4750
- name: Install Python
4851
uses: actions/setup-python@v4
4952
with:
5053
python-version: "3.9"
51-
54+
5255
- name: Install Python dependencies
5356
run: pip install -r scripts/requirements.txt
5457

5558
- name: Cache CodeQL
5659
id: cache-codeql
57-
uses: actions/cache@v2.1.3
60+
uses: actions/cache@v3
5861
with:
5962
# A list of files, directories, and wildcard patterns to cache and restore
6063
path: ${{github.workspace}}/codeql_home
@@ -101,7 +104,7 @@ jobs:
101104
102105
def print_error(fmt, *args):
103106
print(f"::error::{fmt}", *args)
104-
107+
105108
def print_error_and_fail(fmt, *args):
106109
print_error(fmt, args)
107110
sys.exit(1)
@@ -148,7 +151,7 @@ jobs:
148151
file.close()
149152
150153
- name: Upload test results
151-
uses: actions/upload-artifact@v2
154+
uses: actions/upload-artifact@v3
152155
with:
153156
name: ${{ matrix.language }}-test-results-${{ runner.os }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library_ident }}
154157
path: |
@@ -157,11 +160,11 @@ jobs:
157160

158161
validate-test-results:
159162
name: Validate test results
160-
needs: [run-test-suites]
163+
needs: run-test-suites
161164
runs-on: ubuntu-22.04
162165
steps:
163166
- name: Collect test results
164-
uses: actions/download-artifact@v2
167+
uses: actions/download-artifact@v3
165168

166169
- name: Validate test results
167170
run: |

.github/workflows/create-draft-release.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,37 @@
1-
name: 🤖 Run Matrix Check
1+
name: 🤖 Run Matrix Check
22

33
on:
44
pull_request_target:
5-
types: [synchronize,opened]
5+
types: [synchronize, opened]
66
branches:
77
- "matrix/**"
88
workflow_dispatch:
99

1010
jobs:
1111
dispatch-matrix-check:
12-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-22.04
1313
steps:
14-
1514
- name: Test Variables
1615
shell: pwsh
17-
run: |
18-
Write-Host "Running as: ${{github.actor}}"
19-
16+
run: |
17+
Write-Host "Running as: ${{github.actor}}"
18+
2019
- name: Dispatch Matrix Testing Job
21-
if: ${{ contains(fromJSON('["jsinglet", "mbaluda", "lcartey", "rvermeulen", "ravikprasad", "jeongsoolee09", "hohn", "knewbury01", "kraiouchkine"]'), github.actor) }}
20+
if: ${{ contains(fromJSON('["mbaluda", "lcartey", "rvermeulen", "ravikprasad", "jeongsoolee09", "hohn", "knewbury01", "nicolaswill"]'), github.actor) }}
2221
uses: peter-evans/repository-dispatch@v2
2322
with:
2423
token: ${{ secrets.RELEASE_ENGINEERING_TOKEN }}
2524
repository: github/codeql-coding-standards-release-engineering
2625
event-type: matrix-test
27-
client-payload: '{"pr": "${{ github.event.number }}"}'
28-
26+
client-payload: '{"pr": "${{ github.event.number }}"}'
2927

3028
- uses: actions/github-script@v6
31-
if: ${{ contains(fromJSON('["jsinglet", "mbaluda", "lcartey", "rvermeulen", "ravikprasad", "jeongsoolee09", "hohn", "knewbury01", "kraiouchkine"]'), github.actor) }}
29+
if: ${{ contains(fromJSON('["mbaluda", "lcartey", "rvermeulen", "ravikprasad", "jeongsoolee09", "hohn", "knewbury01", "nicolaswill"]'), github.actor) }}
3230
with:
3331
script: |
3432
github.rest.issues.createComment({
3533
issue_number: context.issue.number,
3634
owner: context.repo.owner,
3735
repo: context.repo.repo,
3836
body: '🤖 Beep Boop! Matrix Testing for this PR has been initiated. Please check back later for results. <br><br> :bulb: If you do not hear back from me please check my status! **I will report even if this PR does not contain files eligible for matrix testing.**'
39-
})
37+
})

.github/workflows/dispatch-matrix-test-on-comment.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,23 @@ on:
88
- "rc/**"
99
- next
1010

11-
1211
jobs:
1312
dispatch-matrix-check:
14-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1514
steps:
16-
1715
- name: Test Variables
1816
shell: pwsh
19-
run: |
17+
run: |
2018
Write-Host "Running as: ${{github.actor}}"
2119
2220
$actor = "${{github.actor}}"
2321
24-
$acl = @("jsinglet","mbaluda", "lcartey", "rvermeulen", "ravikprasad", "jeongsoolee09", "hohn", "knewbury01", "kraiouchkine")
22+
$acl = @("mbaluda", "lcartey", "rvermeulen", "ravikprasad", "jeongsoolee09", "hohn", "knewbury01", "nicolaswill")
2523
2624
if(-not ($actor -in $acl)){
2725
throw "Refusing to run workflow for user not in acl."
2826
}
2927
30-
3128
- name: Dispatch Matrix Testing Job
3229
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-matrix') }}
3330
uses: peter-evans/repository-dispatch@v2

0 commit comments

Comments
 (0)