Skip to content

Conversation

@alumni
Copy link
Collaborator

@alumni alumni commented Sep 19, 2025

Description of change

Updating all dependencies without breaking changes.

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
  • Documentation has been updated to reflect this change

Summary by CodeRabbit

  • Bug Fixes

    • Improved reliability when dropping SQL Server tables during cleanup.
  • Chores

    • Updated dependencies across the project (runtime, dev, and docs).
    • Moved reflect-metadata from peer to direct dependency; removed from sample playground.
    • Adjusted .gitignore to allow tracking of the root TestProject directory.
  • Tests

    • Modernized tests to use async/await patterns and expect-style assertions.
    • Simplified test flows by removing unnecessary Promise.all usage.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 19, 2025

Walkthrough

Dependency version bumps across multiple package.json files, a .gitignore rule removal, async/await refactors in test utilities, adjustments to async control flow in tests, and a minor async mapping fix in the SQL Server query runner.

Changes

Cohort / File(s) Summary
Ignore rules
./.gitignore
Removed comment and /*TestProject ignore pattern, allowing root-level TestProject to be tracked.
Package manifests
./package.json, docs/package.json, sample/playground/package.json
Bumped various dependency/devDependency versions; moved reflect-metadata to dependencies (root) and removed it from peerDeps and sample; no code changes.
SQL Server query runner async mapping
src/driver/sqlserver/SqlServerQueryRunner.ts
Converted map callback to async within Promise.all during table drop loop to ensure promises are awaited for each table operation.
Test async control flow updates
test/functional/columns/virtual-columns/virtual-columns.ts, test/functional/driver/abstract-sqlite/abstract-sqlite-escape-query-parameters.ts, test/github-issues/9189/issue-9189.ts
Replaced Promise.all wrappers with direct iteration where operations are synchronous; switched assertions to chai.expect in SQLite tests; minor style/flow simplifications.
Test utilities async/await refactor
test/utils/test-utils.ts
Made closeTestingConnections and reloadTestingDatabases async; explicitly await Promise.all for per-connection tasks; early returns and optional chaining for safety.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Tester
  participant TestUtils as test/utils/test-utils.ts
  participant DS as DataSource (per-conn)

  Tester->>TestUtils: closeTestingConnections(connections)
  alt no connections
    TestUtils-->>Tester: return
  else has connections
    loop for each connection (async)
      TestUtils->>DS: if (initialized) destroy()
      DS-->>TestUtils: resolved
    end
    TestUtils-->>Tester: return (after await Promise.all)
  end
Loading
sequenceDiagram
  autonumber
  participant Runner as SqlServerQueryRunner
  participant DB as SQL Server

  Runner->>Runner: allTablesResults.map(async ...)
  par per-table async
    alt temp table (#...)
      Runner-->>Runner: skip
    else non-temp table
      Runner->>DB: DROP TABLE [schema].[name]
      DB-->>Runner: OK
    end
  and others...
  end
  Runner-->>Caller: Promise.all resolved
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • gioboa
  • sgarner
  • naorpeled
  • mguida22
  • OSA413

Poem

A bunny taps keys with a rhythmic clack,
Nudging Promises gently to async and back.
Packages hopped, versions aligned,
Temp tables dodged, tests redefined.
With whiskered wisdom and minimal fuss,
The repo now hums—hip hop for us. 🐇✨

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 "chore: update dependencies" succinctly and accurately describes the primary intent of the PR (widespread dependency/version bumps and related chore changes), is concise, and is clear enough for teammates scanning the project history.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch task/update-dependencies

📜 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 797a8f5 and a6f2115.

⛔ Files ignored due to path filters (3)
  • docs/package-lock.json is excluded by !**/package-lock.json
  • package-lock.json is excluded by !**/package-lock.json
  • sample/playground/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • .gitignore (0 hunks)
  • docs/package.json (2 hunks)
  • package.json (2 hunks)
  • sample/playground/package.json (1 hunks)
  • src/driver/sqlserver/SqlServerQueryRunner.ts (1 hunks)
  • test/functional/columns/virtual-columns/virtual-columns.ts (1 hunks)
  • test/functional/driver/abstract-sqlite/abstract-sqlite-escape-query-parameters.ts (2 hunks)
  • test/github-issues/9189/issue-9189.ts (1 hunks)
  • test/utils/test-utils.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • .gitignore
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-07-27T17:29:18.547Z
Learnt from: alumni
PR: typeorm/typeorm#11581
File: docs/docs/drivers/mongodb.md:9-13
Timestamp: 2025-07-27T17:29:18.547Z
Learning: TypeORM is compatible only with mongodb@^6, not v4 as previously suggested. The package.json file contains the authoritative peer dependency information for the MongoDB driver version compatibility.

Applied to files:

  • sample/playground/package.json
🧬 Code graph analysis (2)
test/github-issues/9189/issue-9189.ts (1)
test/utils/test-utils.ts (1)
  • createTestingConnections (388-482)
test/utils/test-utils.ts (1)
src/data-source/DataSource.ts (1)
  • DataSource (56-789)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: tests-linux (20) / sqljs
  • GitHub Check: tests-linux (20) / mssql
  • GitHub Check: tests-linux (20) / mysql_mariadb_latest
  • GitHub Check: tests-linux (20) / better-sqlite3
  • GitHub Check: tests-linux (18) / sap
  • GitHub Check: tests-linux (20) / mongodb
  • GitHub Check: tests-linux (20) / cockroachdb
  • GitHub Check: tests-linux (18) / oracle
