Tutorial: Move QL detective tutorial library into shared codeql/tutorial library pack#11747
Merged
adityasharad merged 5 commits intogithub:mainfrom Jan 4, 2023
Merged
Conversation
This contains the QL detective tutorial library in `tutorial.qll`, so that it can be shared by all language libraries and referenced on its own.
This allows `import tutorial` from queries targeting any language, just like before, while removing the duplicate copies of `tutorial.qll`.
By moving the existing doc comment to the top level, that comment is shown when a user hovers over the module name in `import tutorial`.
Collaborator
Author
|
Apologies for the wide set of review requests! This touches all language libraries but I hope the changes are focused enough to review for your language separately. |
erik-krogh
approved these changes
Dec 21, 2022
Contributor
erik-krogh
left a comment
There was a problem hiding this comment.
It all looks good 👍 I checked all the changes.
At first I thought that you hadn't deleted cpp/ql/lib/tutorial.qll, but that's because it's been renamed to shared/tutorial/tutorial.qll according to git.
aibaars
reviewed
Dec 21, 2022
| upgrades: upgrades | ||
| dependencies: | ||
| codeql/ssa: ${workspace} | ||
| codeql/tutorial: ${workspace} |
Contributor
There was a problem hiding this comment.
What is the reason for adding a dependency on the tutorial pack? The pack is unused.
Contributor
There was a problem hiding this comment.
Such that you can do import tutorial from any file.
jketema
approved these changes
Dec 21, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Key changes:
codeql/tutorial, containing thetutorial.qlllibrary used for the QL detective tutorials.codeql/*-allnow depend oncodeql/tutorial. This means thatimport tutorialwill work in any query that depends on any of the language libraries. Remove the duplicate copies oftutorial.qll.tutorialmodule. ThePersonclass gets a new doc comment, and thetutorialmodule gets the existing doc comment that was previously attached toPerson.Not in scope in this PR:
import tutorial.@github/code-scanning-secexp-reviewers this should make it easier in future for us to reference the tutorial libraries from a Codespace, but it does not block the existing Codespaces work.