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

feat: isolate server ut communication #5430

Merged
merged 33 commits into from
Feb 19, 2025
Merged

Conversation

cisse21
Copy link
Member

@cisse21 cisse21 commented Jan 14, 2025

Description

This PR attempts to dissect the processor/transformer file which served as a common ground for UT,DT and TP thus making it much harder to implement custom changes for each of these components

It makes use of strategy pattern to have a common interface defined for each of the communication component and the components are isolated in each of their files with their respective tests

Linear Ticket

Fixes PIPE-5430

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@cisse21 cisse21 changed the title Feat.isolate server ut communication feat: isolate server ut communication Jan 14, 2025
@cisse21 cisse21 force-pushed the feat.isolateServerUTCommunication branch from 56c9769 to f16e30e Compare January 14, 2025 07:13
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 90.55046% with 103 lines in your changes missing coverage. Please review.

Project coverage is 75.25%. Comparing base (2353c68) to head (3d92dad).
Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...l/transformer/user_transformer/user_transformer.go 86.34% 27 Missing and 10 partials ⚠️
...trackingplan_validation/trackingplan_validation.go 89.36% 17 Missing and 8 partials ⚠️
...destination_transformer/destination_transformer.go 93.96% 9 Missing and 5 partials ⚠️
processor/processor.go 91.37% 7 Missing and 3 partials ⚠️
processor/transformer/clients.go 50.00% 6 Missing ⚠️
processor/trackingplan.go 80.00% 3 Missing and 1 partial ⚠️
processor/transformer/transformer.go 90.62% 3 Missing ⚠️
processor/internal/transformer/utils.go 97.14% 1 Missing ⚠️
...ger/transformation/transformationStatusUploader.go 66.66% 1 Missing ⚠️
warehouse/transformer/logger.go 50.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5430      +/-   ##
==========================================
+ Coverage   75.06%   75.25%   +0.19%     
==========================================
  Files         462      473      +11     
  Lines       63944    64851     +907     
==========================================
+ Hits        47998    48805     +807     
- Misses      13270    13346      +76     
- Partials     2676     2700      +24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cisse21 cisse21 force-pushed the feat.isolateServerUTCommunication branch from b31ee2d to 1771a8e Compare January 15, 2025 04:47
@cisse21 cisse21 force-pushed the feat.isolateServerUTCommunication branch from e471d37 to abd8358 Compare January 15, 2025 08:56
@cisse21 cisse21 force-pushed the feat.isolateServerUTCommunication branch from 09ad557 to 4bf68a2 Compare January 20, 2025 09:57
Copy link
Contributor

@ktgowtham ktgowtham left a comment

Choose a reason for hiding this comment

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

  1. Can I assume the implementation logic(in user_trans, dest_trans) is exactly same as copied from transformer.go? planning to skip reviewing that part for just skim it through.

  2. router transformer will remain as is? it’s only transformation in processor that we’re splitting out rt?

  3. Looks like we’ve not replaced function calls to use the new sendrequest function. do we plan to do that in follow up PR?

  4. Are we okay to have types.TransformerEvent as param for all implementations(in ServiceClient -> SendRequest)? Will we lose flexibility to have same struct? or is it going to be same and we choose what to populate in that struct?

@cisse21
Copy link
Member Author

cisse21 commented Jan 22, 2025

Can I assume the implementation logic(in user_trans, dest_trans) is exactly same as copied from transformer.go? planning to skip reviewing that part for just skim it through.

Yeah... I just got rid of a few things here and there which are relevant to individual components but yeah in this PR we can assume that it is going to be the same

router transformer will remain as is? it’s only transformation in processor that we’re splitting out rt?

Yes... it is only the processor transformer module we are splitting out

Looks like we’ve not replaced function calls to use the new sendrequest function. do we plan to do that in follow up PR?

That is the only part remaining where I will put it under a flag so that we can switch between older and newer implementation

Are we okay to have types.TransformerEvent as param for all implementations(in ServiceClient -> SendRequest)? Will we lose flexibility to have same struct? or is it going to be same and we choose what to populate in that struct?

Didn't want to make too many changes in one PR but the idea is to abstract out things in this PR and then change the structs with the appropriate data over the subsequent PR's

@ktgowtham ktgowtham self-requested a review January 22, 2025 08:54
@cisse21 cisse21 force-pushed the feat.isolateServerUTCommunication branch 5 times, most recently from 108437c to 21ffbda Compare February 18, 2025 09:24
@cisse21 cisse21 force-pushed the feat.isolateServerUTCommunication branch 5 times, most recently from fb2365a to a1c6d03 Compare February 18, 2025 11:35
@cisse21 cisse21 requested review from lvrach and atzoum February 18, 2025 11:36
@cisse21 cisse21 force-pushed the feat.isolateServerUTCommunication branch from a1c6d03 to b59f3b8 Compare February 18, 2025 12:25
@cisse21 cisse21 force-pushed the feat.isolateServerUTCommunication branch from b59f3b8 to 9d97dc6 Compare February 18, 2025 12:57
@cisse21 cisse21 force-pushed the feat.isolateServerUTCommunication branch from 29df508 to 801559c Compare February 18, 2025 14:57
@cisse21 cisse21 force-pushed the feat.isolateServerUTCommunication branch from 801559c to 447dea3 Compare February 18, 2025 16:45
internal/transformer-client/client.go Outdated Show resolved Hide resolved
processor/processor.go Outdated Show resolved Hide resolved
processor/processor.go Outdated Show resolved Hide resolved
processor/processor.go Show resolved Hide resolved
processor/transformer/manager.go Outdated Show resolved Hide resolved
processor/transformer/manager.go Outdated Show resolved Hide resolved
testhelper/transformertest/handler_funcs.go Outdated Show resolved Hide resolved
@cisse21 cisse21 merged commit 63505f6 into master Feb 19, 2025
56 checks passed
@cisse21 cisse21 deleted the feat.isolateServerUTCommunication branch February 19, 2025 09:49
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.

5 participants