Skip to content

test(tree): consolidate tree tests from github-issues into tree-tables - #12259

Merged
gioboa merged 2 commits into
masterfrom
fix/tree-query-strategy-eager
Mar 24, 2026
Merged

gioboa merged 2 commits into
masterfrom
fix/tree-query-strategy-eager

Conversation

@pkuczynski

Copy link
Copy Markdown
Member

Move 17 tree-related regression tests from test/github-issues/ into test/functional/tree-tables/, organized by tree strategy and feature.

Moved tests: 904, 1089, 2518, 3783, 6947, 6948, 7068, 7155, 7415, 7974, 8076, 8443, 8556, 9534, 9673, 10843

  • Reorganize existing basic tests into subfolders for consistency
  • Convert 9673 from sinon spy-based to e2e assertions
  • Remove 9673 MySQL-only restriction (works on all drivers)
  • Clean up 9673 entity files (remove unnecessary !/? modifiers)
  • Rename describe blocks from issue numbers to feature breadcrumbs
  • Merge related tests: 1089+3783 (UUID), 7974+8076 (relations), 8443-mp+9534 (custom join column)

@pkuczynski pkuczynski self-assigned this Mar 24, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Review Summary by Qodo

Consolidate tree regression tests from github-issues into tree-tables

🧪 Tests

Grey Divider

Walkthroughs

Description
• Consolidate 16 tree-related regression tests from github-issues into tree-tables
• Reorganize tests by tree strategy (closure-table, materialized-path, nested-set)
• Rename describe blocks from issue numbers to feature breadcrumbs
• Merge related tests: 1089+3783 (UUID), 7974+8076 (relations), 8443 (custom join column across
  strategies)
• Convert test 9673 from MySQL-only with sinon spies to cross-driver e2e assertions
• Clean up entity files and fix import paths for new directory structure
Diagram
flowchart LR
  GH["GitHub Issues<br/>Tests 904,1089,2518,3783,6947,6948,7068,7155,7415,7974,8076,8443,8556,9534,9673,10843"]
  TT["tree-tables<br/>Organized by Strategy"]
  CT["closure-table<br/>basic, uuid, custom-*"]
  MP["materialized-path<br/>basic, uuid, custom-*, query-strategy-relations"]
  NS["nested-set<br/>basic, custom-join-column"]
  GH -->|"Move & Reorganize"| TT
  TT -->|"Strategy 1"| CT
  TT -->|"Strategy 2"| MP
  TT -->|"Strategy 3"| NS
Loading

Grey Divider

File Changes

1. test/functional/tree-tables/closure-table/basic/closure-table-mysql.test.ts ⚙️ Configuration changes +2/-2

Update import paths for nested directory structure

test/functional/tree-tables/closure-table/basic/closure-table-mysql.test.ts


2. test/functional/tree-tables/closure-table/basic/closure-table.test.ts ⚙️ Configuration changes +2/-2

Update import paths for nested directory structure

test/functional/tree-tables/closure-table/basic/closure-table.test.ts


3. test/functional/tree-tables/closure-table/basic/entity/Category.ts 🧪 Tests +25/-0

Create new Category entity for basic closure-table tests

test/functional/tree-tables/closure-table/basic/entity/Category.ts


View more (64)
4. test/functional/tree-tables/closure-table/basic/entity/Foo1.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/closure-table/basic/entity/Foo1.ts


5. test/functional/tree-tables/closure-table/basic/entity/Foo2.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/closure-table/basic/entity/Foo2.ts


6. test/functional/tree-tables/closure-table/basic/entity/Foo3.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/closure-table/basic/entity/Foo3.ts


7. test/functional/tree-tables/closure-table/custom-column-names/custom-column-names.test.ts 🧪 Tests +4/-4

Rename describe block from issue number to feature breadcrumb

test/functional/tree-tables/closure-table/custom-column-names/custom-column-names.test.ts


8. test/functional/tree-tables/closure-table/custom-column-names/entity/Category.ts ⚙️ Configuration changes +6/-6

Update import paths for nested directory structure

test/functional/tree-tables/closure-table/custom-column-names/entity/Category.ts


9. test/functional/tree-tables/closure-table/custom-join-column/custom-join-column.test.ts 🧪 Tests +3/-3

Rename describe block from issue number to feature breadcrumb

test/functional/tree-tables/closure-table/custom-join-column/custom-join-column.test.ts


10. test/functional/tree-tables/closure-table/custom-join-column/entity/Category.ts 🧪 Tests +29/-0

Create new Category entity for custom join column tests

test/functional/tree-tables/closure-table/custom-join-column/entity/Category.ts


11. test/functional/tree-tables/closure-table/custom-primary-column/custom-primary-column.test.ts 🧪 Tests +3/-3

Rename describe block and fix import paths

test/functional/tree-tables/closure-table/custom-primary-column/custom-primary-column.test.ts


12. test/functional/tree-tables/closure-table/custom-primary-column/entity/Category.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/closure-table/custom-primary-column/entity/Category.ts


13. test/functional/tree-tables/closure-table/entity/Category.ts Miscellaneous +0/-25

Remove old Category entity from root directory

test/functional/tree-tables/closure-table/entity/Category.ts


14. test/functional/tree-tables/closure-table/insert-without-level-column/entity/Category.ts 🧪 Tests +22/-0

Create new Category entity for insert without level column

test/functional/tree-tables/closure-table/insert-without-level-column/entity/Category.ts


15. test/functional/tree-tables/closure-table/insert-without-level-column/insert-without-level-column.test.ts 🧪 Tests +3/-3

Rename describe block from issue number to feature breadcrumb

test/functional/tree-tables/closure-table/insert-without-level-column/insert-without-level-column.test.ts


16. test/functional/tree-tables/closure-table/relation-id-property/entity/file.entity.ts ⚙️ Configuration changes +2/-2

Update import paths for nested directory structure

test/functional/tree-tables/closure-table/relation-id-property/entity/file.entity.ts


17. test/functional/tree-tables/closure-table/relation-id-property/relation-id-property.test.ts 🧪 Tests +4/-4

Rename describe block from issue number to feature breadcrumb

test/functional/tree-tables/closure-table/relation-id-property/relation-id-property.test.ts


18. test/functional/tree-tables/closure-table/uuid-primary-key/entity-3783/Category.ts 🧪 Tests +22/-0

Create new Category entity for UUID cascade test

test/functional/tree-tables/closure-table/uuid-primary-key/entity-3783/Category.ts


19. test/functional/tree-tables/closure-table/uuid-primary-key/entity/Group.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/closure-table/uuid-primary-key/entity/Group.ts


20. test/functional/tree-tables/closure-table/uuid-primary-key/uuid-cascade.test.ts 🧪 Tests +5/-5

Rename describe block and update entity import path

test/functional/tree-tables/closure-table/uuid-primary-key/uuid-cascade.test.ts


21. test/functional/tree-tables/closure-table/uuid-primary-key/uuid-primary-key.test.ts 🧪 Tests +3/-3

Rename describe block from issue number to feature breadcrumb

test/functional/tree-tables/closure-table/uuid-primary-key/uuid-primary-key.test.ts


22. test/functional/tree-tables/materialized-path/basic/entity/Category.ts 🧪 Tests +29/-0

Create new Category entity for basic materialized-path tests

test/functional/tree-tables/materialized-path/basic/entity/Category.ts


23. test/functional/tree-tables/materialized-path/basic/entity/Product.ts 🧪 Tests +19/-0

Create new Product entity for basic materialized-path tests

test/functional/tree-tables/materialized-path/basic/entity/Product.ts


24. test/functional/tree-tables/materialized-path/basic/materialized-path.test.ts ⚙️ Configuration changes +2/-2

Update import paths for nested directory structure

test/functional/tree-tables/materialized-path/basic/materialized-path.test.ts


25. test/functional/tree-tables/materialized-path/custom-join-column/custom-join-column.test.ts 🧪 Tests +3/-3

Rename describe block from issue number to feature breadcrumb

test/functional/tree-tables/materialized-path/custom-join-column/custom-join-column.test.ts


26. test/functional/tree-tables/materialized-path/custom-join-column/entity-9534/Category.ts ⚙️ Configuration changes +7/-7

Update import paths for nested directory structure

test/functional/tree-tables/materialized-path/custom-join-column/entity-9534/Category.ts


27. test/functional/tree-tables/materialized-path/custom-join-column/entity/Category.ts 🧪 Tests +29/-0

Create new Category entity for custom join column tests

test/functional/tree-tables/materialized-path/custom-join-column/entity/Category.ts


28. test/functional/tree-tables/materialized-path/custom-join-column/non-pk-parent-column.test.ts 🧪 Tests +4/-4

Rename describe block and update entity import path

test/functional/tree-tables/materialized-path/custom-join-column/non-pk-parent-column.test.ts


29. test/functional/tree-tables/materialized-path/custom-primary-column/custom-primary-column.test.ts 🧪 Tests +3/-3

Rename describe block and fix import paths

test/functional/tree-tables/materialized-path/custom-primary-column/custom-primary-column.test.ts


30. test/functional/tree-tables/materialized-path/custom-primary-column/entity/Category.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/materialized-path/custom-primary-column/entity/Category.ts


31. test/functional/tree-tables/materialized-path/embedded-primary-column/embedded-primary-column.test.ts 🧪 Tests +3/-3

Rename describe block from issue number to feature breadcrumb

test/functional/tree-tables/materialized-path/embedded-primary-column/embedded-primary-column.test.ts


32. test/functional/tree-tables/materialized-path/embedded-primary-column/entity/Category.ts ⚙️ Configuration changes +7/-1

Update import paths for nested directory structure

test/functional/tree-tables/materialized-path/embedded-primary-column/entity/Category.ts


33. test/functional/tree-tables/materialized-path/embedded-primary-column/entity/Slug.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/materialized-path/embedded-primary-column/entity/Slug.ts


34. test/functional/tree-tables/materialized-path/entity/Category.ts Miscellaneous +0/-29

Remove old Category entity from root directory

test/functional/tree-tables/materialized-path/entity/Category.ts


35. test/functional/tree-tables/materialized-path/entity/Product.ts Miscellaneous +0/-19

Remove old Product entity from root directory

test/functional/tree-tables/materialized-path/entity/Product.ts


36. test/functional/tree-tables/materialized-path/find-descendants-missing-parent/entity/category.entity.ts ⚙️ Configuration changes +2/-2

Update import paths for nested directory structure

test/functional/tree-tables/materialized-path/find-descendants-missing-parent/entity/category.entity.ts


37. test/functional/tree-tables/materialized-path/find-descendants-missing-parent/find-descendants-missing-parent.test.ts 🧪 Tests +4/-4

Rename describe block from issue number to feature breadcrumb

test/functional/tree-tables/materialized-path/find-descendants-missing-parent/find-descendants-missing-parent.test.ts


38. test/functional/tree-tables/materialized-path/query-strategy-relations/entity/Fact.ts 🧪 Tests +6/-10

Clean up entity properties and update import paths

test/functional/tree-tables/materialized-path/query-strategy-relations/entity/Fact.ts


39. test/functional/tree-tables/materialized-path/query-strategy-relations/entity/Node.ts 🧪 Tests +32/-0

Create new Node entity for query strategy relations test

test/functional/tree-tables/materialized-path/query-strategy-relations/entity/Node.ts


40. test/functional/tree-tables/materialized-path/query-strategy-relations/entity/Rule.ts 🧪 Tests +23/-0

Create new Rule entity for query strategy relations test

test/functional/tree-tables/materialized-path/query-strategy-relations/entity/Rule.ts


41. test/functional/tree-tables/materialized-path/query-strategy-relations/query-strategy-relations.test.ts 🧪 Tests +115/-0

Create new test for query strategy relations with e2e assertions

test/functional/tree-tables/materialized-path/query-strategy-relations/query-strategy-relations.test.ts


42. test/functional/tree-tables/materialized-path/query-with-relations/all-tree-queries-with-relations.test.ts 🧪 Tests +6/-6

Rename describe block and update entity import paths

test/functional/tree-tables/materialized-path/query-with-relations/all-tree-queries-with-relations.test.ts


43. test/functional/tree-tables/materialized-path/query-with-relations/entity-8076/Category.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/materialized-path/query-with-relations/entity-8076/Category.ts


44. test/functional/tree-tables/materialized-path/query-with-relations/entity-8076/Member.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/materialized-path/query-with-relations/entity-8076/Member.ts


