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

fix(skilavottord): Check current owner on deregistration #14763

Merged
merged 4 commits into from
May 13, 2024

Conversation

birkirkristmunds
Copy link
Member

@birkirkristmunds birkirkristmunds commented May 10, 2024

...

TRS-12

What

Check if current owner is correctly registered in the Skilavottord DB when deregistering the vehicle

Why

Specify why you need to achieve this

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

  • Bug Fixes
    • Enabled an essential check to verify the current user's credentials in the recycling request process.
  • Refactor
    • Updated URL construction and enhanced data retrieval and error handling for vehicle information in the service handling interactions with the Icelandic Transport Authority.

@birkirkristmunds birkirkristmunds requested a review from a team as a code owner May 10, 2024 14:01
Copy link
Contributor

coderabbitai bot commented May 10, 2024

Walkthrough

The recent update involves enhancements in the RecyclingRequestService and VehicleService classes. In RecyclingRequestService, a previously commented-out asynchronous call has been activated, and improvements have been made to URL construction logic, data retrieval, and error handling in IcelandicTransportAuthorityServices. Additionally, a logging statement was added in VehicleService to track changes in the owner of a vehicle before updating the owner's national ID.

Changes

File Path Change Summary
.../recyclingRequest/recyclingRequest.service.ts Activated an awaited call to checkIfCurrentUser in RecyclingRequestService. Updated URL construction logic in doGet method. Refactored data retrieval and error handling related to vehicle information.
.../vehicle/vehicle.service.ts Added a logging statement within the method updating the ownerNationalId of a vehicle in VehicleService.

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 9313e8a and 501e0de.
Files selected for processing (2)
  • apps/skilavottord/ws/src/app/modules/recyclingRequest/recyclingRequest.service.ts (1 hunks)
  • apps/skilavottord/ws/src/app/services/icelandicTransportAuthority.services.ts (4 hunks)
Files not reviewed due to errors (1)
  • apps/skilavottord/ws/src/app/services/icelandicTransportAuthority.services.ts (no review received)
Files skipped from review due to trivial changes (1)
  • apps/skilavottord/ws/src/app/modules/recyclingRequest/recyclingRequest.service.ts
Additional Context Used
Path-based Instructions (1)
apps/skilavottord/ws/src/app/services/icelandicTransportAuthority.services.ts (1)

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."

@birkirkristmunds birkirkristmunds added the automerge Merge this PR as soon as all checks pass label May 10, 2024
Copy link

codecov bot commented May 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 37.07%. Comparing base (f30ad71) to head (fce30de).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14763      +/-   ##
==========================================
- Coverage   37.08%   37.07%   -0.01%     
==========================================
  Files        6306     6256      -50     
  Lines      127980   128475     +495     
  Branches    36588    36940     +352     
==========================================
+ Hits        47458    47629     +171     
- Misses      80522    80846     +324     
Flag Coverage Δ
air-discount-scheme-backend 54.06% <ø> (ø)
air-discount-scheme-web 0.00% <ø> (ø)
api 3.44% <ø> (ø)
api-domains-air-discount-scheme 36.15% <ø> (ø)
application-templates-criminal-record 21.57% <ø> (ø)
application-templates-example-payment 20.39% <ø> (ø)
auth-react 22.95% <ø> (ø)
auth-shared 75.00% <ø> (ø)
clients-syslumenn 49.88% <ø> (ø)
file-storage 52.05% <ø> (ø)
infra-nest-server 48.33% <ø> (ø)
infra-tracing 43.24% <ø> (ø)
island-ui-core 28.66% <ø> (ø)
judicial-system-api 19.58% <ø> (ø)
judicial-system-audit-trail 67.31% <ø> (ø)
localization 10.15% <ø> (ø)
logging 48.43% <ø> (ø)
message-queue 68.39% <ø> (ø)
nest-problem 46.08% <ø> (ø)
nest-sequelize 94.44% <ø> (ø)
portals-core 16.14% <ø> (ø)
services-auth-admin-api 50.69% <ø> (ø)
services-auth-delegation-api 62.50% <ø> (ø)
services-auth-ids-api 54.76% <ø> (+0.01%) ⬆️
services-auth-personal-representative 49.96% <ø> (ø)
services-auth-personal-representative-public 45.52% <ø> (+0.05%) ⬆️
services-auth-public-api 50.33% <ø> (-0.02%) ⬇️
services-documents 60.91% <ø> (ø)
services-endorsements-api 55.45% <ø> (ø)
shared-problem 87.50% <ø> (ø)
shared-utils 26.14% <ø> (ø)

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

Files Coverage Δ
...dules/recyclingRequest/recyclingRequest.service.ts 8.45% <0.00%> (-0.04%) ⬇️
...tord/ws/src/app/modules/vehicle/vehicle.service.ts 20.45% <0.00%> (-0.48%) ⬇️
...p/services/icelandicTransportAuthority.services.ts 18.18% <0.00%> (+0.27%) ⬆️

... and 295 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 f30ad71...fce30de. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented May 10, 2024

Datadog Report

All test runs 7404293 🔗

4 Total Test Services: 0 Failed, 4 Passed
🔻 Test Sessions change in coverage: 1 decreased (-0.05%), 4 no change

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
api 0 0 0 4 0 3.35s 1 decreased (-0.05%) Link
application-system-api 0 0 0 111 2 3m 21.92s 1 no change Link
application-template-api-modules 0 0 0 107 0 1m 44.83s 1 no change Link
skilavottord-ws 0 0 0 1 0 16.94s N/A Link

🔻 Code Coverage Decreases vs Default Branch (1)

  • api - jest 4.54% (-0.05%) - Details

- Fix after review
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 501e0de and 5ab02bc.
Files selected for processing (1)
  • apps/skilavottord/ws/src/app/services/icelandicTransportAuthority.services.ts (4 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/skilavottord/ws/src/app/services/icelandicTransportAuthority.services.ts

- Added logger when changing owner
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Out of diff range and nitpick comments (1)
apps/skilavottord/ws/src/app/modules/vehicle/vehicle.service.ts (1)

88-92: Add more detailed logging for owner change.

Consider enhancing the logging statement to include both the old and new owner's national ID for better traceability and auditing purposes. This could be particularly useful in debugging or tracking changes over time.

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 5ab02bc and f1008b5.
Files selected for processing (1)
  • apps/skilavottord/ws/src/app/modules/vehicle/vehicle.service.ts (1 hunks)
Additional Context Used
Path-based Instructions (1)
apps/skilavottord/ws/src/app/modules/vehicle/vehicle.service.ts (1)

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."

@kodiakhq kodiakhq bot merged commit 9a55ec1 into main May 13, 2024
239 checks passed
@kodiakhq kodiakhq bot deleted the fix/skilavottord-current-owner branch May 13, 2024 12:54
Ballioli pushed a commit that referenced this pull request May 17, 2024
* TRS-17 Add custom to allowedDelegations

* TRS-12
- Fix after review

* TRS-12
- Added logger when changing owner

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants