Skip to content

Conversation

d10c
Copy link
Contributor

@d10c d10c commented Jun 17, 2025

An auto-generated patch that enables diff-informed data flow in the obvious cases.

Adds getASelected{Source,Sink}Location() { none() } override to queries that select a dataflow source or sink as a location, but not both.

An auto-generated patch that enables diff-informed data flow in the obvious cases.

Adds `getASelected{Source,Sink}Location() { none() }` override to queries that select a dataflow source or sink as a location, but not both.
@github-actions github-actions bot added the Ruby label Jun 17, 2025
@d10c d10c added the no-change-note-required This PR does not need a change note label Jun 17, 2025
@d10c d10c marked this pull request as ready for review June 17, 2025 14:35
@Copilot Copilot AI review requested due to automatic review settings June 17, 2025 14:35
@d10c d10c requested a review from a team as a code owner June 17, 2025 14:35
@d10c d10c requested a review from michaelnebel June 17, 2025 14:35
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

Enables diff-informed incremental data flow by overriding the selected-source location to none() in configs that only select a dataflow source.

  • Implement getASelectedSourceLocation(DataFlow::Node) override in BasicTaintConfig
  • Implement the same override in WeakParamsConfig
  • Implement the same override in HttpVerbConfig

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
ruby/ql/src/queries/meta/TaintedNodes.ql Added getASelectedSourceLocation override in BasicTaintConfig
ruby/ql/src/experimental/weak-params/WeakParams.ql Added getASelectedSourceLocation override in WeakParamsConfig
ruby/ql/src/experimental/manually-check-http-verb/ManuallyCheckHttpVerb.ql Added getASelectedSourceLocation override in HttpVerbConfig
Comments suppressed due to low confidence (2)

ruby/ql/src/queries/meta/TaintedNodes.ql:25

  • [nitpick] Add a brief comment explaining why getASelectedSourceLocation is overridden to none() in diff-informed incremental mode, to aid future maintainers.
  Location getASelectedSourceLocation(DataFlow::Node source) { none() }

ruby/ql/src/queries/meta/TaintedNodes.ql:25

  • No existing tests cover the new override behavior in diff-informed incremental mode; consider adding a unit test to verify that getASelectedSourceLocation returns none() as expected.
  Location getASelectedSourceLocation(DataFlow::Node source) { none() }

Comment on lines +24 to 27

Location getASelectedSourceLocation(DataFlow::Node source) { none() }
}

Copy link
Preview

Copilot AI Jun 17, 2025

Choose a reason for hiding this comment

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

[nitpick] This override is duplicated across multiple config modules; consider extracting it into a shared mixin or trait to reduce repetition.

Suggested change
Location getASelectedSourceLocation(DataFlow::Node source) { none() }
}
private module SharedTaintConfig {
Location getASelectedSourceLocation(DataFlow::Node source) { none() }
}
private module BasicTaintConfig implements DataFlow::ConfigSig, SharedTaintConfig {
}

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@michaelnebel michaelnebel left a comment

Choose a reason for hiding this comment

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

LGTM!

@d10c d10c merged commit 11bccdd into github:main Jun 19, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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