Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into v1 #504

Merged
merged 41 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
40fb1f3
Add category input
Daverlo Apr 28, 2021
76f5ada
Don't use getOptionalInput on the runner codepath
Daverlo Apr 29, 2021
c6e734c
Add category option to runner
Daverlo Apr 29, 2021
519d077
Add actions-util.getAutomationID()
Daverlo May 3, 2021
c93cbc9
Forward category input to codeql cli
Daverlo May 3, 2021
3b741b3
Use actionsUtil.computeAutomationID on upload-lib
Daverlo May 3, 2021
aa53f64
Use the category on the runner
Daverlo May 3, 2021
cd7eedd
Address comments
Daverlo May 5, 2021
a117668
Merge branch 'main' into daverlo/categoryInput
Daverlo May 5, 2021
0c0bc0e
Fix undefined environment
Daverlo May 5, 2021
603c47c
make matrix run all cases
robertbrignull May 7, 2021
ea18d47
Merge branch 'main' into daverlo/categoryInput
Daverlo May 10, 2021
cf682cf
Merge pull request #463 from github/daverlo/categoryInput
Daverlo May 10, 2021
f742f91
put matrix vars in env vars for whitespace safety
robertbrignull May 10, 2021
3c96019
fix windows hopefully
robertbrignull May 10, 2021
3280a85
Update contributing guide
aeisenberg May 10, 2021
224195b
Merge pull request #492 from github/aeisenberg/contributing
aeisenberg May 10, 2021
d2ef04e
Merge branch 'main' into robertbrignull/python-deps-test
adityasharad May 10, 2021
793b377
Fix information about `npm ci`
aeisenberg May 10, 2021
489dbb0
Fix security vulnerabilities
aeisenberg May 10, 2021
a56e777
Merge pull request #482 from github/robertbrignull/python-deps-test
adityasharad May 10, 2021
a9cdff8
Remove confusing words
aeisenberg May 10, 2021
22d495f
Merge branch 'main' into aeisenberg/contributing2
aeisenberg May 10, 2021
ef38c53
Merge pull request #493 from github/aeisenberg/contributing2
aeisenberg May 10, 2021
22d1f7f
Merge branch 'main' into aeisenberg/audit-fix
aeisenberg May 10, 2021
a5506d8
Output environment file for Windows
May 10, 2021
458b791
Merge pull request #494 from github/aeisenberg/audit-fix
aeisenberg May 10, 2021
84b6ff0
Merge branch 'main' into windows-env-file
edoardopirovano May 10, 2021
4c0671c
Merge pull request #495 from edoardopirovano/windows-env-file
adityasharad May 10, 2021
ddcb299
Update loc count library
aeisenberg May 12, 2021
38c131a
Add a tasks.json
aeisenberg May 13, 2021
a924f03
Merge pull request #499 from github/aeisenberg/non-parallel-loc
aeisenberg May 13, 2021
e8b2a98
Use the prefix id for keying into metrics rules
aeisenberg May 13, 2021
8c963ea
Merge branch 'main' into aeisenberg/metric-id
aeisenberg May 13, 2021
a77f6b0
Merge pull request #502 from github/aeisenberg/metric-id
aeisenberg May 13, 2021
8e61fc2
Change include path for lines of code counting
aeisenberg May 13, 2021
6a0bd27
Merge pull request #500 from github/aeisenberg/paths-include
aeisenberg May 13, 2021
da06f4f
Merge branch 'main' into aeisenberg/add-task
aeisenberg May 13, 2021
97887fe
Merge pull request #501 from github/aeisenberg/add-task
aeisenberg May 13, 2021
e7d4215
Add warnings about CLI hack to codeql.ts
hmakholm May 13, 2021
21830ef
Merge pull request #503 from github/hmakholm/pr/warn-magic-names
hmakholm May 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,10 @@ jobs:

- name: Build code
shell: powershell
# Note we want to make sure that the .win32env file is read correctly, so we unset the CODEQL_EXTRACTOR_CSHARP_ROOT from the .sh file.
run: |
cat ./codeql-runner/codeql-env.sh | Invoke-Expression
$Env:CODEQL_EXTRACTOR_CSHARP_ROOT = ""
& $Env:CODEQL_RUNNER dotnet build

- name: Run analyze
Expand Down
115 changes: 66 additions & 49 deletions .github/workflows/python-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,18 @@ on:
pull_request:

jobs:

test-setup-python-scripts:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
include:
- test_dir: python-setup/tests/pipenv/requests-2
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
- test_dir: python-setup/tests/pipenv/requests-3
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3

- test_dir: python-setup/tests/poetry/requests-2
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
- test_dir: python-setup/tests/poetry/requests-3
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3

- test_dir: python-setup/tests/requirements/requests-2
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
- test_dir: python-setup/tests/requirements/requests-3
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3

- test_dir: python-setup/tests/setup_py/requests-2
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
- test_dir: python-setup/tests/setup_py/requests-3
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 3

# This one shouldn't fail, but also won't install packages
- test_dir: python-setup/tests/requirements/non-standard-location
test_script: test -z $LGTM_INDEX_IMPORT_PATH
python_deps_type: [pipenv, poetry, requirements, setup_py]
python_version: [2, 3]

env:
PYTHON_DEPS_TYPE: ${{ matrix.python_deps_type }}
PYTHON_VERSION: ${{ matrix.python_version }}

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand All @@ -55,7 +36,7 @@ jobs:
set -x
$GITHUB_WORKSPACE/python-setup/install_tools.sh

cd $GITHUB_WORKSPACE/${{ matrix.test_dir }}
cd $GITHUB_WORKSPACE/python-setup/tests/${PYTHON_DEPS_TYPE}/requests-${PYTHON_VERSION}

case ${{ matrix.os }} in
ubuntu-latest*) basePath="/opt";;
Expand All @@ -71,35 +52,69 @@ jobs:
if [ ! -z $CODEQL_PYTHON ]; then
$GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON;
fi

- name: Verify packages installed
run: |
${{ matrix.test_script }}
$GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh ${PYTHON_VERSION}

# This one shouldn't fail, but also won't install packages
test-setup-python-scripts-non-standard-location:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Initialize CodeQL
uses: ./init
id: init
with:
tools: latest
languages: python
setup-python-dependencies: false

- name: Test Auto Package Installation
run: |
set -x
$GITHUB_WORKSPACE/python-setup/install_tools.sh

cd $GITHUB_WORKSPACE/python-setup/tests/requirements/non-standard-location

case ${{ matrix.os }} in
ubuntu-latest*) basePath="/opt";;
macos-latest*) basePath="/Users/runner";;
esac
echo ${basePath}

$GITHUB_WORKSPACE/python-setup/auto_install_packages.py "$(dirname ${{steps.init.outputs.codeql-path}})"

- name: Setup for extractor
run: |
echo $CODEQL_PYTHON
# only run if $CODEQL_PYTHON is set
if [ ! -z $CODEQL_PYTHON ]; then
$GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON;
fi

- name: Verify packages installed
run: |
test -z $LGTM_INDEX_IMPORT_PATH

test-setup-python-scripts-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- test_dir: python-setup/tests/pipenv/requests-2
python_version: 2
- test_dir: python-setup/tests/pipenv/requests-3
python_version: 3

- test_dir: python-setup/tests/poetry/requests-2
python_version: 2
- test_dir: python-setup/tests/poetry/requests-3
python_version: 3

- test_dir: python-setup/tests/requirements/requests-2
python_version: 2
- test_dir: python-setup/tests/requirements/requests-3
python_version: 3

- test_dir: python-setup/tests/setup_py/requests-2
python_version: 2
- test_dir: python-setup/tests/setup_py/requests-3
python_version: 3
python_deps_type: [pipenv, poetry, requirements, setup_py]
python_version: [2, 3]

env:
PYTHON_DEPS_TYPE: ${{ matrix.python_deps_type }}
PYTHON_VERSION: ${{ matrix.python_version }}

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand All @@ -117,17 +132,19 @@ jobs:
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\install_tools.ps1"
powershell -File $cmd

cd $Env:GITHUB_WORKSPACE\\${{ matrix.test_dir }}
cd $Env:GITHUB_WORKSPACE\\python-setup/tests/$Env:PYTHON_DEPS_TYPE/requests-$Env:PYTHON_VERSION
$DefaultsPath = Join-Path (Join-Path $Env:GITHUB_WORKSPACE "src") "defaults.json"
$CodeQLBundleName = (Get-Content -Raw -Path $DefaultsPath | ConvertFrom-Json).bundleVersion
$CodeQLVersion = "0.0.0-" + $CodeQLBundleName.split("-")[-1]
py -3 $Env:GITHUB_WORKSPACE\\python-setup\\auto_install_packages.py C:\\hostedtoolcache\\windows\\CodeQL\\$CodeQLVersion\\x64\\codeql

- name: Setup for extractor
run: |
echo $Env:CODEQL_PYTHON

py -3 $Env:GITHUB_WORKSPACE\\python-setup\\tests\\from_python_exe.py $Env:CODEQL_PYTHON

- name: Verify packages installed
run: |
$cmd = $Env:GITHUB_WORKSPACE + "\\python-setup\\tests\\check_requests_123.ps1"
powershell -File $cmd ${{ matrix.python_version }}
powershell -File $cmd $Env:PYTHON_VERSION
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": [
"$tsc-watch"
],
"group": "build",
"label": "tsc: watch - tsconfig.json"
}
]
}
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ Before you start, ensure that you have a recent version of node installed. You c

This project also includes configuration to run tests from VSCode (with support for breakpoints) - open the test file you wish to run and choose "Debug AVA test file" from the Run menu in the Run panel.

You may want to run `tsc --watch` from the command line or inside of vscode in order to ensure build artifacts are up to date as you are working.

### Checking in compiled artifacts and `node_modules`

Because CodeQL Action users consume the code directly from this repository, and there can be no build step during an GitHub Actions run, this repository contains all compiled artifacts and node modules. There is a PR check that will fail if any of the compiled artifacts are not up to date. Compiled artifacts are stored in the `lib/` directory. For all day-to-day development purposes, this folder can be ignored.

Only run `npm install` if you are explicitly changing the set of dependencies in `package.json`. The `node_modules` directory should be up to date when you check out, but if for some reason, there is an inconsistency use `npm ci && npm run removeNPMAbsolutePaths` to ensure the directory is in a state consistent with the `package-lock.json`. There is a PR check to ensure the consistency of the `node_modules` directory.

### Running the action

To see the effect of your changes and to test them, push your changes in a branch and then look at the [Actions output](https://github.com/github/codeql-action/actions) for that branch. You can also exercise the code locally by running the automated tests.
Expand Down
3 changes: 3 additions & 0 deletions analyze/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ inputs:
description: "The path at which the analyzed repository was checked out. Used to relativize any absolute paths in the uploaded SARIF file."
required: false
default: ${{ github.workspace }}
category:
description: String used by Code Scanning for matching the analyses
required: false
token:
default: ${{ github.token }}
matrix:
Expand Down
25 changes: 25 additions & 0 deletions lib/actions-util.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading