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(garl): move GARL destination to new form builder #1715

Merged
merged 5 commits into from
Oct 28, 2024

Conversation

sandeepdsvs
Copy link
Contributor

@sandeepdsvs sandeepdsvs commented Sep 30, 2024

What are the changes introduced in this PR?

Move GARL destination to new form builder

Screenshot 2024-10-24 at 3 55 54 PM Screenshot 2024-10-24 at 3 56 19 PM

What is the related Linear task?

Resolves INT-2806

Please explain the objectives of your changes below

Put down any required details on the broader aspect of your changes. If there are any dependent changes, mandatorily mention them here

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

N/A

Any new dependencies introduced with this change?

N/A

Any new checks got introduced or modified in test suites. Please explain the changes.

N/A


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?

  • I have executed schemaGenerator tests and updated schema if needed

  • Are sensitive fields marked as secret in definition config?

  • My test cases and placeholders use only masked/sample values for sensitive fields

  • Is the PR limited to 10 file changes & one task?

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.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced configuration for Google Ads Remarketing Lists with the addition of an audienceId field for improved audience identification.
    • Restructured user interface configuration for better organization, including new sections for "Initial setup" and "Configuration settings."
    • Introduced new properties for user data and consent management in the configuration schema.
  • Improvements

    • Updated input validation and added contextual notes to enhance usability.
    • Standardized consent settings for clearer user data management.
    • Enhanced validation logic with stricter type checks for configuration objects.

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (4a00440) to head (063e8fa).
Report is 61 commits behind head on release/v1.97.0.

Additional details and impacted files
@@                Coverage Diff                @@
##           release/v1.97.0     #1715   +/-   ##
=================================================
  Coverage           100.00%   100.00%           
=================================================
  Files                    2         2           
  Lines                   53        53           
  Branches                 7         7           
=================================================
  Hits                    53        53           

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

@devops-github-rudderstack
Copy link
Contributor

This PR is considered to be stale. It has been open for 20 days with no further activity thus it is going to be closed in 7 days. To avoid such a case please consider removing the stale label manually or add a comment to the PR.

Copy link

coderabbitai bot commented Oct 21, 2024

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes involve modifications to three configuration files for Google Ads Remarketing Lists. In db-config.json, the audienceId field has been added to the defaultConfig array and removed from the cloud array. The ui-config.json has undergone a significant restructuring, transitioning from an array format to a hierarchical structure with baseTemplate and sdkTemplate, along with updates to field names, types, and the introduction of new attributes for improved clarity and usability. Finally, the schema.json file has had several new properties added to enhance user data and consent management options.

Changes

File Path Change Summary
src/configurations/destinations/google_adwords_remarketing_lists/db-config.json - Added audienceId field in defaultConfig array within destConfig
- Removed audienceId field from cloud array within destConfig
src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json - Updated uiConfig structure from an array to an object with baseTemplate and sdkTemplate
- Changed value to configKey in multiple fields
- Updated preRequisiteField to preRequisites
- Changed dynamicCustomForm to tagInput for consent IDs
- Added note attributes for context
- Updated default values in consentSettingsTemplate to use arrays instead of objects
src/configurations/destinations/google_adwords_remarketing_lists/schema.json - Added new properties: isHashRequired, audienceId, customerId, loginCustomerId, subAccount, userSchema, typeOfList, userDataConsent, personalizationConsent with respective types and default values in configSchema

Possibly related PRs

Suggested reviewers

  • lvrach
  • am6010
  • AchuthaSourabhC
  • ssbeefeater
  • debanjan97
  • cisse21
  • ruchiramoitra
  • shrouti1507
  • 1abhishekpandey
  • krishna2020
  • Gauravudia

Poem

In the garden of code, where changes bloom,
New fields sprout, dispelling the gloom.
With audienceId now in its place,
And templates restructured, we quicken the pace.
A hop and a skip, through settings we dart,
Enhancing the flow, a true work of art! 🐇✨


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 your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (3)
src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json (3)

89-206: Approve consent-related additions and suggest improvement for Schema Fields

