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

Move logs, SARIF, database bundle actions uploads to post: hooks #1159

Merged
merged 40 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1016eba
Move logs, SARIF actions uploads to post: hooks
angelapwen Jul 29, 2022
2746051
Catch case where database isn't finalized
angelapwen Jul 29, 2022
2c25894
Zip partial database directory
angelapwen Aug 1, 2022
52de49c
Refactor helper function to util
angelapwen Aug 1, 2022
ebc59ec
More descriptive partial db bundle messages
angelapwen Aug 1, 2022
af87cc6
Improve for `matrix`
angelapwen Aug 1, 2022
6630cbe
Minor syntax update
angelapwen Aug 1, 2022
8a4a573
Error handling for JSON parsing
angelapwen Aug 1, 2022
5da7870
Refactoring per PR comments
angelapwen Aug 1, 2022
5229df1
Add unit test descriptions
angelapwen Aug 1, 2022
daaac43
Linting, node_modules update
angelapwen Aug 1, 2022
a557279
Clean up syntax per PR review
angelapwen Aug 2, 2022
44a27e6
Add top level comments, rename cleanup to post
angelapwen Aug 2, 2022
5895ab0
Address more PR comments, refactoring
angelapwen Aug 2, 2022
eeee462
Move debug artifact methods into separate file
angelapwen Aug 2, 2022
a758ec5
Add more info messages to user, rename log printing function
angelapwen Aug 2, 2022
7f86ddc
Move debug log printing back to actions util
angelapwen Aug 2, 2022
010abe7
Merge remote-tracking branch 'origin/main' into angelapwen/post-init-…
angelapwen Aug 8, 2022
b952980
Add integration test for failed analyze step
angelapwen Aug 8, 2022
6bc2291
Add description in CHANGELOG
angelapwen Aug 8, 2022
05176bc
Add continue-on-error for expected failing job
angelapwen Aug 8, 2022
1c82b1b
Display downloaded files structure
angelapwen Aug 8, 2022
27df4c2
Fix directory name of artifacts
angelapwen Aug 8, 2022
4993f1e
Remove downloaded files structure display
angelapwen Aug 8, 2022
8903097
Remove database init test for success case
angelapwen Aug 9, 2022
ff7a29d
Clarify expected failure for upload job
angelapwen Aug 9, 2022
484a72c
Add utilities unit tests
angelapwen Aug 10, 2022
90676d9
Merge remote-tracking branch 'origin/main' into angelapwen/post-init-…
angelapwen Aug 10, 2022
3c4f458
Re-declare codeql var
angelapwen Aug 10, 2022
65d6ee0
Address review comments
angelapwen Aug 11, 2022
fa59c28
Update CHANGELOG.md wording
angelapwen Aug 11, 2022
d909f71
Update comment wording
angelapwen Aug 11, 2022
4e121c0
Address additional review comments
angelapwen Aug 11, 2022
6fdaff6
Improve file system unit tests
angelapwen Aug 11, 2022
15608ce
Merge remote-tracking branch 'origin/main' into angelapwen/post-init-…
angelapwen Aug 11, 2022
26cafd2
Add unit tests for post: hook run methods
angelapwen Aug 11, 2022
fd83e55
Remove extraneous files
angelapwen Aug 11, 2022
172eca4
Improve doesDirectoryExist test
angelapwen Aug 11, 2022
cf7f893
Make file paths OS-agnostic
angelapwen Aug 11, 2022
79b933c
Remove review comments
angelapwen Aug 11, 2022
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
83 changes: 83 additions & 0 deletions .github/workflows/debug-artifacts-failure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Checks logs, SARIF, and database bundle debug artifacts exist
# when the analyze step fails.
name: PR Check - Debug artifacts after failure
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
on:
push:
branches:
- main
- releases/v1
- releases/v2
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
workflow_dispatch: {}
jobs:
upload-artifacts:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
name: Failure Expected - Upload debug artifacts
continue-on-error: true
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/prepare-test
with:
version: latest
- uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
debug: true
debug-artifact-name: my-debug-artifacts
debug-database-name: my-db
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
id: analysis
with:
ram: 1
download-and-check-artifacts:
name: Download and check debug artifacts after failure in analyze
needs: upload-artifacts
timeout-minutes: 45
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v3
- name: Check expected artifacts exist
shell: bash
run: |
OPERATING_SYSTEMS="ubuntu-latest macos-latest"
LANGUAGES="cpp csharp go java javascript python"
for os in $OPERATING_SYSTEMS; do
pushd "./my-debug-artifacts-$os"
echo "Artifacts from run on $os:"
for language in $LANGUAGES; do
echo "- Checking $language"
if [[ ! -f "my-db-$language-partial.zip" ]] ; then
echo "Missing a partial database bundle for $language"
exit 1
fi
if [[ ! -d "log" ]] ; then
echo "Missing database initialization logs"
exit 1
fi
if [[ ! -d "$language/log" ]] ; then
echo "Missing logs for $language"
exit 1
fi
done
popd
done
env:
INTERNAL_CODEQL_ACTION_DEBUG_LOC: true
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## [UNRELEASED]

No user facing changes.
- Fix error where debug artifacts were not uploaded when the `init`
step failed. [#1159](https://github.com/github/codeql-action/pull/1159)
angelapwen marked this conversation as resolved.
Show resolved Hide resolved

## 2.1.18 - 03 Aug 2022

Expand Down
1 change: 1 addition & 0 deletions analyze/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ outputs:
runs:
using: "node16"
main: "../lib/analyze-action.js"
post: "../lib/analyze-action-post.js"
1 change: 1 addition & 0 deletions init/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,4 @@ outputs:
runs:
using: 'node16'
main: '../lib/init-action.js'
post: '../lib/init-action-post.js'
33 changes: 29 additions & 4 deletions lib/actions-util.js

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

2 changes: 1 addition & 1 deletion lib/actions-util.js.map

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions lib/actions-util.test.js

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

2 changes: 1 addition & 1 deletion lib/actions-util.test.js.map

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions lib/analyze-action-post.js

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

1 change: 1 addition & 0 deletions lib/analyze-action-post.js.map

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

3 changes: 3 additions & 0 deletions lib/analyze-action-post.test.js

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

1 change: 1 addition & 0 deletions lib/analyze-action-post.test.js.map

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

84 changes: 1 addition & 83 deletions lib/analyze-action.js

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

Loading