-
Notifications
You must be signed in to change notification settings - Fork 67
Modernize qlpacks and update to CodeQL 2.8.5 #4
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
Conversation
52d1da2
to
a2d7b37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. We started to standardize our workflow and Python scripts on 3.9, so I made a few suggestion to make that explicit.
steps: | ||
- name: Install CodeQL library packs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
steps: | |
- name: Install CodeQL library packs | |
steps: | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install CodeQL library packs |
We are standardizing on Python 3.9 for all our workflows and scripts to ensure that we are compliant with the requirements in our user manual.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes the file non-parsable. I also think this is covered by the installation of python in the workflow files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your are probably right that the using workflow has already setup the correct version. In that case we can ignore my suggestion for the action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The failing check has been made optional in |
Done. |
Slightly backtracked on this to keep the PR "clean" for prosperity. Since |
Description
(Note that this PR targets the
next
branch, which is used by the CI for CodeQL to detect changes that breakgithub/codeql-coding-standards
. These changes should eventually be merged tomain
, but that should not happen until we are ready to update to the required toolset.)This PR updates the qlpacks and related files to use CodeQL packaging to declare and resolve dependencies. Neither the
codeql_modules
submodule nor thecodeql_home/codeql-stdlib
checkout ofgithub/codeql
are required anymore. The necessary dependencies can be installed by runningpython3 scripts/install-packs.yml
. This need only be run when we update to a new standard library version, but it doesn't hurt to run it after every pull.None of the
codeql
commands we run should require--search-path
or--additional-packs
any longer. References within our repo are resolved automatically because all of our packs are in the same "CodeQL Workspace" (defined by our.codeqlmanifest.json
file. References to the standard library are resolved from the package download cache.Details:
codeql/
scope to all pack names, which is necessary to publish packs to the pack registry. Note that we don't actually publish to the package registry yet.dependencies:
map instead oflibraryPathDependencies:
list. The'*'
version indicates that the referenced pack will be found in the local workspace, rather than downloaded from the registry..codeqlmanifest.json
in thecpp
directory into the root.codeqlmanifest.json
. All pack references should resolve automatically now, without a need for--search-path
.codeql
directories to.gitignore
..codeql
is where the output of building a query or library pack is placed.--search-path
and--additional-packs
from all of our CI workflows.qlpack.yml
files match the versions in thegithub/codeql
commit specified insupported_codeql_configs.json
. The script used by this workflow will also be used, in a future PR, in the workflow to update to a new toolset version.Change request type
.ql
,.qll
,.qls
or unit tests)Rules with added or modified queries
Release change checklist
A change note (development_handbook.md#change-notes) is required for any pull request which modifies:
If you are only adding new rule queries, a change note is not required.
Author: Is a change note required?
Reviewer: Confirm that either a change note is not required or the change note is required and has been added.
Query development review checklist
For PRs that add new queries or modify existing queries, the following checklist should be completed by both the author and reviewer:
Author
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
Reviewer
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.