The addition of user data consent and personalization consent fields is a positive change, aligning with modern data privacy practices and regulations.

The conditional display of "Schema Fields" based on the "List Type" improves the user experience by showing only relevant options.

Consider adding a brief explanation or tooltip for each schema field option to help users understand what each field represents and its implications. For example:

 {
   "label": "Email",
-  "value": "email"
+  "value": "email",
+  "description": "User's email address for remarketing"
 },
 {
   "label": "Phone Number",
-  "value": "phone"
+  "value": "phone",
+  "description": "User's phone number for remarketing"
 },
 {
   "label": "Address Info",
-  "value": "addressInfo"
+  "value": "addressInfo",
+  "description": "User's address information for location-based remarketing"
 }

This addition would enhance user understanding and help them make informed decisions when configuring the destination.


Line range hint 207-350: Approve consent settings changes and suggest improvements

The updates to the consent settings, particularly the change to tagInput for OneTrust and Ketch configurations, simplify the input process and improve user experience.

Consider the following improvements:

  1. For the empty groups array in the "Consent settings" section:

    {
      "id": "consentSettings",
      "title": "Consent settings",
      "note": "Configure consent settings for each provider here",
      "icon": "settings",
    - "groups": []
    + "groups": [],
    + "footerNote": "Additional consent configuration options will be available in future updates."
    }
  2. For the custom consent management configuration:

    • Add input validation for the "Enter consent category ID's" field to ensure proper formatting.
    • Consider adding a help link or tooltip explaining the difference between "AND" and "OR" consent logic.
 {
   "type": "tagInput",
   "label": "Enter consent category ID's",
   "note": "Input your consent category IDs by pressing 'Enter' after each entry. The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.",
   "configKey": "consents",
   "tagKey": "consent",
   "placeholder": "e.g: Marketing",
+  "regex": "^[A-Za-z0-9_-]{1,50}$",
+  "regexErrorMessage": "Consent category ID should be 1-50 alphanumeric characters, underscores, or hyphens",
   "default": [
     {
       "consent": ""
     }
   ]
 }

These changes would enhance user guidance and data validation in the consent management section.


217-221: Approve addition of sdkTemplate and suggest clarity improvement

The addition of the sdkTemplate section is a good preparation for future SDK-specific configurations.

To improve clarity and maintainability, consider adding a more descriptive comment about the purpose of this section and when it might be populated. For example:

 "sdkTemplate": {
   "title": "SDK settings",
-  "note": "not visible in the ui",
+  "note": "This section is reserved for future SDK-specific configurations and is not visible in the UI. It will be populated as new SDK features are implemented.",
   "fields": []
 },

This change would provide better context for other developers who might work on this configuration in the future.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 4a00440 and 3bfc758.

📒 Files selected for processing (2)
  • src/configurations/destinations/google_adwords_remarketing_lists/db-config.json (1 hunks)
  • src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json (5 hunks)
🧰 Additional context used
🔇 Additional comments (1)
src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json (1)

Line range hint 1-353: Summary: Approve overall changes and alignment with PR objectives

The restructuring of the ui-config.json file for the Google AdWords Remarketing Lists destination aligns well with the PR objective of moving GARL destination to a new form builder. The changes introduce several improvements:

  1. Enhanced organization with a hierarchical structure (baseTemplate and sdkTemplate).
  2. Improved user guidance through additional note fields and clearer labeling.
  3. Integration of consent management options, aligning with modern data privacy practices.
  4. Preparation for future expansions with placeholder sections like sdkTemplate.

These changes should result in a more maintainable configuration and an improved user experience when setting up the GARL destination.

To ensure these changes don't introduce any breaking changes or inconsistencies, please run the following verification:

This script will help identify any potential issues with the transition to the new structure.

@koladilip
Copy link
Collaborator

koladilip commented Oct 22, 2024

attach screenshots or loom video

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (3)
src/configurations/destinations/google_adwords_remarketing_lists/schema.json (2)

39-48: Consider documenting consent state implications

