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: feature flag http dest example #3933

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

vinayteki95
Copy link
Contributor

What are the changes introduced in this PR?

  1. webhook destination is enhanced to read content-type header and generate response body in the appropriate format (xml, urlencoded, json)
  2. This feature is enabled based on feature flag dest_transformer_webhook_form_support. New feature flag sdk is used to achieve this.

This is only a draft and will be updated to use better naming convention for feature flag and better imports for cdk/v2/webhook.

What is the related Linear task?

Resolves INT-2991

Please explain the objectives of your changes below

To experiment with the new feature flag sdk and perform end-to-end testing.

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

webhook destination now respects content-type headers

Any new dependencies introduced with this change?

feature-flag-sdk

Any new generic utility introduced or modified. Please explain the changes.

N/A

Any technical or performance related pointers to consider with the change?

How efficient is feature-flag-sdk?

@coderabbitai review


Developer checklist

  • My code follows the style guidelines of this project

  • No breaking changes are being introduced.

  • All related docs linked with the PR?

  • All changes manually tested?

  • Any documentation changes needed with this change?

  • Is the PR limited to 10 file changes?

  • Is the PR limited to one linear task?

  • Are relevant unit and component test-cases added in new readability format?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?

  • Verified that there are no credentials or confidential data exposed with the changes.

case XML:
return { payload: { payload: getXMLPayload(payload) }, contentTypeSimplified };
case FORM:
return { payload, contentTypeSimplified };
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return { payload, contentTypeSimplified };
return { getFORMPayload(payload), contentTypeSimplified };

Copy link
Contributor Author

@vinayteki95 vinayteki95 Dec 12, 2024

Choose a reason for hiding this comment

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

We don't have to convert this into FORMPayload ourselves as rudder-server takes care of it.
Follow this link to see what rudder-server is doing: https://github.com/rudderlabs/rudder-server/blob/f22e8f4bb61893af132f3f4386155c83c695fd51/router/network.go#L124

But I see the issue here, we need to flatten the json for rudder-server to properly convert it into form-values

I think a simple flattening will do the job here @krishna2020

integrations: {
All: true,
},
message_id: 'a80f82be-9bdc-4a9f-b2a5-15621ee41df8',
Copy link
Collaborator

@krishna2020 krishna2020 Dec 12, 2024

Choose a reason for hiding this comment

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

test case can be made readable by restricting only to necessary fields in the payload

@vinayteki95 vinayteki95 marked this pull request as ready for review December 13, 2024 09:41
@vinayteki95 vinayteki95 requested review from a team and sivashanmukh as code owners December 13, 2024 09:41
Copy link

sonarcloud bot commented Dec 13, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)
2 New Major Issues (required ≤ 1)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

2 participants