-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Java, Ruby: add missing .qlref tests #19888
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds missing .qlref
test configurations for two queries:
- Converts the Java
ArbitraryApkInstallation
test to use a.qlref
file and updates inline expectation markers. - Adds a new Ruby
.qlref
test for themeta/TaintedNodes
query (including its test source and expected output).
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
java/ql/test/query-tests/security/CWE-094/ApkInstallationTest/options | Adds extractor options needed to compile the test. |
java/ql/test/query-tests/security/CWE-094/ApkInstallationTest/ApkInstallationTest.qlref | Introduces .qlref for the ArbitraryApkInstallation query. |
java/ql/test/query-tests/security/CWE-094/ApkInstallationTest/ApkInstallationTest.expected | Provides expected results for the converted test. |
java/ql/test/query-tests/security/CWE-094/ApkInstallationTest/ApkInstallation.java | Updates inline tags from hasApkInstallation to Alert . |
ruby/ql/test/query-tests/meta/TaintedNodes/tainted_path.rb | Adds the Ruby test source for the TaintedNodes query. |
ruby/ql/test/query-tests/meta/TaintedNodes/TaintedNodes.qlref | Introduces .qlref for the TaintedNodes query. |
ruby/ql/test/query-tests/meta/TaintedNodes/TaintedNodes.expected | Defines expected taint-alert locations in the test. |
def require_relative() | ||
path = ActiveStorage::Filename.new(params[:path]) # $ Alert |
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.
The require_relative
method is defined without a path
parameter but calls super(path)
. Update the signature to def require_relative(path)
to match the super call.
def require_relative() | |
path = ActiveStorage::Filename.new(params[:path]) # $ Alert | |
def require_relative(path) |
Copilot uses AI. Check for mistakes.
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.
👍🏻 Java
Two non-
$lang-code-scanning.qls
queries (therefore out of scope of previous PRs) have already been made diff-informed but without a .qlref test (in order to run tests with the--check-diff-informed
consistency check they need to be in .qlref form). This PR adds those tests.