The consent management configuration is well-structured, but would benefit from documentation explaining:

  • The difference between userDataConsent and personalizationConsent
  • The implications of each consent state (UNSPECIFIED, UNKNOWN, GRANTED, DENIED)
  • How these settings affect data handling in Google Ads

Would you like me to help create documentation for these consent settings?


22-25: Consider a more descriptive property name

The subAccount boolean property could be more descriptive. Consider renaming to isSubAccount or useSubAccount to better indicate its purpose.

-      "subAccount": {
+      "isSubAccount": {
         "type": "boolean",
         "default": false
       },
src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json (1)

Line range hint 238-249: Simplify duplicate feature flag prerequisites

The same feature flag prerequisites are repeated multiple times. Consider extracting these common conditions into a shared configuration.

Example approach:

{
  "commonPrerequisites": {
    "featureFlags": [
      {
        "configKey": "AMP_enable-gcm",
        "value": false
      },
      {
        "configKey": "AMP_enable-gcm"
      }
    ],
    "featureFlagsCondition": "or"
  }
}

Then reference this shared configuration where needed.

Also applies to: 265-276

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 3bfc758 and 48aa33a.

📒 Files selected for processing (2)
  • src/configurations/destinations/google_adwords_remarketing_lists/schema.json (1 hunks)
  • src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json (5 hunks)
🔇 Additional comments (7)
src/configurations/destinations/google_adwords_remarketing_lists/schema.json (3)

6-9: LGTM! Good security defaults and data type restrictions

The configuration for user data handling is well-structured with secure defaults:

  • isHashRequired: true ensures data hashing by default
  • userSchema properly restricts to known data types
  • typeOfList aligns with Google Ads remarketing list types

Also applies to: 26-38


6-48: Verify required properties and consent integration

Please consider:

  1. Should any of the new properties be marked as required? For example, customerId might be mandatory for Google Ads integration.
  2. How do the new consent properties (userDataConsent, personalizationConsent) interact with existing consent mechanisms (oneTrustCookieCategories, ketchConsentPurposes)?
#!/bin/bash
# Search for usage of consent-related code
rg -g '*.{js,jsx,ts,tsx}' -A 5 'oneTrustCookieCategories|ketchConsentPurposes|userDataConsent|personalizationConsent'

10-21: Verify ID field patterns against Google Ads API requirements

The regex pattern for audienceId, customerId, and loginCustomerId allows for template variables, environment variables, and direct values up to 100 characters. Please verify that this aligns with Google Ads API requirements for these identifiers.

✅ Verification successful

Let me gather more specific information about these fields.


Based on the search results, I can now generate the final response since we have sufficient context from both the schema and UI configuration files.

ID field patterns are correctly implemented and validated

The patterns for audienceId, customerId, and loginCustomerId are properly implemented with:

  • Consistent validation across schema.json and ui-config.json
  • Appropriate example formats in placeholders (e.g., "9693X29833")
  • Clear error messages for invalid inputs
  • Support for template variables and environment variables as required
  • 100-character limit that aligns with typical Google Ads ID formats
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any existing usage of these fields to ensure pattern compatibility
rg -g '*.{js,jsx,ts,tsx}' -A 2 'audienceId|customerId|loginCustomerId' 

Length of output: 4994


Script:

#!/bin/bash
# Search for implementation details and usage patterns of these specific fields
rg -g '*.{js,jsx,ts,tsx,json}' -A 5 'audienceId|customerId|loginCustomerId' src/configurations/destinations/google_adwords_remarketing_lists/

Length of output: 5409

src/configurations/destinations/google_adwords_remarketing_lists/ui-config.json (4)

2-88: LGTM: Well-structured connection settings

The new hierarchical structure with proper field validation and prerequisites handling is well-implemented. The connection settings group provides clear organization of related fields.


89-216: LGTM: Comprehensive configuration settings

The configuration settings section is well-structured with:

  • Clear list type options
  • Proper consent management fields
  • Conditional schema fields based on list type

217-221: Verify if empty SDK template section is needed

The SDK template section is marked as "not visible in the ui" and contains no fields. Please confirm if this section is necessary for future use or can be removed.


Line range hint 222-351: LGTM: Improved consent management implementation

The transition to tagInput for consent management and support for multiple consent providers is well-implemented. The deprecation notice for category names is clear and provides good guidance.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (3)
src/configurations/destinations/google_adwords_remarketing_lists/schema.json (2)

7-26: Document the regex pattern constraints

The string fields use a common regex pattern that allows:

  • Template variables: {{...||...}}
  • Environment variables: env.*
  • Direct values (limited to 100 characters)

Consider adding JSDoc comments to explain these constraints and provide examples.

Example documentation:

 "audienceId": {
+  "description": "Audience ID for remarketing list. Supports template variables ({{var||default}}), environment variables (env.*), or direct values (max 100 chars).",
+  "examples": ["{{audienceId||123}}", "env.AUDIENCE_ID", "123456789"],
   "type": "string",
   "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$"
 },

35-49: Review default values for consent fields

Setting UNSPECIFIED as the default for consent fields (userDataConsent and personalizationConsent) might not align with privacy-first practices. Consider:

  1. The implications of processing data with unspecified consent
  2. Whether a more restrictive default like DENIED would be more appropriate
  3. If consent should be explicitly set rather than having a default

Consider these privacy-focused improvements:

  1. Remove defaults for consent fields to force explicit consent decisions
  2. Add validation to ensure consent is specified when certain features are used
  3. Document the privacy implications of each consent value
test/data/validation/destinations/google_adwords_remarketing_lists.json (1)

4-5: Use realistic test data for customerId field.

The customerId value "dfashethdetyjetyj" appears to be a placeholder. Consider using realistic test data that matches Google Ads customer ID format (e.g., "123-456-7890") to make the tests more meaningful.

-      "customerId": "dfashethdetyjetyj",
+      "customerId": "123-456-7890",

Also applies to: 57-58

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 48aa33a and 9db427d.

📒 Files selected for processing (2)
  • src/configurations/destinations/google_adwords_remarketing_lists/schema.json (1 hunks)
  • test/data/validation/destinations/google_adwords_remarketing_lists.json (5 hunks)
🔇 Additional comments (3)
src/configurations/destinations/google_adwords_remarketing_lists/schema.json (2)

27-34: 🛠️ Refactor suggestion

Consider adding format validation for user schema fields

While the schema defines allowed values for user data (email, phone, addressInfo), it doesn't specify format validation for these fields. This could lead to invalid data being accepted.

Let's check if format validation exists elsewhere:

#!/bin/bash
# Search for any validation logic related to these fields
rg -A 5 -B 5 'email|phone|addressInfo' --type ts --type js

Consider adding format validation:

 "userSchema": {
   "type": "array",
   "items": {
     "type": "string",
     "enum": ["email", "phone", "addressInfo"]
+    "if": { "const": "email" },
+    "then": {
+      "format": "email"
+    },
+    "else": {
+      "if": { "const": "phone" },
+      "then": {
+        "pattern": "^\\+[1-9]\\d{1,14}$"
+      }
+    }
   },
   "default": ["email"]
 },

5-5: ⚠️ Potential issue

⚠️ Breaking Change: New required fields added

Adding customerId and subAccount as required fields is a breaking change that could affect existing configurations. This contradicts the PR objective stating "no breaking changes".

Let's verify the impact:

Consider one of these approaches:

  1. Make these fields optional to maintain backward compatibility
  2. Provide migration scripts for existing configurations
  3. Document this as a breaking change and increment the major version
test/data/validation/destinations/google_adwords_remarketing_lists.json (1)

Line range hint 1-197: Verify schema consistency across configuration files.

Let's ensure the test cases align with the schema definition and UI configuration.

@sandeepdsvs sandeepdsvs changed the base branch from develop to release/v1.97.0 October 28, 2024 05:08
@sandeepdsvs sandeepdsvs merged commit da036f1 into release/v1.97.0 Oct 28, 2024
11 checks passed
@sandeepdsvs sandeepdsvs deleted the feat.garl-new-form-builder branch October 28, 2024 05:39
@coderabbitai coderabbitai bot mentioned this pull request Nov 4, 2024
11 tasks
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