Skip to content

Conversation

@DeeprajPandey
Copy link
Contributor

@DeeprajPandey DeeprajPandey commented Oct 11, 2025

Closes #11158

Description of change

Removed commented out code block in FindOptionsUtils.ts (lines 82+).

The applyFindManyOptionsOrConditionsToQueryBuilder function has been commented out with no indication of whether it's deprecated or temporarily disabled. Since it's not being used and has been in this state for a while, this PR removes it to clean up the codebase.

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • This pull request links relevant issues as Fixes #00000
  • There are new or updated unit tests validating the change - N/A (no functional changes)
  • Documentation has been updated to reflect this change - N/A (no functional changes)

Summary by CodeRabbit

  • Refactor
    • Removed legacy helpers for applying options to the query builder; only the tree-query option applier remains public.
    • This may affect custom integrations that relied on the removed helpers; update usage to the remaining public API.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 11, 2025

Walkthrough

Removed two public static helper methods from FindOptionsUtils that applied FindOptions to a query builder, leaving only the tree-specific applyOptionsToTreeQueryBuilder as public. This eliminates the generic options-driven application paths for standard query builders in this file.

Changes

Cohort / File(s) Summary of Changes
FindOptions helpers removal
src/find-options/FindOptionsUtils.ts
Removed public static methods: applyFindManyOptionsOrConditionsToQueryBuilder and applyOptionsToQueryBuilder. Retained applyOptionsToTreeQueryBuilder as the sole public method. Eliminated legacy options-driven application logic for standard query builders.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Caller
  participant FindOptionsUtils
  participant QueryBuilder

  rect rgb(240,248,255)
  Note over Caller,FindOptionsUtils: Previous flow (removed)
  Caller->>FindOptionsUtils: applyOptionsToQueryBuilder(options)
  FindOptionsUtils->>QueryBuilder: configure(select/relations/where/order/skip/take/locks/cache/...)
  FindOptionsUtils-->>Caller: qb
  end

  rect rgb(245,255,245)
  Note over Caller,FindOptionsUtils: Current flow
  alt Tree queries
    Caller->>FindOptionsUtils: applyOptionsToTreeQueryBuilder(treeOptions)
    FindOptionsUtils->>QueryBuilder: configure(tree-specific)
    FindOptionsUtils-->>Caller: qb
  else Non-tree queries
    Note over Caller,QueryBuilder: Caller handles configuration directly (no generic options helper)
  end
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

A rabbit taps keys with a quiet cheer,
Two helpers hop out, the path now clear.
The forest of trees still gets its guide,
While plain old fields learn to self-applied.
Fewer trails to wander, code feels light—
Thump-thump, merge it, into the night. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely and accurately describes the core change—removing commented-out code from the FindOptionsUtils file—using a clear “style:” prefix that signals a non-functional cleanup and makes the primary intent immediately understandable.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 181154a and 881f370.

📒 Files selected for processing (1)
  • src/find-options/FindOptionsUtils.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • src/find-options/FindOptionsUtils.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

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

Thanks for your help, nice catch @DeeprajPandey 💪

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 11, 2025

typeorm-sql-js-example

npm i https://pkg.pr.new/typeorm/typeorm@11721

commit: 881f370

@gioboa gioboa requested review from alumni and sgarner October 11, 2025 05:58
@coveralls
Copy link

Coverage Status

coverage: 76.433%. remained the same
when pulling 881f370 on DeeprajPandey:style/remove-comments-findOptionsUtils
into 181154a on typeorm:master.

Copy link
Collaborator

@mguida22 mguida22 left a comment

Choose a reason for hiding this comment

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

thank you!

@mguida22 mguida22 merged commit 3ac6053 into typeorm:master Nov 9, 2025
62 checks passed
ThbltLmr pushed a commit to ThbltLmr/typeorm that referenced this pull request Dec 2, 2025
mgohin pushed a commit to mgohin/typeorm that referenced this pull request Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

applyFindManyOptionsOrConditionsToQueryBuilder is commented out - is that intentional?

4 participants