Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

d10c
Copy link
Contributor

@d10c d10c commented Jun 26, 2025

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.

  • Java: convert ArbitraryApkInstallation test to .qlref
  • Ruby: add meta/TaintedNodes.ql test
    • Borrows tainted_path.rb as test source from PathInjection test.
    • The query selects basically all the tainted nodes, so the test doesn't distinguish between Source/Alert.

@d10c d10c added the no-change-note-required This PR does not need a change note label Jun 26, 2025
@d10c d10c marked this pull request as ready for review June 26, 2025 12:28
@Copilot Copilot AI review requested due to automatic review settings June 26, 2025 12:28
@d10c d10c requested review from a team as code owners June 26, 2025 12:28
Copy link
Contributor

@Copilot Copilot AI left a 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 the meta/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.

Comment on lines +89 to +90
def require_relative()
path = ActiveStorage::Filename.new(params[:path]) # $ Alert
Copy link
Preview

Copilot AI Jun 26, 2025

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.

Suggested change
def require_relative()
path = ActiveStorage::Filename.new(params[:path]) # $ Alert
def require_relative(path)

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@owen-mc owen-mc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java no-change-note-required This PR does not need a change note Ruby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants