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

refactor: merge PublicUserMapper with UserMapper #2135

Merged
merged 1 commit into from
Oct 16, 2023

Conversation

typfel
Copy link
Member

@typfel typfel commented Oct 16, 2023


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

I don't see any clear distinction between PublicUserMapper and UserMapper so why not merge them and have all related methods in one place.

I also tried to remove unnecessary or unused mapper methods.

  • fromUserProfileDtoToOtherUser is now a composite method of fromUserProfileDtoToUserEntity and fromUserEntityToOtherUser
  • fromSelfUserToUserDetailsEntity, fromSelfUserDtoToUserDetailsEntity, fromUserProfileDtoToUserDetailsEntity, fromFailedUserToDetailsEntity were all removed since they were unused (we never insert UserDetailsEntity because the additional properties are computed.)
  • replaced fromUpdateRequestToDaoModel with fromUpdateRequestToPartialUserEntity, this avoids mapping from SelfUser to UserEntity.

Future work

fromSelfUserToUserEntity and fromOtherToUserEntity is now only when importing old android scala users. If we could map directly an android scala user to a UserEntity we would complete get rid of any mapping from the model layer to to DAO.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

Unit Test Results

   455 files  ±0     455 suites  ±0   2m 28s ⏱️ -1s
2 532 tests ±0  2 430 ✔️ ±0  102 💤 ±0  0 ±0 

Results for commit a745eb8. ± Comparison against base commit 6ce6fad.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@mchenani mchenani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@datadog-wireapp
Copy link

datadog-wireapp bot commented Oct 16, 2023

Datadog Report

All test runs 58d9d4f 🔗

2 Total Test Services: 0 Failed, 0 with New Flaky, 2 Passed

Test Services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Branch View
kalium-ios 0 0 0 2109 66 8m 53.11s Link
kalium-jvm 0 0 0 2430 102 11m 44s Link

@typfel typfel force-pushed the refactor/user-mapper branch from e828e72 to a745eb8 Compare October 16, 2023 11:13
@typfel typfel added this pull request to the merge queue Oct 16, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 16, 2023
@typfel typfel added this pull request to the merge queue Oct 16, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 16, 2023
@typfel typfel added this pull request to the merge queue Oct 16, 2023
Merged via the queue into develop with commit ebb3a24 Oct 16, 2023
15 checks passed
@typfel typfel deleted the refactor/user-mapper branch October 16, 2023 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants