Skip to content

Conversation

@nk1107
Copy link
Contributor

@nk1107 nk1107 commented Aug 28, 2025

JIRA - https://twilio-engineering.atlassian.net/browse/STRATCONN-6015?atlOrigin=eyJpIjoiMzg0OGZlYWY3MDhjNDE5YWJlNjc1NDA1MjBhMjQ3YjYiLCJwIjoiaiJ9

HeadBucket - https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html

This change adds a validation logic to validate the IAM role for the liveramp audienceEnteredS3 action. This is done using HEAD request to the S3 bucket with the IAM credentials in the mappings.

Number of batch events processed by liveramp in 1 day
image-20250829-044028

Testing

Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [If destination is already live] Tested for backward compatibility of destination. Note: New required fields are a breaking change.
  • [Segmenters] Tested in the staging environment
image image
  • [Segmenters] [If applicable for this change] Tested for regression with Hadron.

Rollout Strategy

image

Going with the flagon based rollout with following stages

  1. First rollout uptill the business tier customers.
  2. Second rollout till the strategic account tier customers.
  3. Third rollout for all the customer tiers.

@codecov
Copy link

codecov bot commented Aug 28, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.88%. Comparing base (9306771) to head (cb2a3f7).
⚠️ Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
...nations/liveramp-audiences/audienceEnteredS3/s3.ts 77.77% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3209   +/-   ##
=======================================
  Coverage   79.88%   79.88%           
=======================================
  Files        1190     1190           
  Lines       21874    21894   +20     
  Branches     4262     4270    +8     
=======================================
+ Hits        17474    17490   +16     
- Misses       3648     3650    +2     
- Partials      752      754    +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nk1107 nk1107 marked this pull request as ready for review September 2, 2025 05:18
sayan-das-in
sayan-das-in previously approved these changes Sep 4, 2025
@sayan-das-in
Copy link
Contributor

nit pick: in the test cases nock.cleanAll() ideally should be wrapped inside beforeEach.

sayan-das-in
sayan-das-in previously approved these changes Sep 8, 2025
Copy link
Contributor

@varadarajan-tw varadarajan-tw left a comment

Choose a reason for hiding this comment

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

Looks good. Left a couple of questions

Comment on lines 155 to 162
if (
!payload.s3_aws_access_key ||
!payload.s3_aws_secret_key ||
!payload.s3_aws_bucket_name ||
!payload.s3_aws_region
) {
throw new PayloadValidationError('Missing required S3 credentials.')
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we mark all these as required? aren't these marked as required 🤔 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only the s3_aws_region is a required property as of now. We'll have to introduce another change to mark the other properties as required.


// skip for legacy flow to avoid snapshot issues
if (!(input.features && input.features[LIVERAMP_LEGACY_FLOW_FLAG_NAME] === true)) {
await validateS3Permissions(input.payloads[0], input.request)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we put this behind another feature flag for rollout?

Copy link
Contributor Author

@nk1107 nk1107 Sep 8, 2025

Choose a reason for hiding this comment

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

Right now i have avoided the validation for the legacy_flag due to snapshot issues, but yeah we can introduce a flag for rollout

Comment on lines 148 to 153
if (!(input.features && input.features[LIVERAMP_LEGACY_FLOW_FLAG_NAME] === true)) {
// only validate S3 permissions when the validation flag is enabled
if (input.features && input.features[LIVERAMP_S3_IAM_VALIDATION_FLAG_NAME] === true) {
await validateS3Permissions(input.payloads[0], input.request)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this work?

Suggested change
if (!(input.features && input.features[LIVERAMP_LEGACY_FLOW_FLAG_NAME] === true)) {
// only validate S3 permissions when the validation flag is enabled
if (input.features && input.features[LIVERAMP_S3_IAM_VALIDATION_FLAG_NAME] === true) {
await validateS3Permissions(input.payloads[0], input.request)
}
}
if (input?.features[LIVERAMP_LEGACY_FLOW_FLAG_NAME)!==true && input?.features[LIVERAMP_S3_IAM_VALIDATION_FLAG_NAME] == true){
await validateS3Permissions(input.payloads[0], input.request)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added the recommended change

@nk1107 nk1107 closed this Sep 17, 2025
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.

5 participants