Skip to content
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(auth-api-lib): Cleanup legal repr. and general mandate feature flags. #17372

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

valurefugl
Copy link
Member

@valurefugl valurefugl commented Dec 31, 2024

What

Cleanup unused legal representative and general mandate feature flags.

Why

So we have tidier code and can delete the flags from configcat.

Screenshots / Gifs

Attach Screenshots / Gifs to help reviewers understand the scope of the pull request

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • Refactor

    • Simplified delegation retrieval process by removing feature flag checks
    • Removed feature flags related to legal representative and general mandate delegations
  • Chores

    • Cleaned up code complexity in delegation service
    • Streamlined method calls for delegation retrieval

@valurefugl valurefugl requested review from a team as code owners December 31, 2024 13:04
Copy link
Contributor

coderabbitai bot commented Dec 31, 2024

Walkthrough

The pull request introduces changes to the DelegationsIncomingService class and the Features enum. The modifications simplify the delegation retrieval process by removing feature flag checks for general mandate and legal representative delegations. The findAllAvailable method now directly calls delegation retrieval methods without conditional logic based on feature flags. Two feature flag entries have been removed from the Features enum, indicating a streamlined approach to handling delegations.

Changes

File Change Summary
libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts Removed feature flag checks in findAllAvailable method
Unconditionally called findCompanyGeneralMandate and findAllAvailableGeneralMandate
Simplified delegation promise handling
libs/feature-flags/src/lib/features.ts Removed enum entries:
- isLegalRepresentativeDelegationEnabled
- isGeneralMandateDelegationEnabled

Possibly related PRs

Suggested labels

automerge

Suggested reviewers

  • magnearun
  • eirikurn

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 74f5c19 and d987a7f.

📒 Files selected for processing (2)
  • libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (3 hunks)
  • libs/feature-flags/src/lib/features.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • libs/feature-flags/src/lib/features.ts
🧰 Additional context used
📓 Path-based instructions (1)
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."
🔇 Additional comments (3)
libs/auth-api-lib/src/lib/delegations/delegations-incoming.service.ts (3)

181-187: Unconditional retrieval of company general mandates looks consistent.

The removal of feature flag checks means this call to findCompanyGeneralMandate will always execute when ProcurationHolder is included in the delegation types. This matches the PR aim to simplify and remove unused flags, making the code more direct. Everything appears aligned with the new approach.


215-221: Always fetching general mandates appears in line with simplified logic.

By calling findAllAvailableGeneralMandate unconditionally (when GeneralMandate is a selected type), the code is more straightforward. This change removes the complexity of feature flag checks, as intended by the PR.


247-254: Including district commissioners’ delegations fits the unified approach.

With the feature flags removed, automatically pushing this block to gather delegations from the District Commissioners Registry ensures a consistent flow. The code’s readability is improved, aligning with the cleanup goals.


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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@valurefugl valurefugl changed the title Cleanup legal repr. and general mandate feature flags. chore(auth-api-lib): Cleanup legal repr. and general mandate feature flags. Dec 31, 2024
Copy link

codecov bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.68%. Comparing base (74f5c19) to head (d987a7f).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17372      +/-   ##
==========================================
- Coverage   35.68%   35.68%   -0.01%     
==========================================
  Files        6931     6931              
  Lines      148785   148777       -8     
  Branches    42509    42506       -3     
==========================================
- Hits        53091    53084       -7     
+ Misses      95694    95693       -1     
Flag Coverage Δ
air-discount-scheme-backend 48.22% <ø> (-0.03%) ⬇️
air-discount-scheme-web 0.00% <ø> (ø)
api 3.33% <ø> (ø)
api-domains-air-discount-scheme 37.93% <ø> (-0.06%) ⬇️
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 48.49% <ø> (ø)
api-domains-communications 39.41% <ø> (-0.02%) ⬇️
api-domains-criminal-record 47.96% <ø> (-0.08%) ⬇️
api-domains-driving-license 44.83% <ø> (-0.04%) ⬇️
api-domains-education 31.20% <ø> (-0.07%) ⬇️
api-domains-health-insurance 35.38% <ø> (-0.10%) ⬇️
api-domains-mortgage-certificate 35.19% <ø> (-0.06%) ⬇️
api-domains-payment-schedule 42.06% <ø> (-0.06%) ⬇️
application-api-files 61.83% <ø> (-0.07%) ⬇️
application-core 75.72% <ø> (ø)
application-system-api 38.73% <ø> (-0.01%) ⬇️
application-template-api-modules 27.66% <ø> (-0.02%) ⬇️
application-templates-accident-notification 27.61% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 25.83% <ø> (ø)
application-templates-driving-license 18.15% <ø> (ø)
application-templates-estate 13.66% <ø> (ø)
application-templates-example-payment 24.69% <ø> (ø)
application-templates-financial-aid 14.45% <ø> (ø)
application-templates-general-petition 23.12% <ø> (ø)
application-templates-inheritance-report 6.59% <ø> (ø)
application-templates-marriage-conditions 15.18% <ø> (ø)
application-templates-mortgage-certificate 43.68% <ø> (ø)
application-templates-parental-leave 29.95% <ø> (ø)
application-types 6.51% <ø> (ø)
application-ui-components 1.22% <ø> (ø)
application-ui-shell 22.25% <ø> (ø)
clients-charge-fjs-v2 28.88% <ø> (ø)
clients-driving-license 40.83% <ø> (-0.08%) ⬇️
clients-driving-license-book 43.86% <ø> (-0.06%) ⬇️
clients-financial-statements-inao 49.63% <ø> (-0.08%) ⬇️
clients-license-client 1.26% <ø> (ø)
clients-regulations 42.91% <ø> (-0.09%) ⬇️
clients-rsk-company-registry 31.18% <ø> (ø)
clients-rsk-personal-tax-return 38.32% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 49.43% <ø> (-0.05%) ⬇️
clients-zendesk 50.35% <ø> (-0.24%) ⬇️
cms 0.39% <ø> (ø)
cms-translations 38.74% <ø> (-0.02%) ⬇️
dokobit-signing 62.01% <ø> (-0.18%) ⬇️
email-service 60.00% <ø> (-0.16%) ⬇️
feature-flags 90.69% <ø> (-0.15%) ⬇️
file-storage 45.75% <ø> (-0.22%) ⬇️
financial-aid-backend 51.39% <ø> (-0.03%) ⬇️
judicial-system-api 20.20% <ø> (ø)
judicial-system-audit-trail 68.86% <ø> (-0.17%) ⬇️
judicial-system-backend 55.97% <ø> (-0.01%) ⬇️
judicial-system-message 66.48% <ø> (-0.13%) ⬇️
judicial-system-message-handler 48.16% <ø> (-0.18%) ⬇️
judicial-system-scheduler 71.11% <ø> (-0.05%) ⬇️
license-api 42.85% <ø> (-0.16%) ⬇️
nest-config 76.32% <ø> (-0.14%) ⬇️
nest-feature-flags 50.94% <ø> (-0.13%) ⬇️
nova-sms 61.33% <ø> (-0.19%) ⬇️
portals-admin-regulations-admin 1.80% <ø> (ø)
portals-core 19.58% <ø> (ø)
services-auth-admin-api 52.56% <0.00%> (+0.01%) ⬆️
services-auth-delegation-api 58.49% <0.00%> (+0.01%) ⬆️
services-auth-ids-api 52.55% <100.00%> (-0.02%) ⬇️
services-auth-public-api 49.39% <66.66%> (-0.03%) ⬇️
services-sessions 65.28% <ø> (-0.04%) ⬇️
services-university-gateway 49.52% <ø> (+0.05%) ⬆️
services-user-notification 46.53% <ø> (+0.01%) ⬆️
services-user-profile 56.95% <ø> (+0.06%) ⬆️
web 2.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...rc/lib/delegations/delegations-incoming.service.ts 92.80% <100.00%> (-0.30%) ⬇️
libs/feature-flags/src/lib/features.ts 100.00% <ø> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74f5c19...d987a7f. Read the comment docs.

@datadog-island-is
Copy link

Datadog Report

All test runs a4c287c 🔗

10 Total Test Services: 0 Failed, 10 Passed
🔻 Test Sessions change in coverage: 26 decreased, 1 increased (+0.02%), 173 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
air-discount-scheme-backend 0 0 0 63 0 22.94s N/A Link
air-discount-scheme-web 0 0 0 2 0 6.65s N/A Link
api 0 0 0 4 0 2.45s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 16.38s N/A Link
api-domains-assets 0 0 0 3 0 9.59s N/A Link
api-domains-auth-admin 0 0 0 18 0 9.95s N/A Link
api-domains-communications 0 0 0 5 0 29.72s N/A Link
api-domains-criminal-record 0 0 0 5 0 8.5s 1 decreased (-0.08%) Link
api-domains-driving-license 0 0 0 23 0 28.02s N/A Link
api-domains-education 0 0 0 8 0 18.5s 1 decreased (-0.05%) Link

🔻 Code Coverage Decreases vs Default Branch (26)

This report shows up to 5 code coverage decreases.

  • clients-zendesk - jest 53.78% (-0.24%) - Details
  • file-storage - jest 49.77% (-0.23%) - Details
  • nova-sms - jest 63.92% (-0.19%) - Details
  • judicial-system-message-handler - jest 51.22% (-0.18%) - Details
  • dokobit-signing - jest 64.73% (-0.18%) - Details

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