Skip to content

Upgrade to Node 24 and modernize Pub/Sub dependencies and tooling - #51

Draft
vikram-ecobee wants to merge 5 commits into
masterfrom
vikram-ecobee-node-22-upgrade
Draft

vikram-ecobee wants to merge 5 commits into
masterfrom
vikram-ecobee-node-22-upgrade

Conversation

@vikram-ecobee

@vikram-ecobee vikram-ecobee commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Require Node.js 24+ and use Node 24 for all GitHub Actions jobs.
  • Upgrade Google Cloud Pub/Sub to 6.3, NestJS development dependencies to 11.2.7, TypeScript to 5.9, and Node type definitions to v24; extend NestJS peer ranges through v11.
  • Replace deprecated Topic.publish() with Topic.publishMessage({ data, attributes }), preserving the public API.
  • Replace snapshots with individual, explicit assertions for bytes, encodings, attributes, options, returned message IDs, and publishing errors.
  • Upgrade Jest to v30, jest-junit to v17, and Husky to v9; migrate the pre-commit hook and update CI report settings.
  • Apply compatible audit fixes, remove unused legacy type dependencies, and stop formatting source files during dependency installation.
  • Preserve the GitHub Actions migration and add Vikram to the authors list.
  • Bump the release version to 0.9.0 in package.json and package-lock.json; confirmed it is not currently published on public npm.

Validation

  • Clean npm ci and package build pass on Node 24.20.0.
  • CI tests pass: 23 tests, no snapshots.
  • JUnit report generated at reports/jest/results.xml.
  • Repository formatter and git diff --check pass.
  • Production dependency audit reports zero vulnerabilities.

Remaining considerations

  • Full npm audit reports 20 moderate findings tracing to the sprintf-js chain in Jest's coverage tooling. The suggested forced ts-jest downgrade was intentionally not applied.
  • NestJS 12 is ESM-only; NestJS 11 preserves the existing CommonJS/Jest setup.
  • Minimum Node version changes to 24.

vikram-ecobee and others added 2 commits October 20, 2026 11:14
Update NestJS and Google Cloud Pub/Sub dependencies, migrate publishing to the supported API, replace snapshots with focused assertions, and refresh Jest and Husky tooling.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the package dependencies, upgrading NestJS to version 11, @google-cloud/pubsub to version 6, and targeting ES2022. It also refactors the server tests to use fake timers instead of snapshots and migrates the publishing logic to use publishMessage. Feedback on these changes highlights that the newly added private eventEmitter and custom on method in GCloudPubSubServer are redundant and break the base Server class's event contract. Additionally, the unwrap method should return the underlying PubSub client (this.client) instead of this.subscriptions to conform to NestJS microservice conventions.

Comment thread src/microservice/gcloud-pub-sub.server.ts Outdated
Comment thread src/microservice/gcloud-pub-sub.server.ts
Comment thread src/microservice/gcloud-pub-sub.server.ts Outdated
Comment thread src/microservice/gcloud-pub-sub.server.ts
@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (3a663b7) to head (d840f46).

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #51   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines           82       120   +38     
  Branches         9        17    +8     
=========================================
+ Hits            82       120   +38     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

vikram-ecobee and others added 3 commits October 20, 2026 11:20
Forward listeners to subscriptions instead of an unused emitter and expose the initialized Pub/Sub client through unwrap. Add regression coverage for both registration orders and client access.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Exercise sync and async registration, custom and default options, injected dependencies, useClass/useExisting, and factory failures. Include untested production files in coverage and forward async module imports to fix the uncovered dependency resolution bug.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Enable source maps and inline sources in the ts-jest transform so coverage maps to original TypeScript instead of generated decorator helpers. Production compiler output is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

1 participant