-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(ids-api): Remove unused code. #16724
Conversation
WalkthroughThe pull request introduces significant changes to the delegation handling within the application. The Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
apps/services/auth/ids-api/src/app/delegations/delegations.controller.ts (2)
Line range hint
55-67
: Consider enhancing error logging for indexing failures.The implementation looks good with proper error handling for indexing failures. However, the error logging could be more detailed.
Consider adding more context to the error log:
- this.logger.error('Failed to index delegations') + this.logger.error('Failed to index delegations', { + userId: user.nationalId, + error: error instanceof Error ? error.message : 'Unknown error' + })
Line range hint
84-90
: Track TODO comment for backwards compatibility.The TODO comment indicates technical debt for backwards compatibility with IDS. This should be tracked and addressed in a future update.
Would you like me to create a GitHub issue to track this technical debt? The issue would include:
- Current implementation details
- Impact of the backwards compatibility
- Steps needed to remove the PersonalRepresentative:postholf type
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
apps/services/auth/ids-api/src/app/delegations/delegations.controller.ts
(1 hunks)libs/auth-api-lib/src/lib/delegations/delegations.service.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
apps/services/auth/ids-api/src/app/delegations/delegations.controller.ts (2)
Pattern apps/services/**/*
: "Confirm that the code adheres to the following:
- NestJS architecture, including modules, services, and controllers.
- Dependency injection patterns and service encapsulation.
- Integration and unit testing coverage and practices."
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
libs/auth-api-lib/src/lib/delegations/delegations.service.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
🔇 Additional comments (2)
apps/services/auth/ids-api/src/app/delegations/delegations.controller.ts (2)
Line range hint 1-51
: LGTM! Controller structure follows NestJS best practices.
The controller demonstrates proper:
- Dependency injection with constructor-based injection
- Guard implementation for authentication and scopes
- API documentation with Swagger decorators
- Version control implementation
52-52
: Verify version compatibility with removed findAllToV1.
The version array includes '1' which might cause confusion since findAllToV1 was removed. Consider documenting the version compatibility or removing version '1' if it's no longer needed.
✅ Verification successful
Version '1' support is correctly maintained
The version array [VERSION_NEUTRAL, '1', '2']
is appropriate as it maintains backward compatibility while consolidating the implementation into a single method. The removal of findAllToV1
is part of this consolidation, where the functionality is now handled by the unified findAllTo
method that supports multiple versions including '1'. This is a common versioning pattern that allows for graceful API evolution.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any remaining v1 references in the codebase
rg -l "findAllToV1|@Version\('1'\)" apps/services/auth/ids-api/
Length of output: 71
Script:
#!/bin/bash
# Search for version-related patterns with broader context
rg -A 5 -B 5 "@Version.*1.*2|findAllToV1" apps/services/auth/ids-api/src/
# Check for any version-related decorators and methods
ast-grep --pattern '@Version($$$)'
# Look for any delegation-related version methods
ast-grep --pattern 'findAllTo($$$) {
$$$
}'
Length of output: 1866
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #16724 +/- ##
==========================================
+ Coverage 36.51% 36.54% +0.02%
==========================================
Files 6890 6890
Lines 143803 143622 -181
Branches 40970 40921 -49
==========================================
- Hits 52511 52485 -26
+ Misses 91292 91137 -155
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 13 Total Test Services: 0 Failed, 13 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (1)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 💯 . This is definitely not being used right 😅
https://www.notion.so/Use-National-Registry-v3-for-legal-guardian-look-up-12e5a76701d68055b757ca4a55bd00ce?pvs=4
What
Remove deprecated code.
Why
Cleanup, simplifies upgrading to national registry v3 api.
Screenshots / Gifs
Attach Screenshots / Gifs to help reviewers understand the scope of the pull request
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Refactor