-
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
feat(ids-api): Add feature flag for general mandate delegation type. #16182
Conversation
WalkthroughThe changes involve the introduction of a feature flag for controlling the fetching of general mandates in the Changes
Possibly related PRs
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: 1
🧹 Outside diff range and nitpick comments (3)
libs/feature-flags/src/lib/features.ts (2)
110-112
: LGTM! Consider adding a comment for clarity.The new feature flag
isGeneralMandateDelegationEnabled
is well-named and consistently placed within the enum. To improve maintainability, consider adding a brief comment explaining the purpose of this flag, similar to comments for other flags in the enum.You could add a comment like this:
// Enable general mandate delegation type isGeneralMandateDelegationEnabled = 'isGeneralMandateDelegationEnabled',
Line range hint
1-112
: Consider enhancing consistency and maintainability of theFeatures
enum.While the overall structure of the enum is good, there are a few areas where consistency and maintainability could be improved:
Comments: Consider adding brief comments for all flags, not just some. This would enhance maintainability and make the purpose of each flag clear.
Naming Convention: There's a mix of camelCase (e.g.,
userProfileClaims
) and lowercase (e.g.,testing
) naming. Consider standardizing to camelCase for all flags to improve readability and consistency.Grouping: The logical grouping is good, but consider adding comment headers for each group to make the structure even clearer.
Here's an example of how you could improve a section:
// Application visibility flags exampleApplication = 'isExampleApplicationEnabled', accidentNotification = 'isAccidentNotificationEnabled', europeanHealthInsuranceCard = 'isEuropeanHealthInsuranceCardApplicationEnabled', // ... other flags ... // Service portal modules servicePortalPetitionsModule = 'isServicePortalPetitionsModuleEnabled', servicePortalConsentModule = 'isServicePortalConsentModuleEnabled', // ... other service portal flags ... // Delegation types isLegalRepresentativeDelegationEnabled = 'isLegalRepresentativeDelegationEnabled', isGeneralMandateDelegationEnabled = 'isGeneralMandateDelegationEnabled',libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (1)
192-206
: Fix indentation for consistencyThe indentation of this new code block seems to be inconsistent with the rest of the file. Please adjust the indentation to match the surrounding code for better readability and maintainability.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
- libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (1 hunks)
- libs/feature-flags/src/lib/features.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
libs/auth-api-lib/src/lib/delegations/delegations-incoming.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."
libs/feature-flags/src/lib/features.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 (3)
libs/feature-flags/src/lib/features.ts (1)
Line range hint
1-112
: Excellent adherence to coding guidelines forlibs/**/*
files.The code in this file:
- Uses TypeScript for defining the
Features
enum.- Exports the enum, ensuring reusability across different NextJS apps.
- Supports effective tree-shaking and bundling with its structure.
These aspects align well with the specified coding guidelines for files in the
libs
directory.libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (2)
192-206
: LGTM with suggested improvementsThe implementation of the feature flag for general mandate delegation aligns well with the PR objectives and follows good TypeScript practices. The changes enhance the control flow by adding a conditional check based on the feature flag, ensuring that the fetching of general mandates only occurs when the feature is enabled.
Please consider the suggested improvements regarding the default feature flag value, indentation, and code structure. These changes will further enhance the code's readability and maintainability.
192-197
: Consider the default value for the feature flagThe default value for the
isGeneralMandateDelegationEnabled
feature flag is set totrue
. For a new feature, it's often safer to default tofalse
and explicitly enable it when ready. Please review if this default value aligns with your rollout strategy.
libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #16182 +/- ##
=======================================
Coverage 36.70% 36.70%
=======================================
Files 6776 6776
Lines 139595 139598 +3
Branches 39682 39683 +1
=======================================
+ Hits 51237 51242 +5
+ Misses 88358 88356 -2 Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 70 Total Test Services: 0 Failed, 68 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (2) |
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.
🚀
…16182) * Add feature flag for general mandate delegation type. * Flip featureFlagService.getValue to be default false --------- Co-authored-by: Sævar Már Atlason <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
...
Attach a link to issue if relevant
What
Specify what you're trying to achieve
Why
Specify why you need to achieve this
Screenshots / Gifs
Attach Screenshots / Gifs to help reviewers understand the scope of the pull request
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes