Cleanup CodeQL DBs and output their location for later steps by edoardopirovano · Pull Request #543 · github/codeql-action (original) (raw)
Conversation
This PR does two things that should facilitate user workflows that want to upload CodeQL databases somewhere:
- Databases created during the
analyzestep are cleaned up at the end of the step (i.e. items that are not needed to run further queries like evaluation logs and the cache are removed). The level of cleanup performed is configurable via a new parameter of theanalyzestep. I don't think we should expose this in user-facing documentation as most users will just want the default, but it may be useful for internal debugging to have an option there. - The
analyzestep now has an output,db-locationsthat contains a JSON object mapping from languages that a CodeQL database was created for to the location of this database on disk. I've modified one of the PR checks to use this to verify that it is populated correctly.
Merge / deployment checklist
- Confirm this change is backwards compatible with existing workflows.
- Confirm the readme has been updated if necessary.
- Confirm the changelog has been updated if necessary.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. A couple of suggestions around comments.
| required: false |
|---|
| default: "true" |
| cleanup-level: |
| description: "Level of cleanup to perform on CodeQL databases at the end of the analyze step. This should either be 'none' to skip cleanup, or be a valid argument for the --mode flag of the CodeQL CLI command 'codeql database cleanup'" |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice if you could list the valid options here. Or maybe provide a link to the documentation (or both).
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm hesitant to list the options because it duplicates where we have to make a documentation change if we modify them later. Have added a link to the CLI docs, though.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
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
[ Show hidden characters]({{ revealButtonHref }})