Conversation
WalkthroughAdds a new npm script to start a mock OAuth2 server, updates OpenAPI docs to use the origin-only server URL (no version in path), and updates functional tests to clear cache keys for BalancesService#getFullBalance instead of WalletController#getBalances. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
apps/api/package.json (1)
34-34: Add a matching teardown convenience script for the mock OAuth2 server.This helps avoid leaving containers running locally and mirrors the existing CI setup.
You could add:
"test:functional:watch": "npm run test:functional -- --watch", - "test:oauth2-server": "dc up:dev -d mock-oauth2-server", + "test:oauth2-server": "dc up:dev -d mock-oauth2-server", + "test:oauth2-server:down": "dc down", "test:unit": "jest --selectProjects unit",Confirm that the
dcalias exists in local dev environments (it’s already used elsewhere) and thatmock-oauth2-servermatches the Compose service name.apps/api/test/functional/lease-flow.spec.ts (1)
159-159: Use explicit prefix clearing for getFullBalance cache
clearCache("BalancesService#getFullBalance")only clears the exact key (which includes the address suffix), so it’s a no-op on cold cache. Change all three calls in lease-flow.spec.ts (lines 159, 218, 262) to:- clearCache("BalancesService#getFullBalance"); + clearCache("BalancesService#getFullBalance*");
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
apps/api/test/functional/__snapshots__/docs.spec.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (3)
apps/api/package.json(1 hunks)apps/api/src/core/services/openapi-docs/openapi-docs.service.ts(1 hunks)apps/api/test/functional/lease-flow.spec.ts(3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
Never use type any or cast to type any. Always define the proper TypeScript types.
Files:
apps/api/src/core/services/openapi-docs/openapi-docs.service.tsapps/api/test/functional/lease-flow.spec.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/general.mdc)
**/*.{js,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code
Files:
apps/api/src/core/services/openapi-docs/openapi-docs.service.tsapps/api/test/functional/lease-flow.spec.ts
**/*.spec.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/no-jest-mock.mdc)
Don't use
jest.mock()to mock dependencies in test files. Instead, usejest-mock-extendedto create mocks and pass mocks as dependencies to the service under test.
**/*.spec.{ts,tsx}: Usesetupfunction instead ofbeforeEachin test files
setupfunction must be at the bottom of the rootdescribeblock in test files
setupfunction creates an object under test and returns it
setupfunction should accept a single parameter with inline type definition
Don't use shared state insetupfunction
Don't specify return type ofsetupfunction
Files:
apps/api/test/functional/lease-flow.spec.ts
🧬 Code graph analysis (1)
apps/api/test/functional/lease-flow.spec.ts (1)
apps/api/test/setup-functional-tests.ts (1)
clearCache(13-31)
⏰ 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). (2)
- GitHub Check: validate / validate-app
- GitHub Check: test-build
🔇 Additional comments (1)
apps/api/src/core/services/openapi-docs/openapi-docs.service.ts (1)
13-13: Confirmed: all OpenAPI handler paths include/v1, so omitting/v1fromservers.urlis safe.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1890 +/- ##
==========================================
- Coverage 44.40% 44.09% -0.32%
==========================================
Files 970 963 -7
Lines 27293 27000 -293
Branches 7041 7017 -24
==========================================
- Hits 12119 11905 -214
+ Misses 13985 13915 -70
+ Partials 1189 1180 -9
*This pull request uses carry forward flags. Click here to find out more.
🚀 New features to boost your workflow:
|
* fix(config): remove duplicate version from swagger docs * fix(config): lease flow test + swagger docs
Summary by CodeRabbit
Documentation
Chores
Tests