45. test/functional/tree-tables/materialized-path/query-with-relations/entity-8076/Site.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/materialized-path/query-with-relations/entity-8076/Site.ts


46. test/functional/tree-tables/materialized-path/query-with-relations/entity/Category.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/materialized-path/query-with-relations/entity/Category.ts


47. test/functional/tree-tables/materialized-path/query-with-relations/entity/Site.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/materialized-path/query-with-relations/entity/Site.ts


48. test/functional/tree-tables/materialized-path/query-with-relations/find-trees-with-relations.test.ts 🧪 Tests +3/-3

Rename describe block from issue number to feature breadcrumb

test/functional/tree-tables/materialized-path/query-with-relations/find-trees-with-relations.test.ts


49. test/functional/tree-tables/materialized-path/soft-delete-parent/entity/node.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/materialized-path/soft-delete-parent/entity/node.ts


50. test/functional/tree-tables/materialized-path/soft-delete-parent/soft-delete-parent.test.ts 🧪 Tests +3/-3

Rename describe block from issue number to feature breadcrumb

test/functional/tree-tables/materialized-path/soft-delete-parent/soft-delete-parent.test.ts


51. test/functional/tree-tables/nested-set/basic/entity/Category.ts 🧪 Tests +25/-0

Create new Category entity for basic nested-set tests

test/functional/tree-tables/nested-set/basic/entity/Category.ts


52. test/functional/tree-tables/nested-set/basic/nested-set.test.ts ⚙️ Configuration changes +3/-3

Update import paths for nested directory structure

test/functional/tree-tables/nested-set/basic/nested-set.test.ts


53. test/functional/tree-tables/nested-set/custom-join-column/custom-join-column.test.ts 🧪 Tests +4/-4

Rename describe block from issue number to feature breadcrumb

test/functional/tree-tables/nested-set/custom-join-column/custom-join-column.test.ts


54. test/functional/tree-tables/nested-set/custom-join-column/entity/Category.ts 🧪 Tests +29/-0

Create new Category entity for custom join column tests

test/functional/tree-tables/nested-set/custom-join-column/entity/Category.ts


55. test/functional/tree-tables/nested-set/entity/Category.ts Miscellaneous +0/-25

Remove old Category entity from root directory

test/functional/tree-tables/nested-set/entity/Category.ts


56. test/functional/tree-tables/update-remove/entity/RelationEntities.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/update-remove/entity/RelationEntities.ts


57. test/functional/tree-tables/update-remove/entity/RemainingTreeEntities.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/update-remove/entity/RemainingTreeEntities.ts


58. test/functional/tree-tables/update-remove/entity/SqlServerTreeEntities.ts ⚙️ Configuration changes +1/-1

Update import paths for nested directory structure

test/functional/tree-tables/update-remove/entity/SqlServerTreeEntities.ts


59. test/functional/tree-tables/update-remove/update-remove.test.ts 🧪 Tests +5/-5

Rename describe blocks from issue numbers to feature breadcrumbs

test/functional/tree-tables/update-remove/update-remove.test.ts


60. test/github-issues/3783/entity/Category.ts Miscellaneous +0/-22

Remove old Category entity moved to tree-tables

test/github-issues/3783/entity/Category.ts


61. test/github-issues/8443/closure-table/entity/Category.ts Miscellaneous +0/-29

Remove old Category entity moved to tree-tables

test/github-issues/8443/closure-table/entity/Category.ts


62. test/github-issues/8443/materialized-path/entity/Category.ts Miscellaneous +0/-29

Remove old Category entity moved to tree-tables

test/github-issues/8443/materialized-path/entity/Category.ts


63. test/github-issues/8443/nested-set/entity/Category.ts Miscellaneous +0/-29

Remove old Category entity moved to tree-tables

test/github-issues/8443/nested-set/entity/Category.ts


64. test/github-issues/904/entity/Category.ts Miscellaneous +0/-22

Remove old Category entity moved to tree-tables

test/github-issues/904/entity/Category.ts


65. test/github-issues/9673/entity/Node.ts Miscellaneous +0/-44

Remove old Node entity moved to tree-tables

test/github-issues/9673/entity/Node.ts


