Skip to content

[Smart hashing] Cleanup #2875

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

Closed
wants to merge 3 commits into from
Closed

[Smart hashing] Cleanup #2875

wants to merge 3 commits into from

Conversation

harsh-joshi99
Copy link
Contributor

This PR includes cleanup related to smart hashing:

  • Removed destination slugs
  • Removed feature flags
  • Removed the old smart hashing module from Actions Core

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
  • [Segmenters] [If applicable for this change] Tested for regression with Hadron.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR cleans up the smart hashing implementation by removing unused destination slugs, feature flags, and the legacy smart hashing module from Actions Core. The changes involve updating all hash function calls across multiple destinations to remove the now-unnecessary features parameters and related context.

Reviewed Changes

Copilot reviewed 77 out of 77 changed files in this pull request and generated no comments.

Show a summary per file
File Description
facebook-conversions-api/pageView2/index.ts Removed features parameter from hash_user_data call.
facebook-conversions-api/pageView/index.ts Removed features parameter from hash_user_data call.
facebook-conversions-api/initiateCheckout2/index.ts Removed features parameter from hash_user_data call.
facebook-conversions-api/initiateCheckout/index.ts Removed features parameter from hash_user_data call.
facebook-conversions-api/fb-capi-user-data.ts Updated processHashing calls to remove features and context.
facebook-conversions-api/custom2/index.ts Removed features parameter from hash_user_data call.
facebook-conversions-api/custom/index.ts Removed features parameter from hash_user_data call.
facebook-conversions-api/addToCart2/index.ts Removed features parameter from hash_user_data call.
facebook-conversions-api/addToCart/index.ts Removed features parameter from hash_user_data call.
dynamic-yield-audiences/* Removed features parameter from various hashing and audience functions.
delivrai-activate/* Removed features parameter from updateSegment and related functions.
amazon-amc/* Removed features parameter from hashing functions and adjusted tests accordingly.
core/hashing-utils.ts & tests/hashing-utils.test.ts Removed; these legacy modules are no longer needed.
Comments suppressed due to low confidence (2)

packages/destination-actions/src/destinations/facebook-conversions-api/fb-capi-user-data.ts:200

  • Ensure that the removal of the features parameter and associated context values does not alter the expected hashing behavior. Verify that unit tests cover all edge cases for the updated hash implementations.
return processHashing(value, 'sha256', 'hex')

packages/destination-actions/src/destinations/amazon-amc/function.ts:15

  • Ensure that the removal of the features parameter from hashedPayload calls in payload transformations maintains the integrity of the hashed values. Confirm that test coverage is sufficient to validate this behavior.
const payloadRecord = createPayloadToUploadRecords(payload, audienceSettings)

Copy link

codecov bot commented Apr 22, 2025

Codecov Report

Attention: Patch coverage is 86.85446% with 28 lines in your changes missing coverage. Please review.

Project coverage is 78.78%. Comparing base (139f434) to head (78df6a9).
Report is 20 commits behind head on main.

Files with missing lines Patch % Lines
.../destinations/google-campaign-manager-360/utils.ts 42.85% 1 Missing and 3 partials ⚠️
...rc/destinations/dynamic-yield-audiences/helpers.ts 50.00% 2 Missing ⚠️
...ed-conversions/uploadConversionAdjustment/index.ts 80.00% 2 Missing ⚠️
...d-conversions/uploadConversionAdjustment2/index.ts 80.00% 2 Missing ⚠️
.../src/destinations/liveramp-audiences/operations.ts 60.00% 2 Missing ⚠️
...tinations/delivrai-activate/updateSegment/index.ts 66.66% 1 Missing ⚠️
.../src/destinations/dynamic-yield-audiences/index.ts 0.00% 1 Missing ⚠️
...ions/dynamic-yield-audiences/syncAudience/index.ts 0.00% 1 Missing ⚠️
...ons/first-party-dv360/addToAudContactInfo/index.ts 50.00% 1 Missing ⚠️
...irst-party-dv360/removeFromAudContactInfo/index.ts 50.00% 1 Missing ⚠️
... and 11 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2875      +/-   ##
==========================================
+ Coverage   77.93%   78.78%   +0.84%     
==========================================
  Files        1047     1099      +52     
  Lines       19246    21935    +2689     
  Branches     3751     4417     +666     
==========================================
+ Hits        14999    17281    +2282     
- Misses       2925     3391     +466     
+ Partials     1322     1263      -59     

☔ 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.

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.

Left couple of comments.
It would be great if we could split this into multiple PRs.

Comment on lines +25 to +36
// const slugsToBypassFeatureFlag = [
// 'actions-facebook-custom-audiences',
// 'actions-linkedin-audiences',
// 'actions-snap-audiences',
// 'actions-snap-conversions',
// 'actions-tiktok-offline-conversions',
// 'tiktok-conversions',
// 'actions-google-enhanced-conversions',
// 'actions-google-campaign-manager-360',
// 'actions-facebook-conversions-api',
// 'actions-tiktok-audiences'
// ]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be deleted?

return processHashing(value, 'sha256', 'hex', cleaningFunction)
}

export function hashValue(value: string, cleaningFunction?: (value: string) => string): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this function needed?

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