Skip to content

fix(dx): pin root dependency versions (#210) - #236

Merged
yash-pouranik merged 4 commits into
geturbackend:mainfrom
udaycodespace:fix/dependency-version-ranges-210
May 31, 2026
Merged

fix(dx): pin root dependency versions (#210)#236
yash-pouranik merged 4 commits into
geturbackend:mainfrom
udaycodespace:fix/dependency-version-ranges-210

Conversation

@udaycodespace

@udaycodespace udaycodespace commented May 30, 2026

Copy link
Copy Markdown
Contributor

Related Issue

Closes #210

Summary

Pinned the remaining loose dependency version ranges in the root package.json to exact versions.

Changes

Updated the following root dependencies from caret (^) ranges to exact versions:

  • @aws-sdk/lib-storage
  • concurrently
  • husky
  • lint-staged
  • path

Reason

Issue #210 highlights loose dependency version ranges as a source of potentially non-deterministic installs.

Following your guidance, the fix was limited to the root package.json and corresponding package-lock.json updates while avoiding unnecessary changes in other workspace manifests.

Files Changed

  • package.json
  • package-lock.json

Validation

  • Updated root dependency specifications to exact versions.
  • Ran npm install to refresh package-lock.json.
  • Confirmed only package.json and package-lock.json were modified.

Summary by CodeRabbit

  • Chores

    • Pinned dependency versions across the repository (root and workspace) by switching caret ranges to exact versions for more consistent, reproducible builds.
  • New Features

    • Added a reset mechanism for the public email worker to allow safe cleanup and reinitialization.
  • Tests

    • Updated unit tests to reset the public email worker before initializing it, improving test isolation.

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Multiple package.json files were updated to pin dependency versions (root, packages/common, apps/dashboard-api, apps/public-api). The public email queue module now exposes resetPublicEmailWorker, and two tests were changed to await that reset before initializing the worker.

Changes

Dependency Version Pinning

Layer / File(s) Summary
Root package pins
package.json
Pinned devDependencies for concurrently, husky, lint-staged and dependencies for @aws-sdk/lib-storage, path to exact versions.
Common package pins
packages/common/package.json
All listed dependencies changed from caret ranges to exact version pins; surrounding non-functional lines unaffected.
Dashboard API pins
apps/dashboard-api/package.json
All dependencies and devDependencies entries were converted from caret-prefixed ranges to exact versions.
Public API pins
apps/public-api/package.json
Production dependencies and devDependencies (jest, supertest) were updated from caret ranges to exact pinned versions.

Public email worker reset

Layer / File(s) Summary
Reset implementation & export
packages/common/src/queues/publicEmailQueue.js
Adds resetPublicEmailWorker which best-effort removes listeners, calls close() if present, clears the module worker reference, and adds it to exports.
Tests updated to reset worker
apps/public-api/src/__tests__/mail.controller.test.js
Two quota-refund tests now import and await resetPublicEmailWorker() before calling initPublicEmailWorker() to ensure clean worker state.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • geturbackend/urBackend#157: Adds resetPublicEmailWorker export and updates tests for the public-email-queue worker (closely related).

Suggested labels

backend, intermediete-advance, level-3

Suggested reviewers

  • yash-pouranik

Poem

🐰 I nudged the carets into tidy rows,
I whispered to queues where the cold wind blows.
A reset, a pin, a test that’s polite —
Installs hold steady and workers sleep tight. 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR introduces a new resetPublicEmailWorker function and test updates that were not part of the original issue #210 scope of pinning dependency versions. Remove the resetPublicEmailWorker export, test file changes, and related mail.controller.test.js modifications as they are unrelated to dependency version pinning and should be addressed separately.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: pinning root dependency versions from caret ranges to exact versions.
Linked Issues check ✅ Passed The PR addresses issue #210 by pinning dependency version ranges across all specified files (root, apps/public-api, apps/dashboard-api, packages/common) to exact versions, meeting the core objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

@udaycodespace

Copy link
Copy Markdown
Contributor Author

@yash-pouranik

  1. Followed your guidance and limited the scope to the root package.json.
  2. Pinned the remaining loose dependency ranges in the root manifest and updated package-lock.json accordingly, avoiding broader workspace-wide changes.

@yash-pouranik

yash-pouranik commented May 30, 2026

Copy link
Copy Markdown
Member

alright
Can u do this in these dirs as well??

apps/public-api/package.json
apps/dashboard-api/package.json
packages/common/package.json

@udaycodespace

@udaycodespace

Copy link
Copy Markdown
Contributor Author

alright Can u do this in these dirs as well??

apps/public-api/package.json apps/dashboard-api/package.json packages/common/package.json

@udaycodespace

Hi @yash-pouranik,

I'm currently away from my laptop. I can take this up tonight and update the dependency versions in:

  • apps/public-api/package.json
  • apps/dashboard-api/package.json
  • packages/common/package.json

I'll push the changes once I'm back and have verified everything locally.

@yash-pouranik

Copy link
Copy Markdown
Member

yh no worries.

@udaycodespace
udaycodespace force-pushed the fix/dependency-version-ranges-210 branch from d2715f3 to e511d6e Compare May 30, 2026 16:41

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
apps/public-api/package.json (1)

19-19: ⚡ Quick win

Use a workspace-aware/versioned spec for @urbackend/common in apps/public-api
apps/public-api/package.json still uses "@urbackend/common": "*" (even though package-lock.json resolves it as a local workspace link to packages/common); switch to workspace:* or pin to the workspace version (currently 0.10.0) for explicit, deterministic intent.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/public-api/package.json` at line 19, The dependency entry for
"`@urbackend/common`" in package.json is currently "*" and should be made
workspace-aware or pinned; update the "`@urbackend/common`" value to either
"workspace:*" to explicitly use the local workspace package or to the current
workspace version "0.10.0" to pin it, then run your package manager install to
update lockfiles; modify the dependency string for "`@urbackend/common`" in
apps/public-api's package.json accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/public-api/package.json`:
- Around line 17-18: The package-lock.json is out of sync with the pinned deps
in apps/public-api/package.json (notably "`@kiroo/sdk`" and
"`@supabase/supabase-js`" and the other entries around lines 20-34 and 37-38); to
fix, from the repo root run a clean install to regenerate the lockfile (e.g.,
delete node_modules if needed then run npm install or npm ci as appropriate),
verify package-lock.json now contains the exact resolved versions for those
packages, and commit the updated package-lock.json so CI will pass.

In `@packages/common/package.json`:
- Around line 8-25: The root lockfile is out of sync with the updated
dependencies listed under the packages/common package.json "dependencies" field;
regenerate the root package-lock.json and commit it so CI installs
deterministically. From the repository root run a lockfile update (for example
npm install or npm install --package-lock-only) so the top-level
package-lock.json reflects the new pins, verify the "packages/common" entry in
package-lock.json now matches the package.json dependencies, and commit the
updated package-lock.json.

---

Nitpick comments:
In `@apps/public-api/package.json`:
- Line 19: The dependency entry for "`@urbackend/common`" in package.json is
currently "*" and should be made workspace-aware or pinned; update the
"`@urbackend/common`" value to either "workspace:*" to explicitly use the local
workspace package or to the current workspace version "0.10.0" to pin it, then
run your package manager install to update lockfiles; modify the dependency
string for "`@urbackend/common`" in apps/public-api's package.json accordingly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6eb915c1-da06-4f75-9322-328c2aeca1c0

📥 Commits

Reviewing files that changed from the base of the PR and between d2715f3 and e511d6e.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • apps/dashboard-api/package.json
  • apps/public-api/package.json
  • package.json
  • packages/common/package.json
✅ Files skipped from review due to trivial changes (2)
  • apps/dashboard-api/package.json
  • package.json

Comment thread apps/public-api/package.json
Comment thread packages/common/package.json
@yash-pouranik

Copy link
Copy Markdown
Member

coderabbits comments are still not resolved and public api tests are failing.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/common/src/queues/publicEmailQueue.js`:
- Around line 18-23: Move the removal of worker event handlers so they occur
after the worker has fully closed: do not call worker.removeAllListeners()
before awaiting worker.close(); instead await worker.close() first (keep the
existing 'failed' handler and other listeners attached during close/drain) and
then call worker.removeAllListeners() (or conditional removal) afterward to
ensure the 'failed' handler logic (and quota refunds) can run while the worker
is finishing.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5d1800d8-50db-4205-b38d-21b3d760629f

📥 Commits

Reviewing files that changed from the base of the PR and between e511d6e and 5e55177.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • apps/public-api/package.json
  • apps/public-api/src/__tests__/mail.controller.test.js
  • packages/common/src/queues/publicEmailQueue.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/public-api/package.json

Comment thread packages/common/src/queues/publicEmailQueue.js
@udaycodespace

Copy link
Copy Markdown
Contributor Author

Hi @yash-pouranik,

Done with the requested dependency pinning changes.

One of the CI checks was still failing after the lockfile sync, so I investigated it and applied the minimal fix required to get the public-api tests passing. The related CodeRabbit comments have also been addressed.

@yash-pouranik

Copy link
Copy Markdown
Member

last check, as whole package-lock.json is changed
please do this in ur local repo

  • delete all the node_modules folder
  • run 'npm ci'
  • now check whole system is working as intended or not? by running 'npm run dev' on root
    if all works let me know, then will merge.

@udaycodespace

@udaycodespace

udaycodespace commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

Hi @yash-pouranik,

Done the verification.

  • Deleted all node_modules folders
  • Ran npm ci successfully from a clean state
  • Verified on Node v20.20.2
  • Ran npm run dev from root
  • public-api tests passing (144/144)
Terminal image
  1. No dependency resolution or install issues found.
  2. Current runtime failure is only due to local Redis not running (localhost:6379), not related to the dependency pinning changes.

Looks good from my side.

Note

The only non-dependency files touched in this PR were publicEmailQueue.js and mail.controller.test.js.
These were added as the minimal changes required to fix the failing public-api CI tests after the lockfile/dependency updates.
The public-api test suite now passes successfully (144/144), and the changes were made in response to the failing CI checks and CodeRabbit feedback.

@yash-pouranik

Copy link
Copy Markdown
Member

ok done

@yash-pouranik

Copy link
Copy Markdown
Member

thnk u

@yash-pouranik
yash-pouranik merged commit f2d2f4b into geturbackend:main May 31, 2026
8 checks passed
@udaycodespace

Copy link
Copy Markdown
Contributor Author

@yash-pouranik Sorry to bother you 😅.
Could you add the appropriate labels? GGSoC won't be able to track the contribution otherwise.
Thanks!

@yash-pouranik

Copy link
Copy Markdown
Member

dont worry about that, every night i scroll to all the merged prs and add the needed labels

@udaycodespace

udaycodespace commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

dont worry about that, every night i scroll to all the merged prs and add the needed labels

Got it, thanks for the clarification!

Also, are you planning to work on any new features or improvements in the near future? I'd love to contribute and help out wherever I can.

@yash-pouranik

Copy link
Copy Markdown
Member

Okay listen
@Ayush4958 @Siddh2024 @udaycodespace @MdTowfikomer @Nitin-kumar-yadav1307 @renganathc

I have my exams starting from June 8th, so I won't be able to actively build new features myself for a little while. However, I want the momentum for urBackend to keep going

During this period, I will shift my focus entirely to reviewing PRs and merging your contributions.

To make this work efficiently, I did love for us to operate like a proper engineering team for this month. We can:

Discuss upcoming features & roadmap.
Divide work and assign specific tasks to everyone. (Till 7 June)
Track progress together.
What do you guys say? If you're in, please react with a Thumb to this comment and either DM me on Discord or drop a message in the urBackend Discord server so we can start planning! Let's build something awesome together.

Let me know.

@Siddh2024

Copy link
Copy Markdown
Contributor

Okay listen
@Ayush4958 @Siddh2024 @udaycodespace @MdTowfikomer @Nitin-kumar-yadav1307 @renganathc

I have my exams starting from June 8th, so I won't be able to actively build new features myself for a little while. However, I want the momentum for urBackend to keep going

During this period, I will shift my focus entirely to reviewing PRs and merging your contributions.

To make this work efficiently, I did love for us to operate like a proper engineering team for this month. We can:

Discuss upcoming features & roadmap.
Divide work and assign specific tasks to everyone. (Till 7 June)
Track progress together.
What do you guys say? If you're in, please react with a Thumb to this comment and either DM me on Discord or drop a message in the urBackend Discord server so we can start planning! Let's build something awesome together.

Let me know.

AYE AYE CAPTAIN 🫡🪖.

@udaycodespace

Copy link
Copy Markdown
Contributor Author

Okay listen @Ayush4958 @Siddh2024 @udaycodespace @MdTowfikomer @Nitin-kumar-yadav1307 @renganathc

I have my exams starting from June 8th, so I won't be able to actively build new features myself for a little while. However, I want the momentum for urBackend to keep going

During this period, I will shift my focus entirely to reviewing PRs and merging your contributions.

To make this work efficiently, I did love for us to operate like a proper engineering team for this month. We can:

Discuss upcoming features & roadmap. Divide work and assign specific tasks to everyone. (Till 7 June) Track progress together. What do you guys say? If you're in, please react with a Thumb to this comment and either DM me on Discord or drop a message in the urBackend Discord server so we can start planning! Let's build something awesome together.

Let me know.

👍 I'm in.

Maybe we can have a contributor channel while you're busy with exams so we can discuss ideas, coordinate work, and help new contributors when needed.

Happy to help.

@Nitin-kumar-yadav1307

Copy link
Copy Markdown
Collaborator

Join the discord of urBackend

@Siddh2024

Copy link
Copy Markdown
Contributor

Join the discord of urBackend

Any direct link for that ? Or steps to join in the discord from GSSOC

@yash-pouranik

Copy link
Copy Markdown
Member

Its in readme,

@yash-pouranik

Copy link
Copy Markdown
Member

Exactly
this week we all will decide,
and after 7 june, u all will take ownership
for a month, Lets goooo

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DX] Loose dependency version ranges may cause non-deterministic installs

4 participants