Skip to content

Ruby: Use empty DB stats#21511

Open
hvitved wants to merge 2 commits intogithub:mainfrom
hvitved:ruby/empty-stats
Open

Ruby: Use empty DB stats#21511
hvitved wants to merge 2 commits intogithub:mainfrom
hvitved:ruby/empty-stats

Conversation

@hvitved
Copy link
Contributor

@hvitved hvitved commented Mar 19, 2026

DCA looks good.

@github-actions github-actions bot added the Ruby label Mar 19, 2026
@hvitved hvitved force-pushed the ruby/empty-stats branch 2 times, most recently from 4f6656a to dc8cd62 Compare March 20, 2026 11:13
@hvitved hvitved added the no-change-note-required This PR does not need a change note label Mar 20, 2026
@hvitved hvitved marked this pull request as ready for review March 20, 2026 14:55
@hvitved hvitved requested a review from a team as a code owner March 20, 2026 14:55
Copilot AI review requested due to automatic review settings March 20, 2026 14:55
Copy link
Contributor

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 updates the Ruby CodeQL libraries to improve evaluation behavior (per the referenced DCA check), primarily by adding/adjusting QL pragmas and introducing small wrapper predicates to encourage more predictable/efficient binding and inlining.

Changes:

  • Added/expanded uses of pragma[only_bind_into], pragma[inline], and pragma[inline_late] in several core/framework libraries.
  • Refactored a few predicates/methods into *Impl implementations with thin inline wrappers (notably in AST scope handling and dataflow node scoping).
  • Minor internal factoring in ActiveRecord and dataflow dispatch to isolate sub-conditions into dedicated predicates.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ruby/ql/lib/codeql/ruby/frameworks/core/Hash.qll Adds only_bind_into to method-call selection for summaries.
ruby/ql/lib/codeql/ruby/frameworks/core/Array.qll Adds only_bind_into to method-call selection for summaries.
ruby/ql/lib/codeql/ruby/frameworks/ActiveRecord.qll Adds nomagic and factors association method-call condition into a helper predicate.
ruby/ql/lib/codeql/ruby/frameworks/actiondispatch/internal/Routing.qll Marks underscore with inline_late.
ruby/ql/lib/codeql/ruby/frameworks/actioncontroller/Filters.qll Introduces an inline_late wrapper around lookupMethod and uses it for filter callable resolution.
ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll Refactors getCfgScope into getCfgScopeImpl + inline wrapper; adds a helper predicate for module compatibility.
ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowDispatch.qll Factors private/protected method filtering into inline_late helper predicates.
ruby/ql/lib/codeql/ruby/ast/internal/Scope.qll Refactors cached scope predicates into *Impl and adds inline_late wrappers.
ruby/ql/lib/codeql/ruby/ast/internal/Module.qll Adjusts top-level file restriction logic using a forall-based formulation.
ruby/ql/lib/codeql/ruby/ast/internal/Literal.qll Adds an inline_late getTokenValue helper and routes token-value reads through it.

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