Skip to content

fix: removed retry logic from v1 cm360, added adapter for v1 to v0 conversion - #2860

Merged
aashishmalik merged 18 commits into
developfrom
fix.retyr-cm360-remove
Dec 11, 2023
Merged

aashishmalik merged 18 commits into
developfrom
fix.retyr-cm360-remove

Conversation

@aashishmalik

@aashishmalik aashishmalik commented Dec 1, 2023 •

Copy link
Copy Markdown
Contributor

Description of the change

removed retry logic from v1 cm360 proxy handler and added adapter for v1 to v0 payload conversion

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related issues

Fix #1

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached
  • "Ready for review" label attached to the PR and reviewers mentioned in a comment
  • Changes have been reviewed by at least one other engineer
  • Issue from task tracker has a link to this pull request

@coderabbitai

coderabbitai Bot commented Dec 1, 2023 •

Copy link
Copy Markdown
Contributor

Important

Auto Review Skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

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 X ?


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

@aashishmalik
aashishmalik marked this pull request as ready for review December 4, 2023 11:48
@aashishmalik
aashishmalik requested a review from a team December 4, 2023 11:48
@aashishmalik
aashishmalik requested a review from a team as a code owner December 4, 2023 12:50
@rudderlabs rudderlabs deleted a comment from codecov Bot Dec 5, 2023
@aashishmalik aashishmalik changed the title fix: removed retry logic from v1 cm360 proxy handler fix: removed retry logic from v1 cm360, added adapter for v1 to v0 conversion Dec 5, 2023
@aashishmalik
aashishmalik requested a review from a team as a code owner December 10, 2023 19:14
@rudderlabs rudderlabs deleted a comment from codecov Bot Dec 11, 2023
@codecov

codecov Bot commented Dec 11, 2023 •

Copy link
Copy Markdown

Codecov Report

Attention: 26 lines in your changes are missing coverage. Please review.

Comparison is base (c8e5bfb) 87.19% compared to head (49ba17c) 87.19%.
Report is 1 commits behind head on develop.

Files Patch % Lines
src/controllers/delivery.ts 57.69% 11 Missing ⚠️
src/v0/util/errorTypes/transformerProxyError.js 35.71% 6 Missing and 3 partials ⚠️
src/services/delivertTest/deliveryTest.ts 0.00% 3 Missing ⚠️
src/services/destination/postTransformation.ts 92.30% 1 Missing ⚠️
...v1/destinations/campaign_manager/networkHandler.js 66.66% 1 Missing ⚠️
...tegrations/destinations/braze/dataDelivery/data.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2860      +/-   ##
===========================================
- Coverage    87.19%   87.19%   -0.01%     
===========================================
  Files          776      784       +8     
  Lines        28950    29064     +114     
  Branches      6792     6815      +23     
===========================================
+ Hits         25244    25341      +97     
- Misses        3364     3378      +14     
- Partials       342      345       +3     

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

@utsabc utsabc mentioned this pull request Dec 11, 2023
4 of 10 tasks
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

58.1% 58.1% Coverage
0.0% 0.0% Duplication

@aashishmalik
aashishmalik merged commit 776d2c4 into develop Dec 11, 2023
Comment thread src/types/index.ts
Comment on lines +21 to +55
type ProxyDeliveryRequest = {
version: string;
type: string;
method: string;
endpoint: string;
userId: string;
headers?: Record<string, unknown>;
params?: Record<string, unknown>;
body?: {
JSON?: Record<string, unknown>;
JSON_ARRAY?: Record<string, unknown>;
XML?: Record<string, unknown>;
FORM?: Record<string, unknown>;
};
files?: Record<string, unknown>;
metadata: Metadata;
};

type ProxyDeliveriesRequest = {
version: string;
type: string;
method: string;
endpoint: string;
userId: string;
headers?: Record<string, unknown>;
params?: Record<string, unknown>;
body?: {
JSON?: Record<string, unknown>;
JSON_ARRAY?: Record<string, unknown>;
XML?: Record<string, unknown>;
FORM?: Record<string, unknown>;
};
files?: Record<string, unknown>;
metadata: Metadata[];
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can't we

Suggested change
type ProxyDeliveryRequest = {
version: string;
type: string;
method: string;
endpoint: string;
userId: string;
headers?: Record<string, unknown>;
params?: Record<string, unknown>;
body?: {
JSON?: Record<string, unknown>;
JSON_ARRAY?: Record<string, unknown>;
XML?: Record<string, unknown>;
FORM?: Record<string, unknown>;
};
files?: Record<string, unknown>;
metadata: Metadata;
};
type ProxyDeliveriesRequest = {
version: string;
type: string;
method: string;
endpoint: string;
userId: string;
headers?: Record<string, unknown>;
params?: Record<string, unknown>;
body?: {
JSON?: Record<string, unknown>;
JSON_ARRAY?: Record<string, unknown>;
XML?: Record<string, unknown>;
FORM?: Record<string, unknown>;
};
files?: Record<string, unknown>;
metadata: Metadata[];
};
type DeliveryRequest = {
version: string;
type: string;
method: string;
endpoint: string;
userId: string;
headers?: Record<string, unknown>;
params?: Record<string, unknown>;
body?: {
JSON?: Record<string, unknown>;
JSON_ARRAY?: Record<string, unknown>;
XML?: Record<string, unknown>;
FORM?: Record<string, unknown>;
};
files?: Record<string, unknown>;
};
interface ProxyDeliveryRequest extends DeliveryRequest {
metadata: Metadata;
}
interface ProxyDeliveriesRequest extends DeliveryRequest {
metadata: Metadata[];
}

Comment thread src/types/index.ts
Comment on lines +189 to +194
type DeliveriesResponse = {
status?: number;
message?: string;
statTags?: object;
authErrorCategory?: string;
response: DeliveryJobState[];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same change we can make here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

return ctx;
}

public static async deliverToDestinationV1(ctx: Context) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Apart from creating a new function can't we update the previous function to use on a different version?

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.

4 participants