-
Notifications
You must be signed in to change notification settings - Fork 3
Integrate QLT #53
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
Merged
Merged
Integrate QLT #53
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
505a82c
refactor for QLT
jsinglet d846f5b
fix suites
jsinglet 94bbb5b
ignores
jsinglet 3163c41
wrong path
jsinglet 9e1f6bb
not needed
jsinglet 1a04dbb
Update .github/codeql/codeql-config.yaml
jsinglet ae481bc
Update javascript/javascript-sap-ui5-queries/test/qlpack.yml
jsinglet c8fb4d8
fix pack locks
jsinglet 792e078
Fixing some broken links
mbaluda 9c615e6
Fix broken links
mbaluda 78f7ce4
fix codeql config
mbaluda de09372
Merge 'main' into jsinglet/qlt-integration-take-2
mbaluda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,109 @@ | ||
| name: Fetch CodeQL CLI and queries | ||
| description: | | ||
| Fetches a CodeQL CLI and a copy of the CodeQL standard libraries at the specified versions. | ||
| inputs: | ||
| codeql-cli-version: | ||
| description: | | ||
| The version of the CodeQL CLI to be downloaded. | ||
| required: false | ||
| default: 'latest' | ||
|
|
||
| codeql-stdlib-version: | ||
| description: | | ||
| The tag or commit to use from the CodeQL Standard Library | ||
| required: false | ||
| default: 'latest' | ||
|
|
||
| add-to-path: | ||
| description: | | ||
| Add the CodeQL CLI to the system path | ||
| required: false | ||
| default: 'true' | ||
|
|
||
| codeql-home: | ||
| description: | | ||
| The directory to store the CodeQL CLI and Standard Library. | ||
| A fixed location can be used for caching the tooling. | ||
| required: false | ||
| outputs: | ||
| codeql-home: | ||
| description: 'The directory containing the CodeQL CLI and CodeQL Standard Library' | ||
| value: ${{ steps.install-codeql.outputs.codeql-home }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install CodeQL | ||
| id: install-codeql | ||
| env: | ||
| RUNNER_OS: ${{ runner.os }} | ||
| RUNNER_TEMP: ${{ runner.temp }} | ||
| CODEQL_CLI_VERSION: ${{ inputs.codeql-cli-version }} | ||
| CODEQL_STDLIB_VERSION: ${{ inputs.codeql-stdlib-version }} | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| ADD_TO_PATH: ${{ inputs.add-to-path }} | ||
| CODEQL_HOME: ${{ inputs.codeql-home }} | ||
| shell: bash | ||
| run: | | ||
| echo "::debug::Determining CodeQL release for $RUNNER_OS" | ||
| case $RUNNER_OS in | ||
| "Linux") | ||
| RELEASE_PATTERN="codeql-linux64.zip" | ||
| ;; | ||
| "macOS") | ||
| RELEASE_PATTERN="codeql-osx64.zip" | ||
| ;; | ||
| "Windows") | ||
| RELEASE_PATTERN="codeql-win64.zip" | ||
| ;; | ||
| *) | ||
| echo "::error::Unsupported runner operating system $RUNNER_OS" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| echo "::debug::Selected $RELEASE_PATTERN" | ||
|
|
||
| if [ "$CODEQL_HOME" == "" ] | ||
| then | ||
| echo "::debug::Creating temporary CodeQL home" | ||
| CODEQL_HOME=$(mktemp -d -p $RUNNER_TEMP codeql-home-XXXXXXXXXX) | ||
| else | ||
| echo "::debug::Creating CodeQL home at $CODEQL_HOME" | ||
| mkdir -p $CODEQL_HOME | ||
| fi | ||
|
|
||
| echo "::debug::Changing directory to $CODEQL_HOME" | ||
| pushd $CODEQL_HOME | ||
|
|
||
| echo "::debug::Downloading CodeQL CLI version $CODEQL_CLI_VERSION" | ||
| if [ "$CODEQL_CLI_VERSION" == "latest" ] | ||
| then | ||
| gh release download --repo https://github.com/github/codeql-cli-binaries --pattern $RELEASE_PATTERN | ||
| else | ||
| gh release download "v${CODEQL_CLI_VERSION}" --repo https://github.com/github/codeql-cli-binaries --pattern $RELEASE_PATTERN | ||
| fi | ||
| echo "::debug::Unpacking CodeQL CLI" | ||
| unzip -q $RELEASE_PATTERN | ||
|
|
||
| echo "::debug::Cloning CodeQL standard library" | ||
| git clone https://github.com/github/codeql.git codeql-stdlib | ||
|
|
||
| if [ "$CODEQL_STDLIB_VERSION" != "latest" ] | ||
| then | ||
| pushd codeql-stdlib | ||
| echo "::debug::Switching to revision $CODEQL_STDLIB_VERSION" | ||
| git checkout $CODEQL_STDLIB_VERSION | ||
| popd | ||
| fi | ||
|
|
||
| if [ "$ADD_TO_PATH" == "true" ] | ||
| then | ||
| echo "::debug::Adding CodeQL CLI path '$(pwd)/codeql' to system path" | ||
| echo "$(pwd)/codeql" >> $GITHUB_PATH | ||
| fi | ||
|
|
||
| echo "::debug::Setting output parameter codeql-home to $(pwd)" | ||
| echo "codeql-home=$(pwd)" >> $GITHUB_OUTPUT | ||
|
|
||
| popd | ||
| echo "::debug::Done." |
This file contains hidden or 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,86 @@ | ||
| name: Fetch and Install QLT | ||
| description: | | ||
| Fetches and installs QLT. | ||
| inputs: | ||
| qlt-version: | ||
| description: | | ||
| The version of QLT to be downloaded. | ||
| required: false | ||
| default: 'latest' | ||
|
|
||
| add-to-path: | ||
| description: | | ||
| Add QLT to the system path | ||
| required: false | ||
| default: 'true' | ||
|
|
||
| token: | ||
| description: | | ||
| Token to use for auth | ||
| required: true | ||
|
|
||
| outputs: | ||
| qlt-home: | ||
| description: 'The directory containing the QLT installation' | ||
| value: ${{ steps.install-qlt.outputs.qlt-home }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install QLT | ||
| id: install-qlt | ||
| env: | ||
| RUNNER_OS: ${{ runner.os }} | ||
| RUNNER_TEMP: ${{ runner.temp }} | ||
| GITHUB_TOKEN: ${{ inputs.token }} | ||
| ADD_TO_PATH: ${{ inputs.add-to-path }} | ||
| QLT_VERSION: ${{ inputs.qlt-version }} | ||
| QLT_HOME: ${{ inputs.qlt-home }} | ||
| shell: bash | ||
| run: | | ||
| echo -e "\e[0;32m[QLT]\e[0m Determining QLT release for $RUNNER_OS" | ||
| case $RUNNER_OS in | ||
| "Linux") | ||
| RELEASE_PATTERN="qlt-linux-x86_64.zip" | ||
| ;; | ||
| *) | ||
| echo "::error::Unsupported runner operating system $RUNNER_OS" | ||
| exit 1 | ||
| ;; | ||
| esac | ||
| echo -e "\e[0;32m[QLT]\e[0m Selected $RELEASE_PATTERN" | ||
|
|
||
| if [ "$QLT_HOME" == "" ] | ||
| then | ||
| echo -e "\e[0;32m[QLT]\e[0m Creating temporary QLT home" | ||
| QLT_HOME=$(mktemp -d -p $RUNNER_TEMP qlt-home-XXXXXXXXXX) | ||
| else | ||
| echo -e "\e[0;32m[QLT]\e[0m Creating CodeQL home at $QLT_HOME" | ||
| mkdir -p $QLT_HOME | ||
| fi | ||
|
|
||
| echo -e "\e[0;32m[QLT]\e[0m Changing directory to $QLT_HOME" | ||
| pushd $QLT_HOME | ||
|
|
||
| echo -e "\e[0;32m[QLT]\e[0m Downloading QLT version $QLT_VERSION" | ||
| if [ "$QLT_VERSION" == "latest" ] | ||
| then | ||
| # download the actual bundle | ||
| gh release download -R advanced-security/codeql-development-toolkit --pattern "$RELEASE_PATTERN" | ||
| else | ||
| gh release download "$QLT_VERSION" -R advanced-security/codeql-development-toolkit --pattern "$RELEASE_PATTERN" | ||
| fi | ||
| echo -e "\e[0;32m[QLT]\e[0m Unpacking QLT" | ||
| unzip $RELEASE_PATTERN | ||
|
|
||
| if [ "$ADD_TO_PATH" == "true" ] | ||
| then | ||
| echo -e "\e[0;32m[QLT]\e[0m Adding QLT '$(pwd)/qlt' to system path" | ||
| echo "$(pwd)" >> $GITHUB_PATH | ||
| fi | ||
|
|
||
| echo -e "\e[0;32m[QLT]\e[0m Setting output parameter qlt-home to $(pwd)" | ||
| echo "qlt-home=$(pwd)" >> $GITHUB_OUTPUT | ||
|
|
||
| popd | ||
| echo -e "\e[0;32m[QLT]\e[0m Done." |
This file contains hidden or 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 hidden or 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,132 @@ | ||
| name: ⚙️ CodeQL - Run Unit Tests (javascript) | ||
|
|
||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - '**' | ||
| pull_request: | ||
| branches: | ||
| - '**' | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| create-unit-test-matrix: | ||
| name: Create CodeQL Unit Test Matrix | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.export-unit-test-matrix.outputs.matrix }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Install QLT | ||
| id: install-qlt | ||
| uses: ./.github/actions/install-qlt | ||
| with: | ||
| qlt-version: 'latest' | ||
| add-to-path: true | ||
| token: ${{ secrets.ACCESS_TOKEN }} | ||
|
|
||
| - name: Export unit test matrix | ||
| id: export-unit-test-matrix | ||
| run: | | ||
| qlt test run get-matrix --os-version ubuntu-latest | ||
|
|
||
| run-test-suites: | ||
| name: Run Unit Tests | ||
| needs: create-unit-test-matrix | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJSON(needs.create-unit-test-matrix.outputs.matrix) }} | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Install QLT | ||
| id: install-qlt | ||
| uses: ./.github/actions/install-qlt | ||
| with: | ||
| qlt-version: 'latest' | ||
| add-to-path: true | ||
| token: ${{ secrets.ACCESS_TOKEN }} | ||
|
|
||
| - name: Install CodeQL | ||
| id: install-codeql | ||
| uses: ./.github/actions/install-codeql | ||
| with: | ||
| codeql-cli-version: ${{ matrix.codeql_cli }} | ||
| codeql-stdlib-version: ${{ matrix.codeql_standard_library }} | ||
| add-to-path: true | ||
|
|
||
| - name: Verify Versions of Tooling | ||
| shell: bash | ||
| run: | | ||
| echo "CodeQL Home: ${{ steps.install-codeql.outputs.codeql-home }}" | ||
| echo -e "Checking CodeQL Version:" | ||
| codeql --version | ||
|
|
||
| echo -e "Checking QLT Version:" | ||
| echo "QLT Home: ${{ steps.install-qlt.outputs.qlt-home }}" | ||
| qlt version | ||
|
|
||
| - name: Install QL Packs | ||
| shell: bash | ||
| run: | | ||
| qlt query run install-packs | ||
|
|
||
| - name: Run test suites | ||
| id: run-test-suites | ||
| env: | ||
| RUNNER_OS: ${{ runner.os }} | ||
| CODEQL_CLI: ${{ matrix.codeql_cli }} | ||
| CODEQL_STDLIB: ${{ matrix.codeql_standard_library }} | ||
| CODEQL_STDLIB_IDENT: ${{matrix.codeql_standard_library_ident}} | ||
| RUNNER_TMP: ${{ runner.temp }} | ||
| LGTM_INDEX_XML_MODE: all | ||
|
|
||
| shell: bash | ||
| run: > | ||
| qlt test run execute-unit-tests | ||
| --codeql-args "--threads=0 --strict-test-discovery" | ||
| --num-threads 2 | ||
| --language javascript | ||
| --runner-os $RUNNER_OS | ||
| --work-dir $RUNNER_TMP | ||
|
|
||
| - name: Upload test results | ||
| uses: actions/upload-artifact@v2 | ||
| with: | ||
| name: test-results-${{ runner.os }}-${{ matrix.codeql_cli }}-${{ matrix.codeql_standard_library_ident }} | ||
| path: | | ||
| ${{ runner.temp }}/test_report_${{ runner.os }}_${{ matrix.codeql_cli }}_${{ matrix.codeql_standard_library_ident }}_slice_*.json | ||
| if-no-files-found: error | ||
|
|
||
| validate-test-results: | ||
| name: Validate test results | ||
| needs: [run-test-suites] | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
| - name: Checkout repository | ||
| uses: actions/checkout@v3 | ||
|
|
||
| - name: Install QLT | ||
| id: install-qlt | ||
| uses: ./.github/actions/install-qlt | ||
| with: | ||
| qlt-version: 'latest' | ||
| add-to-path: true | ||
| token: ${{ secrets.ACCESS_TOKEN }} | ||
|
|
||
|
|
||
| - name: Collect test results | ||
| uses: actions/download-artifact@v2 | ||
|
|
||
| - name: Validate test results | ||
| run: | | ||
| qlt test run validate-unit-tests --pretty-print --results-directory . >> $GITHUB_STEP_SUMMARY | ||
| qlt test run validate-unit-tests --results-directory . |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| # CodeQL Result Files | ||
| *.actual | ||
|
|
||
| # Logs | ||
| logs | ||
| *.log | ||
|
|
||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| provide: | ||
| - "**/qlpack.yml" | ||
| - '**/qlpack.yml' | ||
| - '**/codeql-workspace.yml' |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
4 changes: 4 additions & 0 deletions
4
javascript/javascript-sap-ui5-queries/src/codeql-pack.lock.yml
This file contains hidden or 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,4 @@ | ||
| --- | ||
| lockVersion: 1.0.0 | ||
| dependencies: {} | ||
| compiled: false |
2 changes: 1 addition & 1 deletion
2
src/models/UI5.qll → ...script-sap-ui5-queries/src/models/UI5.qll
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions
2
src/qlpack.yml → ...javascript-sap-ui5-queries/src/qlpack.yml
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.