66. test/github-issues/9673/entity/Rule.ts Miscellaneous +0/-32

Remove old Rule entity moved to tree-tables

test/github-issues/9673/entity/Rule.ts


67. test/github-issues/9673/issue-9673.test.ts Miscellaneous +0/-70

Remove old test moved to tree-tables with improvements

test/github-issues/9673/issue-9673.test.ts


Grey Divider

Qodo Logo

@gioboa
gioboa enabled auto-merge (squash) March 24, 2026 10:40
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Mar 24, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (1) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider


Action required

1. Commented TreeLevelColumn leftovers 📘 Rule violation ⚙ Maintainability
Description
New entity file includes commented-out decorator/property (@TreeLevelColumn), which adds
unnecessary noise to the test suite. This violates the requirement to avoid extra AI-like/commented
code and keep style consistent.
Code

test/functional/tree-tables/closure-table/basic/entity/Category.ts[R23-24]

+    // @TreeLevelColumn()
+    // level: number;
Evidence
PR Compliance ID 4 forbids adding extra comments/noise; this PR adds commented-out code (`//
@TreeLevelColumn() / // level: number;`) in a newly introduced entity file.

Rule 4: Remove AI-generated noise
test/functional/tree-tables/closure-table/basic/entity/Category.ts[23-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Commented-out `@TreeLevelColumn` / `level` lines were added to new entity files, adding unnecessary noise.
## Issue Context
Compliance requires avoiding extra comments and AI-like noise in changes.
## Fix Focus Areas
- test/functional/tree-tables/closure-table/basic/entity/Category.ts[23-24]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. UUID id typed number 🐞 Bug ✓ Correctness
Description
A new entity uses @PrimaryGeneratedColumn("uuid") but declares the id field as number, which
contradicts the runtime UUID string value and breaks type safety for code that uses this entity.
Code

test/functional/tree-tables/closure-table/uuid-primary-key/entity-3783/Category.ts[R11-13]

+    @PrimaryGeneratedColumn("uuid")
+    id: number
+
Evidence
In the PR-added entity, the UUID generation strategy is explicitly requested, but the property type
is declared as number. Elsewhere in the repository, UUID primary generated columns are typed as
string (e.g. functional repository returning User entity). This mismatch can lead to incorrect
comparisons/assumptions and TypeScript allowing numeric operations on what is actually a string at
runtime.

test/functional/tree-tables/closure-table/uuid-primary-key/entity-3783/Category.ts[10-16]
test/functional/repository/returning/entity/User.ts[3-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`@PrimaryGeneratedColumn("uuid")` produces a UUID **string** at runtime, but the new test entity declares `id: number`, creating a type/value mismatch.
### Issue Context
This entity is used in tree-table tests (closure-table UUID cascade). Incorrect typing can make tests brittle and can hide real regressions by allowing invalid numeric usage of the id.
### Fix Focus Areas
- test/functional/tree-tables/closure-table/uuid-primary-key/entity-3783/Category.ts[10-16]
### Expected change
- Change `id: number` to `id: string` for the UUID primary key entity.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Misleading OneToMany onDelete 🐞 Bug ⚙ Maintainability ⭐ New
Description
A @OneToMany relation is configured with onDelete, but onDelete applies to the owning side’s foreign
key and is not enforced by the inverse OneToMany side, so the mapping suggests behavior it cannot
guarantee.
Code

test/functional/tree-tables/materialized-path/query-strategy-relations/entity/Node.ts[R21-25]

+    @OneToMany(() => Rule, (rule) => rule.node, {
+        cascade: true,
+        onDelete: "CASCADE",
+    })
+    rules: Rule[]
Evidence
In this repo the OneToMany decorator accepts RelationOptions, but OneToMany is the inverse side and
does not own the FK. The owning side here is Rule.node (@ManyToOne), and that is where onDelete
belongs if you intend DB-level cascade. As written, onDelete: "CASCADE" on Node.rules is at best
ignored and at worst misleading for future maintenance of the test/entity.

test/functional/tree-tables/materialized-path/query-strategy-relations/entity/Node.ts[21-25]
src/decorator/relations/OneToMany.ts[14-49]
test/functional/tree-tables/materialized-path/query-strategy-relations/entity/Rule.ts[20-23]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`onDelete: "CASCADE"` is set on the inverse `@OneToMany` side (`Node.rules`), but the foreign key is owned by `Rule.node` (`@ManyToOne`).

### Issue Context
DB-level `ON DELETE` behavior is defined on the owning side’s FK (the ManyToOne join column). Keeping `onDelete` on OneToMany suggests behavior that may not happen.

### Fix Focus Areas
- test/functional/tree-tables/materialized-path/query-strategy-relations/entity/Node.ts[21-25]
- test/functional/tree-tables/materialized-path/query-strategy-relations/entity/Rule.ts[20-23]

### Suggested change
Either:
1) Remove `onDelete` from `Node.rules`, or
2) Add `{ onDelete: "CASCADE" }` to `@ManyToOne(() => Node, (node) => node.rules, { onDelete: "CASCADE" })` on `Rule.node` (and remove it from OneToMany).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Grey Divider

