forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from RasmusWL/python-use-sqlalchemy
Minor updates to SQL alchemy PR
- Loading branch information
Showing
2,573 changed files
with
241,458 additions
and
30,001 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: Check framework coverage changes | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/csv-coverage-pr-comment.yml' | ||
- '*/ql/src/**/*.ql' | ||
- '*/ql/src/**/*.qll' | ||
- 'misc/scripts/library-coverage/*.py' | ||
# input data files | ||
- '*/documentation/library-coverage/cwe-sink.csv' | ||
- '*/documentation/library-coverage/frameworks.csv' | ||
branches: | ||
- main | ||
- 'rc/*' | ||
|
||
jobs: | ||
generate: | ||
name: Generate framework coverage artifacts | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJSON(github.event) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
- name: Clone self (github/codeql) - MERGE | ||
uses: actions/checkout@v2 | ||
with: | ||
path: merge | ||
- name: Clone self (github/codeql) - BASE | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 2 | ||
path: base | ||
- run: | | ||
git checkout HEAD^1 | ||
git log -1 --format='%H' | ||
working-directory: base | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Download CodeQL CLI | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release download --repo "github/codeql-cli-binaries" --pattern "codeql-linux64.zip" | ||
- name: Unzip CodeQL CLI | ||
run: unzip -d codeql-cli codeql-linux64.zip | ||
- name: Generate CSV files on merge commit of the PR | ||
run: | | ||
echo "Running generator on merge" | ||
PATH="$PATH:codeql-cli/codeql" python merge/misc/scripts/library-coverage/generate-report.py ci merge merge | ||
mkdir out_merge | ||
cp framework-coverage-*.csv out_merge/ | ||
cp framework-coverage-*.rst out_merge/ | ||
- name: Generate CSV files on base commit of the PR | ||
run: | | ||
echo "Running generator on base" | ||
PATH="$PATH:codeql-cli/codeql" python base/misc/scripts/library-coverage/generate-report.py ci base base | ||
mkdir out_base | ||
cp framework-coverage-*.csv out_base/ | ||
cp framework-coverage-*.rst out_base/ | ||
- name: Generate diff of coverage reports | ||
run: | | ||
python base/misc/scripts/library-coverage/compare-folders.py out_base out_merge comparison.md | ||
- name: Upload CSV package list | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: csv-framework-coverage-merge | ||
path: | | ||
out_merge/framework-coverage-*.csv | ||
out_merge/framework-coverage-*.rst | ||
- name: Upload CSV package list | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: csv-framework-coverage-base | ||
path: | | ||
out_base/framework-coverage-*.csv | ||
out_base/framework-coverage-*.rst | ||
- name: Upload comparison results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: comparison | ||
path: | | ||
comparison.md | ||
- name: Save PR number | ||
run: | | ||
mkdir -p pr | ||
echo ${{ github.event.pull_request.number }} > pr/NR | ||
- name: Upload PR number | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pr | ||
path: pr/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Comment on PR with framework coverage changes | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Check framework coverage changes"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
check: | ||
name: Check framework coverage differences and comment | ||
runs-on: ubuntu-latest | ||
if: > | ||
${{ github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJSON(github.event) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
- name: Clone self (github/codeql) | ||
uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Check coverage difference file and comment | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
RUN_ID: ${{ github.event.workflow_run.id }} | ||
run: | | ||
python misc/scripts/library-coverage/comment-pr.py "$GITHUB_REPOSITORY" "$RUN_ID" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Build framework coverage timeseries reports | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone self (github/codeql) | ||
uses: actions/checkout@v2 | ||
with: | ||
path: script | ||
- name: Clone self (github/codeql) for analysis | ||
uses: actions/checkout@v2 | ||
with: | ||
path: codeqlModels | ||
fetch-depth: 0 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Download CodeQL CLI | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release download --repo "github/codeql-cli-binaries" --pattern "codeql-linux64.zip" | ||
- name: Unzip CodeQL CLI | ||
run: unzip -d codeql-cli codeql-linux64.zip | ||
- name: Build modeled package list | ||
run: | | ||
CLI=$(realpath "codeql-cli/codeql") | ||
echo $CLI | ||
PATH="$PATH:$CLI" python script/misc/scripts/library-coverage/generate-timeseries.py codeqlModels | ||
- name: Upload timeseries CSV | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: framework-coverage-timeseries | ||
path: framework-coverage-timeseries-*.csv | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Update framework coverage reports | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
jobs: | ||
update: | ||
name: Update framework coverage report | ||
if: github.event.repository.fork == false | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Dump GitHub context | ||
env: | ||
GITHUB_CONTEXT: ${{ toJSON(github.event) }} | ||
run: echo "$GITHUB_CONTEXT" | ||
- name: Clone self (github/codeql) | ||
uses: actions/checkout@v2 | ||
with: | ||
path: ql | ||
fetch-depth: 0 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Download CodeQL CLI | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release download --repo "github/codeql-cli-binaries" --pattern "codeql-linux64.zip" | ||
- name: Unzip CodeQL CLI | ||
run: unzip -d codeql-cli codeql-linux64.zip | ||
|
||
- name: Generate coverage files | ||
run: | | ||
PATH="$PATH:codeql-cli/codeql" python ql/misc/scripts/library-coverage/generate-report.py ci ql ql | ||
- name: Create pull request with changes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
python ql/misc/scripts/library-coverage/create-pr.py ql "$GITHUB_REPOSITORY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Build framework coverage reports | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
qlModelShaOverride: | ||
description: 'github/codeql repo SHA used for looking up the CSV models' | ||
required: false | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Clone self (github/codeql) | ||
uses: actions/checkout@v2 | ||
with: | ||
path: script | ||
- name: Clone self (github/codeql) for analysis | ||
uses: actions/checkout@v2 | ||
with: | ||
path: codeqlModels | ||
ref: ${{ github.event.inputs.qlModelShaOverride || github.ref }} | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Download CodeQL CLI | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release download --repo "github/codeql-cli-binaries" --pattern "codeql-linux64.zip" | ||
- name: Unzip CodeQL CLI | ||
run: unzip -d codeql-cli codeql-linux64.zip | ||
- name: Build modeled package list | ||
run: | | ||
PATH="$PATH:codeql-cli/codeql" python script/misc/scripts/library-coverage/generate-report.py ci codeqlModels script | ||
- name: Upload CSV package list | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: framework-coverage-csv | ||
path: framework-coverage-*.csv | ||
- name: Upload RST package list | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: framework-coverage-rst | ||
path: framework-coverage-*.rst | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lgtm | ||
* The `cpp/tainted-arithmetic`, `cpp/arithmetic-with-extreme-values`, and `cpp/uncontrolled-arithmetic` queries now recognize more functions as returning the absolute value of their input. As a result, they produce fewer false positives. |
2 changes: 2 additions & 0 deletions
2
cpp/change-notes/2021-04-09-unsigned-difference-expression-compared-zero.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lgtm,codescanning | ||
* The 'Unsigned difference expression compared to zero' (cpp/unsigned-difference-expression-compared-zero) query has been improved to produce fewer false positive results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lgtm | ||
* The queries cpp/tainted-arithmetic, cpp/uncontrolled-arithmetic, and cpp/arithmetic-with-extreme-values have been improved to produce fewer false positives. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
codescanning | ||
* The 'Pointer to stack object used as return value' (cpp/return-stack-allocated-object) query has been deprecated, and any uses should be replaced with `Returning stack-allocated memory` (cpp/return-stack-allocated-memory). |
2 changes: 2 additions & 0 deletions
2
cpp/change-notes/2021-04-26-more-sound-expr-might-overflow.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lgtm,codescanning | ||
* The `exprMightOverflowPositively` and `exprMightOverflowNegatively` predicates from the `SimpleRangeAnalysis` library now recognize more expressions that might overflow. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lgtm,codescanning | ||
* The 'Comparison with wider type' (cpp/comparison-with-wider-type) query has been improved to produce fewer false positives. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lgtm,codescanning | ||
* The query "Uncontrolled arithmetic" (`cpp/uncontrolled-arithmetic`) has been improved to produce fewer false positives. |
Oops, something went wrong.