🔇 Additional comments (11)
sample/playground/package.json (1)

17-17: LGTM! Dependency updates align with repository-wide version standardization.

The updates to @types/node (^20.19.0 → ^22.18.6) and typescript (^5.8.3 → ^5.9.2) are consistent with the broader PR's dependency management goals and the removal of reflect-metadata from this package.json aligns with it being moved to the root dependencies.

Also applies to: 19-19

docs/package.json (1)

33-33: LGTM! Minor version updates are appropriate.

The updates to @mdx-js/react (^3.1.0 → ^3.1.1) and typescript (~5.8.3 → ~5.9.2) are consistent with the repository-wide TypeScript upgrade pattern seen across the PR.

Also applies to: 45-45

src/driver/sqlserver/SqlServerQueryRunner.ts (1)

2720-2720: LGTM! Async callback correctly handles Promise return values.

The change from allTablesResults.map((tablesResult) => { to allTablesResults.map(async (tablesResult) => { is correct since the callback now needs to handle the return this.query(dropTableSql) which returns a Promise. This ensures proper async handling within the Promise.all context.

test/functional/driver/abstract-sqlite/abstract-sqlite-escape-query-parameters.ts (2)

1-1: LGTM! Adding chai import for expect assertions.

The addition of expect from chai is necessary for the updated assertion style used throughout the test file.


22-30: LGTM! Refactored assertions improve test clarity.

The changes from Promise.all(connections.map(...)) to connections.map(...) and from should-style assertions to expect(...).to.deep.equal(...) are appropriate improvements:

  1. Since escapeQueryWithParameters is synchronous, removing the Promise.all wrapper is correct
  2. The chai expect syntax with deep.equal is more explicit and readable than should-style assertions
  3. The expected parameter transformations ([1], [0], [1], [0]) correctly verify boolean to integer conversion

Also applies to: 32-41, 43-52, 54-63

package.json (2)

115-168: LGTM! DevDependency updates follow appropriate version constraints.

The devDependency updates are substantial but follow semantic versioning appropriately. Notable updates include:

  • TypeScript 5.8.3 → 5.9.2 (minor version, should be backward compatible)
  • MongoDB driver 6.15.0 → 6.20.0 (compatible with the existing peer dependency range)
  • Mocha 10.8.2 → 11.7.2 (major version, but test frameworks often have fewer breaking changes)

The type definition downgrades (e.g., @types/sinon-chai 4.0.0 → 3.2.12) suggest alignment with actual package versions being used.


99-107: Approve dependency changes — ansis v4 and reflect-metadata move are safe.

  • ansis: imported in PlatformTools and command files (PlatformTools.ts, SchemaLogCommand.ts, SchemaSyncCommand.ts, MigrationGenerateCommand.ts, MigrationCreateCommand.ts, InitCommand.ts, EntityCreateCommand.ts, QueryCommand.ts, CacheClearCommand.ts, SchemaDropCommand.ts, SubscriberCreateCommand.ts). Usages (underline, gray, red, yellow, blue, white, green, tagged-template usage) do not use removed/renamed aliases (.strike, .grey, .ansi256, .blackBright, .bgGrey, .bgBlackBright).
  • reflect-metadata: present in dependencies ("^0.2.2" in package.json) and imported by src/index.ts and src/cli.ts — keeping it as a dependency is correct.
test/utils/test-utils.ts (2)

487-499: LGTM! Async function signature improves error handling.

Converting closeTestingConnections to async with proper Promise.all usage ensures that all connection closures are properly awaited and any errors are properly propagated. The optional chaining (connection?.isInitialized) is a good defensive programming practice.


504-509: LGTM! Async function signature maintains proper sequencing.

Converting reloadTestingDatabases to async ensures that all database synchronizations complete before the function returns. The await Promise.all() preserves concurrent execution while ensuring proper error propagation.

test/github-issues/9189/issue-9189.ts (1)

17-22: LGTM! Simplified async assignment pattern.

The change from wrapping createTestingConnections in Promise.all to direct assignment is correct since createTestingConnections already returns a Promise<DataSource[]>. This simplification improves code readability while maintaining the same functional behavior.

test/functional/columns/virtual-columns/virtual-columns.ts (1)

70-71: Verify that the refactored connection mapping maintains test correctness.

The change from Promise.all(connections.map(async (connection) => { ... })) to connections.map((connection) => { ... }) removes the asynchronous aggregation. Since these tests are performing synchronous SQL generation and assertions (via getSql()), this change is functionally correct. However, it's important to verify that removing the Promise.all wrapper doesn't affect test execution behavior.

Also applies to: 91-92, 125-126


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.

@alumni alumni requested a review from gioboa September 19, 2025 15:58
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.

That's great 👏 Thanks @alumni

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 19, 2025

typeorm-sql-js-example

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

commit: a6f2115

@alumni alumni marked this pull request as ready for review September 19, 2025 16:09
@alumni alumni merged commit c16ef63 into master Sep 19, 2025
67 checks passed
@alumni alumni deleted the task/update-dependencies branch September 19, 2025 16:34
@coveralls
Copy link

Coverage Status

coverage: 76.427% (+0.03%) from 76.397%
when pulling a6f2115 on task/update-dependencies
into 797a8f5 on master.

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.

5 participants