Previous review results

Review updated until commit a98745f

Results up to commit 3c6c62b


🐞 Bugs (1) 📘 Rule violations (1) 📎 Requirement gaps (0) 📐 Spec deviations (0)

Grey Divider
Action required
1. Commented TreeLevelColumn leftovers 📘 Rule violation ⚙ Maintainability
Description
New entity file includes commented-out decorator/property (@TreeLevelColumn), which adds
unnecessary noise to the test suite. This violates the requirement to avoid extra AI-like/commented
code and keep style consistent.
Code

test/functional/tree-tables/closure-table/basic/entity/Category.ts[R23-24]

+    // @TreeLevelColumn()
+    // level: number;
Evidence
PR Compliance ID 4 forbids adding extra comments/noise; this PR adds commented-out code (`//
@TreeLevelColumn() / // level: number;`) in a newly introduced entity file.

Rule 4: Remove AI-generated noise
test/functional/tree-tables/closure-table/basic/entity/Category.ts[23-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Commented-out `@TreeLevelColumn` / `level` lines were added to new entity files, adding unnecessary noise.

## Issue Context
Compliance requires avoiding extra comments and AI-like noise in changes.

## Fix Focus Areas
- test/functional/tree-tables/closure-table/basic/entity/Category.ts[23-24]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. UUID id typed number 🐞 Bug ✓ Correctness
Description
A new entity uses @PrimaryGeneratedColumn("uuid") but declares the id field as number, which
contradicts the runtime UUID string value and breaks type safety for code that uses this entity.
Code

test/functional/tree-tables/closure-table/uuid-primary-key/entity-3783/Category.ts[R11-13]

+    @PrimaryGeneratedColumn("uuid")
+    id: number
+
Evidence
In the PR-added entity, the UUID generation strategy is explicitly requested, but the property type
is declared as number. Elsewhere in the repository, UUID primary generated columns are typed as
string (e.g. functional repository returning User entity). This mismatch can lead to incorrect
comparisons/assumptions and TypeScript allowing numeric operations on what is actually a string at
runtime.

test/functional/tree-tables/closure-table/uuid-primary-key/entity-3783/Category.ts[10-16]
test/functional/repository/returning/entity/User.ts[3-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`@PrimaryGeneratedColumn("uuid")` produces a UUID **string** at runtime, but the new test entity declares `id: number`, creating a type/value mismatch.

### Issue Context
This entity is used in tree-table tests (closure-table UUID cascade). Incorrect typing can make tests brittle and can hide real regressions by allowing invalid numeric usage of the id.

### Fix Focus Areas
- test/functional/tree-tables/closure-table/uuid-primary-key/entity-3783/Category.ts[10-16]

### Expected change
- Change `id: number` to `id: string` for the UUID primary key entity.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider Grey Divider

Qodo Logo

@sonarqubecloud

Copy link
Copy Markdown

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Persistent review updated to latest commit a98745f

@gioboa
gioboa merged commit a746e48 into master Mar 24, 2026
41 checks passed
@gioboa
gioboa deleted the fix/tree-query-strategy-eager branch March 24, 2026 11:10
@github-actions github-actions Bot added this to the 1.0 milestone Mar 24, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 73.428% (+0.05%) from 73.378%
when pulling a98745f on fix/tree-query-strategy-eager
into 3f4d2b5 on master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants