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

Add QL for QL #7410

Merged
merged 860 commits into from
Dec 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
860 commits
Select commit Hold shift + click to select a range
ab11bce
document usage
esbena Oct 14, 2021
dfa0e77
QL: New performance query: Transitive step in recursion.
aschackmull Oct 14, 2021
ec292db
New performance query: Transitive step in recursion.
aschackmull Oct 14, 2021
1013cb4
QL: Query for finding missing or unwanted bidirectional imports of ab…
joefarebrother Oct 14, 2021
ec6a8b9
Query for finding missing or unwanted bidirectional imports of abstra…
joefarebrother Oct 14, 2021
be36de9
QL: Fix isAbstract
joefarebrother Oct 14, 2021
9b786c2
Fix isAbstract
joefarebrother Oct 14, 2021
9330fa0
QL: Merge pull request #105 from github/aschackmull/transitive-step
MathiasVP Oct 14, 2021
3e2fb5a
Merge pull request #105 from github/aschackmull/transitive-step
MathiasVP Oct 14, 2021
ecf27ff
QL: Add ql/missing-qldoc query.
geoffw0 Oct 14, 2021
0a3705b
Add ql/missing-qldoc query.
geoffw0 Oct 14, 2021
187c24e
QL: QL: Add query for finding missing nomagic on candidate predicates.
MathiasVP Oct 14, 2021
4016a8e
QL: Add query for finding missing nomagic on candidate predicates.
MathiasVP Oct 14, 2021
37e9024
QL: Query: Noninitial imports of the standard library
tausbn Oct 14, 2021
c6a52ed
Query: Noninitial imports of the standard library
tausbn Oct 14, 2021
632d42f
QL: Autoformat
tausbn Oct 14, 2021
71f6999
Autoformat
tausbn Oct 14, 2021
f9d8ae5
QL: fix implicit this
erik-krogh Oct 14, 2021
016ff2a
fix implicit this
erik-krogh Oct 14, 2021
f29457f
QL: Merge pull request #113 from github/erik-krogh/fix-implcit-this
MathiasVP Oct 15, 2021
50e80dc
Merge pull request #113 from github/erik-krogh/fix-implcit-this
MathiasVP Oct 15, 2021
153f8fe
QL: fix the signature of regexpCapture and regexpFind
erik-krogh Oct 15, 2021
c31bd7a
fix the signature of regexpCapture and regexpFind
erik-krogh Oct 15, 2021
74a7945
QL: fix `getArity` on `PredicateOrBuiltin`
erik-krogh Oct 15, 2021
f19dd78
fix `getArity` on `PredicateOrBuiltin`
erik-krogh Oct 15, 2021
6cd11d2
QL: update expected output
erik-krogh Oct 15, 2021
1641d0f
update expected output
erik-krogh Oct 15, 2021
f071da4
QL: add test
erik-krogh Oct 15, 2021
29ebe7b
add test
erik-krogh Oct 15, 2021
ddc0ade
QL: hook up consistency query
erik-krogh Oct 15, 2021
541dcb3
hook up consistency query
erik-krogh Oct 15, 2021
8e6bc11
QL: Merge pull request #86 from github/use-set-literal
MathiasVP Oct 15, 2021
e1871a2
Merge pull request #86 from github/use-set-literal
MathiasVP Oct 15, 2021
2352cf7
QL: Merge pull request #114 from github/erik-krogh/consistency
tausbn Oct 15, 2021
fed640b
Merge pull request #114 from github/erik-krogh/consistency
tausbn Oct 15, 2021
e862dfd
QL: Merge pull request #102 from github/esbena/simple-codeql-action
erik-krogh Oct 15, 2021
e6b0707
Merge pull request #102 from github/esbena/simple-codeql-action
erik-krogh Oct 15, 2021
2f77b92
QL: Merge pull request #107 from github/missing-qldoc
geoffw0 Oct 15, 2021
ee7ac53
Merge pull request #107 from github/missing-qldoc
geoffw0 Oct 15, 2021
6fe7579
QL: remove leftover test predicate
erik-krogh Oct 15, 2021
e3d42a1
remove leftover test predicate
erik-krogh Oct 15, 2021
9f4c829
QL: Upgrade the extractor generator
tausbn Oct 15, 2021
816bfbe
Upgrade the extractor generator
tausbn Oct 15, 2021
8020040
QL: Autoformat
tausbn Oct 15, 2021
7f80514
Autoformat
tausbn Oct 15, 2021
0954584
QL: add test for qlpacks, and get them to work
erik-krogh Oct 15, 2021
741e4a7
add test for qlpacks, and get them to work
erik-krogh Oct 15, 2021
53e362c
QL: Merge pull request #112 from github/tausbn/import-language-first
tausbn Oct 15, 2021
310ea6b
Merge pull request #112 from github/tausbn/import-language-first
tausbn Oct 15, 2021
514f8f3
QL: Also update `qltest.cmd`
tausbn Oct 15, 2021
5ef7b97
Also update `qltest.cmd`
tausbn Oct 15, 2021
3fc0bed
QL: Remove some FPs.
aschackmull Oct 15, 2021
6c70f52
Remove some FPs.
aschackmull Oct 15, 2021
b75e19a
QL: Merge branch 'main' into tausbn/update-extractor-generator
tausbn Oct 15, 2021
89d2f93
Merge branch 'main' into tausbn/update-extractor-generator
tausbn Oct 15, 2021
4238a5b
QL: Merge pull request #116 from github/erik-krogh/qlpack-test
tausbn Oct 15, 2021
bd52438
Merge pull request #116 from github/erik-krogh/qlpack-test
tausbn Oct 15, 2021
e5dab01
QL: Update `build.yml` to supply generator args
tausbn Oct 15, 2021
2a0c291
Update `build.yml` to supply generator args
tausbn Oct 15, 2021
85e5b68
QL: Fix `dataset_measure.yml`, hopefully
tausbn Oct 15, 2021
44fff65
Fix `dataset_measure.yml`, hopefully
tausbn Oct 15, 2021
4fe4315
QL: QL: Add dataflow library.
MathiasVP Oct 15, 2021
5c70c6a
QL: Add dataflow library.
MathiasVP Oct 15, 2021
d90de13
QL: QL: Add query for using toString in query logic.
MathiasVP Oct 15, 2021
c9f80b1
QL: Add query for using toString in query logic.
MathiasVP Oct 15, 2021
9c82f72
QL: Ignore overridden predicates in consistency check
tausbn Oct 15, 2021
ccaef19
Ignore overridden predicates in consistency check
tausbn Oct 15, 2021
53cbde0
QL: Merge branch 'main' into tausbn/add-override-test
tausbn Oct 15, 2021
1fb8a17
Merge branch 'main' into tausbn/add-override-test
tausbn Oct 15, 2021
6f4370a
QL: Update `bleeding-codeql-analysis.yml`
tausbn Oct 15, 2021
e185382
Update `bleeding-codeql-analysis.yml`
tausbn Oct 15, 2021
24959a5
QL: Fix bad merge
tausbn Oct 15, 2021
10aeadb
Fix bad merge
tausbn Oct 15, 2021
8aa354c
QL: fix performance
erik-krogh Oct 15, 2021
1a79b13
fix performance
erik-krogh Oct 15, 2021
510f825
QL: New query: Don't use library annotation.
aschackmull Oct 15, 2021
b0bbbc5
New query: Don't use library annotation.
aschackmull Oct 15, 2021
1d331fc
QL: Remove the dataflow library.
MathiasVP Oct 15, 2021
3071731
Remove the dataflow library.
MathiasVP Oct 15, 2021
ed15ee8
QL: Merge pull request #122 from github/aschackmull/library-annot
MathiasVP Oct 15, 2021
67b65b6
Merge pull request #122 from github/aschackmull/library-annot
MathiasVP Oct 15, 2021
21caef3
QL: QL: Reduce precision to 'medium'.
MathiasVP Oct 15, 2021
1469766
QL: Reduce precision to 'medium'.
MathiasVP Oct 15, 2021
7745a13
QL: Merge pull request #117 from github/tausbn/update-extractor-gener…
tausbn Oct 15, 2021
8ceeb71
Merge pull request #117 from github/tausbn/update-extractor-generator
tausbn Oct 15, 2021
370d75b
QL: Merge pull request #104 from github/bidirectional-import
aschackmull Oct 15, 2021
684600c
Merge pull request #104 from github/bidirectional-import
aschackmull Oct 15, 2021
1375e1d
QL: Support `super` with `instanceof`
tausbn Oct 15, 2021
5b261d8
Support `super` with `instanceof`
tausbn Oct 15, 2021
5dbeaa1
QL: Merge pull request #123 from github/tausbn/add-instanceof-super-r…
MathiasVP Oct 15, 2021
ed17bd9
Merge pull request #123 from github/tausbn/add-instanceof-super-resol…
MathiasVP Oct 15, 2021
d6dd752
QL: Merge pull request #95 from github/tausbn/add-override-test
tausbn Oct 15, 2021
eb787ae
Merge pull request #95 from github/tausbn/add-override-test
tausbn Oct 15, 2021
4d5901a
QL: QL: Respond to PR reviews.
MathiasVP Oct 15, 2021
f5bb1d0
QL: Respond to PR reviews.
MathiasVP Oct 15, 2021
02c2603
QL: Merge pull request #119 from github/query-depends-on-tostring
MathiasVP Oct 15, 2021
df3d5ae
Merge pull request #119 from github/query-depends-on-tostring
MathiasVP Oct 15, 2021
188a6b1
QL: Merge branch 'main' into missing-nomagic
MathiasVP Oct 15, 2021
dbc3b49
Merge branch 'main' into missing-nomagic
MathiasVP Oct 15, 2021
0bfedc7
QL: fix performance of the transitive step query
erik-krogh Oct 15, 2021
62355f3
fix performance of the transitive step query
erik-krogh Oct 15, 2021
24334e4
QL: Merge pull request #109 from github/missing-nomagic
MathiasVP Oct 15, 2021
299500f
Merge pull request #109 from github/missing-nomagic
MathiasVP Oct 15, 2021
9a02a22
QL: Merge pull request #124 from github/erik-krogh/fix-step-performance
tausbn Oct 15, 2021
d950b59
Merge pull request #124 from github/erik-krogh/fix-step-performance
tausbn Oct 15, 2021
8391580
QL: add an consistency test for the totality of `getParent()`
erik-krogh Oct 15, 2021
d0aa219
add an consistency test for the totality of `getParent()`
erik-krogh Oct 15, 2021
b40e307
QL: add failing callgraph test
erik-krogh Oct 15, 2021
535904e
add failing callgraph test
erik-krogh Oct 15, 2021
c7aa89b
QL: add missing `getChild()` relations
erik-krogh Oct 15, 2021
7ce2750
add missing `getChild()` relations
erik-krogh Oct 15, 2021
1239b1a
QL: fix getEnclosingModule, which broke the callgraph
erik-krogh Oct 15, 2021
f8138c9
fix getEnclosingModule, which broke the callgraph
erik-krogh Oct 15, 2021
3252c04
QL: improve resolution of buildin predicates (and getAQlClass())
erik-krogh Oct 15, 2021
145efa4
improve resolution of buildin predicates (and getAQlClass())
erik-krogh Oct 15, 2021
e060708
QL: correctly resolve super calls in char preds
erik-krogh Oct 15, 2021
3b1c04b
correctly resolve super calls in char preds
erik-krogh Oct 15, 2021
865e4f0
QL: find dbscheme files that are contained within a subfolder
erik-krogh Oct 15, 2021
f19a229
find dbscheme files that are contained within a subfolder
erik-krogh Oct 15, 2021
efff86e
QL: Merge pull request #125 from github/erik-krogh/fix-my-own-mistake
erik-krogh Oct 15, 2021
6004ecc
Merge pull request #125 from github/erik-krogh/fix-my-own-mistake
erik-krogh Oct 15, 2021
e528c6f
QL: add test for type resolution
erik-krogh Oct 16, 2021
2a5d567
add test for type resolution
erik-krogh Oct 16, 2021
34d4e55
QL: better type resolution of add expressions
erik-krogh Oct 16, 2021
c1b011d
better type resolution of add expressions
erik-krogh Oct 16, 2021
4c32b7e
QL: add test for super-types
erik-krogh Oct 16, 2021
c43ff2f
add test for super-types
erik-krogh Oct 16, 2021
928b91d
QL: resolve super-expressions when the super-type is explicitly menti…
erik-krogh Oct 16, 2021
f99ce11
resolve super-expressions when the super-type is explicitly mentioned
erik-krogh Oct 16, 2021
a652892
QL: better support for getType on super
erik-krogh Oct 16, 2021
b31ea30
better support for getType on super
erik-krogh Oct 16, 2021
1b9793d
QL: only resolve imports to qll files, and not e.g. dbschemes
erik-krogh Oct 16, 2021
74b1c19
only resolve imports to qll files, and not e.g. dbschemes
erik-krogh Oct 16, 2021
84d2cb8
QL: and consistency query that will highlight new consistency errors
erik-krogh Oct 16, 2021
9d9663d
and consistency query that will highlight new consistency errors
erik-krogh Oct 16, 2021
8ad5b34
QL: add test for predicateExpr
erik-krogh Oct 17, 2021
2af3fb5
add test for predicateExpr
erik-krogh Oct 17, 2021
6cec644
QL: NewTypeBranches are Predicates
erik-krogh Oct 17, 2021
055937e
NewTypeBranches are Predicates
erik-krogh Oct 17, 2021
9681119
QL: add `noResolvePredicateExpr` to the list of empty consistency pre…
erik-krogh Oct 17, 2021
dc354f8
add `noResolvePredicateExpr` to the list of empty consistency predicates
erik-krogh Oct 17, 2021
4db6702
QL: fix predicate resolution
erik-krogh Oct 17, 2021
9127fa5
fix predicate resolution
erik-krogh Oct 17, 2021
48d4fcd
QL: fix some inconsistencies related to primitive types
erik-krogh Oct 17, 2021
18eede5
fix some inconsistencies related to primitive types
erik-krogh Oct 17, 2021
8997989
QL: fix code-scanning alert
erik-krogh Oct 17, 2021
09f60f2
fix code-scanning alert
erik-krogh Oct 17, 2021
b317d73
QL: fix broken import in unused file
erik-krogh Oct 17, 2021
ade2061
fix broken import in unused file
erik-krogh Oct 17, 2021
9e4e428
QL: add support for libraryPathDependencies in qlpacks
erik-krogh Oct 17, 2021
9a73c36
add support for libraryPathDependencies in qlpacks
erik-krogh Oct 17, 2021
ef6ea19
QL: add nonTotalGetParent to the list of empty consistency queries
erik-krogh Oct 17, 2021
509e77b
add nonTotalGetParent to the list of empty consistency queries
erik-krogh Oct 17, 2021
7e2b00e
QL: use workflow_call in bleeding-codeql-analysis.yml
esbena Oct 18, 2021
c200ec3
use workflow_call in bleeding-codeql-analysis.yml
esbena Oct 18, 2021
dc715af
QL: add nightly-changes workflow
esbena Oct 18, 2021
eded7b8
add nightly-changes workflow
esbena Oct 18, 2021
f29813b
QL: Merge pull request #131 from github/esbena/workflow-improvements
esbena Oct 18, 2021
a9cef84
Merge pull request #131 from github/esbena/workflow-improvements
esbena Oct 18, 2021
6cc14b1
QL: change branch name
esbena Oct 18, 2021
a089e0e
change branch name
esbena Oct 18, 2021
d49db92
QL: change code-scanning branch
esbena Oct 18, 2021
e851ba2
change code-scanning branch
esbena Oct 18, 2021
032a0dc
QL: Merge pull request #132 from github/esbena/fix-branch
esbena Oct 18, 2021
b96ad38
Merge pull request #132 from github/esbena/fix-branch
esbena Oct 18, 2021
5fa1c04
QL: Update bleeding-codeql-analysis.yml
esbena Oct 18, 2021
3f420c4
Update bleeding-codeql-analysis.yml
esbena Oct 18, 2021
769f787
QL: Update readme with alerts and actions information
esbena Oct 19, 2021
0760c1c
Update readme with alerts and actions information
esbena Oct 19, 2021
ac78e26
QL: Merge pull request #133 from github/esbena/update-readme
esbena Oct 19, 2021
629605c
Merge pull request #133 from github/esbena/update-readme
esbena Oct 19, 2021
c00e18f
QL: cleanup
erik-krogh Oct 19, 2021
631a503
cleanup
erik-krogh Oct 19, 2021
3bc209d
QL: Fix create-extractor-pack.ps1
geoffw0 Oct 20, 2021
1f2b32f
Fix create-extractor-pack.ps1
geoffw0 Oct 20, 2021
fff1f12
QL: Merge pull request #135 from github/winfix
tausbn Oct 20, 2021
7214d70
Merge pull request #135 from github/winfix
tausbn Oct 20, 2021
f54f70d
QL: Merge pull request #130 from github/erik-krogh/more-types
erik-krogh Nov 16, 2021
cc16fde
Merge pull request #130 from github/erik-krogh/more-types
erik-krogh Nov 16, 2021
1b19a3e
QL: introduce FieldDecl in the ast
erik-krogh Nov 18, 2021
5a76e7d
introduce FieldDecl in the ast
erik-krogh Nov 18, 2021
7c82c5e
QL: refactor away the `ComparisonOp` ast class
erik-krogh Nov 18, 2021
9d308ba
refactor away the `ComparisonOp` ast class
erik-krogh Nov 18, 2021
0154f4e
QL: add getLeft/getRight helper predicates to disjunction/conjunction
erik-krogh Nov 18, 2021
84d277d
add getLeft/getRight helper predicates to disjunction/conjunction
erik-krogh Nov 18, 2021
c3f3628
QL: performance improvements
erik-krogh Nov 18, 2021
ac4476f
performance improvements
erik-krogh Nov 18, 2021
28444c7
QL: move implementation of implicit-this to Query.qll file
erik-krogh Nov 18, 2021
45def1b
move implementation of implicit-this to Query.qll file
erik-krogh Nov 18, 2021
f320414
QL: move use-instanceof implementation to Query.qll, and rename the .…
erik-krogh Nov 18, 2021
33d363e
move use-instanceof implementation to Query.qll, and rename the .ql file
erik-krogh Nov 18, 2021
1cbacc4
QL: move use-set-literal implementation to Query.qll file
erik-krogh Nov 18, 2021
112cd9d
move use-set-literal implementation to Query.qll file
erik-krogh Nov 18, 2021
12a3fa7
QL: add var unused in disjunct query
erik-krogh Nov 18, 2021
97461d1
add var unused in disjunct query
erik-krogh Nov 18, 2021
d8bf7ed
QL: add redundant inline cast query
erik-krogh Nov 18, 2021
89604de
add redundant inline cast query
erik-krogh Nov 18, 2021
d64c7fc
QL: rename "use matches" query, and refactor into Query.qll
erik-krogh Nov 18, 2021
38b925b
rename "use matches" query, and refactor into Query.qll
erik-krogh Nov 18, 2021
1b070f1
QL: Merge pull request #129 from github/erik-krogh/cartesian
erik-krogh Nov 18, 2021
349b556
Merge pull request #129 from github/erik-krogh/cartesian
erik-krogh Nov 18, 2021
c07d553
QL: update import script
erik-krogh Nov 18, 2021
fb40b8a
update import script
erik-krogh Nov 18, 2021
fa54855
QL: Add codeql sources (6c2713dd8bf76ae1207e3123900a04d6f89b5162)
erik-krogh Nov 18, 2021
61b7180
Add codeql sources (6c2713dd8bf76ae1207e3123900a04d6f89b5162)
erik-krogh Nov 18, 2021
fe09778
QL: Add codeql-go sources (4cae4b23fc1b2b1760e259b660996e9bb5573279)
erik-krogh Nov 18, 2021
e3c0e19
Add codeql-go sources (4cae4b23fc1b2b1760e259b660996e9bb5573279)
erik-krogh Nov 18, 2021
9a6c9c4
QL: remove codeql-ruby sources
erik-krogh Nov 18, 2021
a0bf130
remove codeql-ruby sources
erik-krogh Nov 18, 2021
44ffc7e
QL: Merge pull request #126 from github/erik-krogh/update-sources
erik-krogh Nov 18, 2021
036d749
Merge pull request #126 from github/erik-krogh/update-sources
erik-krogh Nov 18, 2021
37c2db2
QL: update inefficientStringComparison, to avoid underscores
erik-krogh Nov 18, 2021
15b5658
update inefficientStringComparison, to avoid underscores
erik-krogh Nov 18, 2021
d89e430
QL: introduce type resolution consistency checks
erik-krogh Nov 18, 2021
1a0379a
introduce type resolution consistency checks
erik-krogh Nov 18, 2021
70f6493
QL: Add codeql sources (1f3f7e9ccc631177f671f3d465faec3477cbe1c5)
erik-krogh Nov 19, 2021
a86f2c3
Add codeql sources (1f3f7e9ccc631177f671f3d465faec3477cbe1c5)
erik-krogh Nov 19, 2021
172684c
QL: Merge pull request #137 from github/erik-krogh/even-more-consistency
erik-krogh Nov 19, 2021
e25f03f
Merge pull request #137 from github/erik-krogh/even-more-consistency
erik-krogh Nov 19, 2021
da5c2fb
QL: bump the severity of ql/implicit-this
erik-krogh Nov 29, 2021
8e1b4e3
bump the severity of ql/implicit-this
erik-krogh Nov 29, 2021
44c3787
QL: Add codeql sources (3c59aa319ee79d8038eec863df7ab18372c7b30e)
erik-krogh Dec 7, 2021
d852b28
Add codeql sources (3c59aa319ee79d8038eec863df7ab18372c7b30e)
erik-krogh Dec 7, 2021
a3d11c6
QL: Add codeql-go sources (894102defd0777931a0e261ad66e631e63ec0ad8)
erik-krogh Dec 7, 2021
3ebf1e3
Add codeql-go sources (894102defd0777931a0e261ad66e631e63ec0ad8)
erik-krogh Dec 7, 2021
a722aeb
QL: Merge pull request #138 from github/erik-krogh/bump-this
erik-krogh Dec 7, 2021
fe1a473
Merge pull request #138 from github/erik-krogh/bump-this
erik-krogh Dec 7, 2021
d06ac78
QL: move files and folder, except dotfiles, into a ql subfolder
erik-krogh Dec 14, 2021
56a8cdb
move files and folder, except dotfiles, into a ql subfolder
erik-krogh Dec 14, 2021
8eac1dc
QL: move .vscode folder inside the ql subfolder
erik-krogh Dec 14, 2021
08b0642
QL: remove repo-tests
erik-krogh Dec 14, 2021
b73b60d
QL: remove the .devcontainer
erik-krogh Dec 14, 2021
633597c
QL: remove the nightly ql-for-ql job
erik-krogh Dec 14, 2021
fdb15d6
QL: remove workflow that ran CodeQL with a published pack
erik-krogh Dec 14, 2021
f5788b9
QL: adjust remaining workflows to work in the QL folder
erik-krogh Dec 14, 2021
dc91877
QL: simplify the build/analyze workflow into a single workflow
erik-krogh Dec 14, 2021
d89c41b
QL: update the readme
erik-krogh Dec 14, 2021
5d93309
QL: call the product `QL for QL` (because it rolls nicely).
erik-krogh Dec 15, 2021
24c2578
QL: cache query compilation
erik-krogh Dec 15, 2021
faaa74b
QL: move .git files into the ql/ folder
erik-krogh Dec 15, 2021
77cb822
QL: fix search path for dataset measure
erik-krogh Dec 15, 2021
8d91ba2
QL: fix Esbens workflow comments
erik-krogh Dec 15, 2021
0ac3e5c
Merge QL for QL into github/codeql
erik-krogh Dec 15, 2021
fb97923
QL: merge the .codeqlmanifest.json file in the root
erik-krogh Dec 15, 2021
4beacee
QL: fix Buildins/Builtins typo
erik-krogh Dec 15, 2021
133c496
Merge branch 'main' into erik-krogh/publish-ql-for-ql
erik-krogh Dec 15, 2021
76dcfd4
more specific search path for dataset measure job
erik-krogh Dec 15, 2021
8eda061
add dbscheme and codeql version to query hash
erik-krogh Dec 16, 2021
be076dc
add Erik and Taus as QL-for-QL reviewers
erik-krogh Dec 16, 2021
2626b0b
QL: fix test workflow
erik-krogh Dec 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion .codeqlmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"misc/legacy-support/*/qlpack.yml",
"misc/suite-helpers/qlpack.yml",
"ruby/extractor-pack/codeql-extractor.yml",
"ruby/ql/consistency-queries/qlpack.yml"
"ruby/ql/consistency-queries/qlpack.yml",
"ql/ql/consistency-queries/qlpack.yml",
"ql/extractor-pack/codeql-extractor.yml"
],
"versionPolicies": {
"default": {
Expand Down
152 changes: 152 additions & 0 deletions .github/workflows/ql-for-ql-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
name: Run QL for QL

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always

jobs:
queries:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@esbena/ql
erik-krogh marked this conversation as resolved.
Show resolved Hide resolved
with:
languages: javascript # does not matter
erik-krogh marked this conversation as resolved.
Show resolved Hide resolved
- name: Get CodeQL version
id: get-codeql-version
run: |
echo "::set-output name=version::$("${CODEQL}" --version | head -n 1 | rev | cut -d " " -f 1 | rev)"
shell: bash
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- name: Cache queries
id: cache-queries
uses: actions/cache@v2
with:
path: ${{ runner.temp }}/query-pack.zip
key: queries-${{ hashFiles('ql/**/*.ql*') }}-${{ hashFiles('ql/ql/src/ql.dbscheme*') }}-${{ steps.get-codeql-version.outputs.version }}
- name: Build query pack
if: steps.cache-queries.outputs.cache-hit != 'true'
run: |
cd ql/ql/src
"${CODEQL}" pack create
cd .codeql/pack/codeql/ql-all/0.0.0
zip "${PACKZIP}" -r .
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
PACKZIP: ${{ runner.temp }}/query-pack.zip
- name: Upload query pack
uses: actions/upload-artifact@v2
with:
name: query-pack-zip
path: ${{ runner.temp }}/query-pack.zip

extractors:
strategy:
fail-fast: false

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
ql/target
key: ${{ runner.os }}-rust-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cd ql; cargo fmt --all -- --check
- name: Build
run: cd ql; cargo build --verbose
- name: Run tests
run: cd ql; cargo test --verbose
- name: Release build
run: cd ql; cargo build --release
- name: Generate dbscheme
run: ql/target/release/ql-generator --dbscheme ql/ql/src/ql.dbscheme --library ql/ql/src/codeql_ql/ast/internal/TreeSitter.qll
- uses: actions/upload-artifact@v2
with:
name: extractor-ubuntu-latest
path: |
ql/target/release/ql-extractor
ql/target/release/ql-extractor.exe
retention-days: 1
package:
runs-on: ubuntu-latest

needs:
- extractors
- queries

steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: query-pack-zip
path: query-pack-zip
- uses: actions/download-artifact@v2
with:
name: extractor-ubuntu-latest
path: linux64
- run: |
unzip query-pack-zip/*.zip -d pack
cp -r ql/codeql-extractor.yml ql/tools ql/ql/src/ql.dbscheme.stats pack/
mkdir -p pack/tools/linux64
if [[ -f linux64/ql-extractor ]]; then
cp linux64/ql-extractor pack/tools/linux64/extractor
chmod +x pack/tools/linux64/extractor
fi
cd pack
zip -rq ../codeql-ql.zip .
- uses: actions/upload-artifact@v2
with:
name: codeql-ql-pack
path: codeql-ql.zip
retention-days: 1
analyze:
runs-on: ubuntu-latest

needs:
- package

steps:
- name: Download pack
uses: actions/download-artifact@v2
with:
name: codeql-ql-pack
path: ${{ runner.temp }}/codeql-ql-pack-artifact

- name: Prepare pack
run: |
unzip "${PACK_ARTIFACT}/*.zip" -d "${PACK}"
env:
PACK_ARTIFACT: ${{ runner.temp }}/codeql-ql-pack-artifact
PACK: ${{ runner.temp }}/pack
- name: Hack codeql-action options
run: |
JSON=$(jq -nc --arg pack "${PACK}" '.resolve.queries=["--search-path", $pack] | .resolve.extractor=["--search-path", $pack] | .database.init=["--search-path", $pack]')
echo "CODEQL_ACTION_EXTRA_OPTIONS=${JSON}" >> ${GITHUB_ENV}
env:
PACK: ${{ runner.temp }}/pack

- name: Checkout repository
uses: actions/checkout@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@esbena/ql
with:
languages: ql
db-location: ${{ runner.temp }}/db

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@esbena/ql
erik-krogh marked this conversation as resolved.
Show resolved Hide resolved

84 changes: 84 additions & 0 deletions .github/workflows/ql-for-ql-dataset_measure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Collect database stats for QL for QL

on:
push:
branches: [main]
paths:
- ql/ql/src/ql.dbscheme
pull_request:
branches: [main]
paths:
- ql/ql/src/ql.dbscheme
workflow_dispatch:

jobs:
measure:
env:
CODEQL_THREADS: 4 # TODO: remove this once it's set by the CLI
strategy:
matrix:
repo:
- github/codeql
- github/codeql-go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@esbena/ql
with:
languages: javascript # does not matter
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
ql/target
key: ${{ runner.os }}-qltest-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build Extractor
run: cd ql; env "PATH=$PATH:`dirname ${CODEQL}`" ./create-extractor-pack.sh
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- name: Checkout ${{ matrix.repo }}
uses: actions/checkout@v2
with:
repository: ${{ matrix.repo }}
path: ${{ github.workspace }}/repo
- name: Create database
run: |
"${CODEQL}" database create \
--search-path "ql/extractor-pack" \
--threads 4 \
--language ql --source-root "${{ github.workspace }}/repo" \
"${{ runner.temp }}/database"
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- name: Measure database
run: |
mkdir -p "stats/${{ matrix.repo }}"
"${CODEQL}" dataset measure --threads 4 --output "stats/${{ matrix.repo }}/stats.xml" "${{ runner.temp }}/database/db-ql"
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- uses: actions/upload-artifact@v2
with:
name: measurements
path: stats
retention-days: 1

merge:
runs-on: ubuntu-latest
needs: measure
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: measurements
path: stats
- run: |
python -m pip install --user lxml
find stats -name 'stats.xml' -print0 | sort -z | xargs -0 python ql/scripts/merge_stats.py --output ql/ql/src/ql.dbscheme.stats --normalise ql_tokeninfo
- uses: actions/upload-artifact@v2
with:
name: ql.dbscheme.stats
path: ql/ql/src/ql.dbscheme.stats
52 changes: 52 additions & 0 deletions .github/workflows/ql-for-ql-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Run QL for QL Tests

on:
push:
branches: [main]
paths:
- ql/*
pull_request:
branches: [main]
paths:
- ql/*

env:
CARGO_TERM_COLOR: always

jobs:
qltest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Find codeql
id: find-codeql
uses: github/codeql-action/init@esbena/ql
with:
languages: javascript # does not matter
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
ql/target
key: ${{ runner.os }}-qltest-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build extractor
run: |
cd ql;
codeqlpath=$(dirname ${{ steps.find-codeql.outputs.codeql-path }});
env "PATH=$PATH:$codeqlpath" ./create-extractor-pack.sh
- name: Run QL tests
run: |
"${CODEQL}" test run --check-databases --check-unused-labels --check-repeated-labels --check-redefined-labels --check-use-before-definition --search-path "${{ github.workspace }}/ql/extractor-pack" --consistency-queries ql/ql/consistency-queries ql/ql/test
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- name: Check QL formatting
run: |
find ql/ql "(" -name "*.ql" -or -name "*.qll" ")" -print0 | xargs -0 "${CODEQL}" query format --check-only
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
- name: Check QL compilation
run: |
"${CODEQL}" query compile --check-only --threads=4 --warnings=error --search-path "${{ github.workspace }}/ql/extractor-pack" "ql/ql/src" "ql/ql/examples"
env:
CODEQL: ${{ steps.find-codeql.outputs.codeql-path }}
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
/docs/codeql-for-visual-studio-code/ @github/codeql-vscode-reviewers
/docs/ql-language-reference/ @github/codeql-frontend-reviewers
/docs/query-*-style-guide.md @github/codeql-analysis-reviewers

# QL for QL reviewers
/ql/ @erik-krogh @tausbn
1 change: 1 addition & 0 deletions ql/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cargo.lock -diff -whitespace
8 changes: 8 additions & 0 deletions ql/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
target
extractor-pack
.vscode/launch.json
.cache
ql/test/**/*.testproj
ql/test/**/*.actual
ql/test/**/CONSISTENCY
work
14 changes: 14 additions & 0 deletions ql/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "cargo",
"subcommand": "build",
"problemMatcher": [
"$rustc"
],
"group": "build",
"label": "Rust: cargo build"
}
]
}