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: accoil analytics ui #1807

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

Conversation

accoilmj
Copy link

@accoilmj accoilmj commented Nov 19, 2024

What are the changes introduced in this PR?

Adds new UI for 'Accoil Analytics' destination.

Please explain the objectives of your changes below

Adds UI for Accoil Analytics.

Destination code PR: rudderlabs/rudder-transformer#3873
Documentation PR: rudderlabs/rudderstack-docs#1196

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

  • New Features

    • Added configuration files for Accoil Analytics destination
    • Introduced comprehensive configuration and validation for analytics integration
    • Implemented consent management settings across multiple platforms
  • Documentation

    • Added detailed UI configuration and schema for destination setup
    • Included test cases for configuration validation
  • Tests

    • Created validation test suite for Accoil Analytics destination configurations

Copy link

coderabbitai bot commented Nov 19, 2024

Walkthrough

This pull request introduces a comprehensive configuration setup for the Accoil Analytics destination. The changes include three new JSON configuration files: db-config.json, schema.json, and ui-config.json, along with a test validation file. These configurations define the destination's settings, including supported source types, connection modes, consent management, and user interface parameters. The files provide a structured approach to integrating Accoil Analytics across multiple platforms like web, mobile, and cloud environments.

Changes

File Change Summary
src/configurations/destinations/accoil_analytics/db-config.json New destination configuration file with settings for supported source types, message types, and connection modes
src/configurations/destinations/accoil_analytics/schema.json New JSON schema defining configuration validation rules for Accoil Analytics destination
src/configurations/destinations/accoil_analytics/ui-config.json New UI configuration file with setup templates for connection and consent settings
test/data/validation/destinations/accoil_analytics.json Updated test validation file for Accoil Analytics configuration scenarios

Sequence Diagram

sequenceDiagram
    participant User
    participant UI
    participant AccoilAnalytics
    participant ConfigValidator

    User->>UI: Configure Destination
    UI->>ConfigValidator: Validate Configuration
    ConfigValidator->>AccoilAnalytics: Apply Validated Settings
    AccoilAnalytics-->>User: Configuration Confirmed
Loading

Possibly related PRs

Suggested reviewers

  • lvrach
  • am6010
  • AchuthaSourabhC
  • krishna2020
  • ssbeefeater

Poem

🐰 Hop, hop, config's in sight!
Accoil Analytics shining bright
JSON schemas dance with glee
Platforms linked, settings free
A rabbit's config, pure delight! 🚀


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 52ee915 and 807e1ae.

📒 Files selected for processing (2)
  • src/configurations/destinations/accoil_analytics/ui-config.json (1 hunks)
  • test/data/validation/destinations/accoil_analytics.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/data/validation/destinations/accoil_analytics.json
  • src/configurations/destinations/accoil_analytics/ui-config.json

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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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: 3

🧹 Outside diff range and nitpick comments (7)
src/configurations/destinations/accoil_analytics/db-config.json (2)

14-14: Consider documenting the empty excludeKeys array

The excludeKeys array is empty. If this is intentional, consider adding a comment in the documentation PR (rudderlabs/rudderstack-docs#1196) explaining why no keys need to be excluded for this destination.


44-115: Consider reducing configuration duplication

The platform-specific configurations contain identical settings for most platforms. Consider refactoring to use a common configuration template to improve maintainability.

 "destConfig": {
   "defaultConfig": ["apiKey", "blacklistedEvents", "whitelistedEvents", "eventFilteringOption"],
+  "commonConfig": [
+    "connectionMode",
+    "consentManagement",
+    "oneTrustCookieCategories",
+    "ketchConsentPurposes"
+  ],
   "web": [
     "useNativeSDK",
-    "connectionMode",
-    "consentManagement",
-    "oneTrustCookieCategories",
-    "ketchConsentPurposes"
+    ...commonConfig
   ],
   // Apply similar pattern to other platforms
src/configurations/destinations/accoil_analytics/ui-config.json (3)

60-64: Clarify purpose of empty SDK Template.

The SDK template section is marked as "not visible in the ui" and contains no fields. If this section is not needed, consider removing it to avoid confusion in future maintenance.


81-92: Simplify duplicate feature flag conditions.

The OneTrust and Ketch sections have identical feature flag conditions. Consider extracting these to a shared configuration to improve maintainability.

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

Then reference this shared configuration in both sections.

Also applies to: 106-117


172-173: Fix inconsistent apostrophe usage.

Change ID's to IDs for consistency with other occurrences in the file.

-"label": "Enter consent category ID's",
+"label": "Enter consent category IDs",
src/configurations/destinations/accoil_analytics/schema.json (2)

7-10: Consider strengthening the API key pattern validation

The current pattern (^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$ allows any string up to 100 characters. Consider adding more specific validation for the API key format to prevent invalid keys.

       "apiKey": {
         "type": "string",
-        "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$"
+        "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^([a-zA-Z0-9_-]{32,100})$",
+        "description": "Accoil Analytics API key. Must be 32-100 characters long and contain only alphanumeric characters, underscores, and hyphens."
       }

845-858: Consider adding validation for native SDK configuration

The useNativeSDK configuration lacks constraints that might be important:

  1. No default values are specified
  2. No description of the implications of enabling/disabling native SDK
  3. No validation to ensure consistent settings across platforms
    "useNativeSDK": {
      "type": "object",
+     "description": "Configuration for native SDK usage per platform",
      "properties": {
        "web": {
-         "type": "boolean"
+         "type": "boolean",
+         "default": false,
+         "description": "Enable/disable native SDK for web platform"
        },
        "android": {
-         "type": "boolean"
+         "type": "boolean",
+         "default": false,
+         "description": "Enable/disable native SDK for Android platform"
        },
        "ios": {
-         "type": "boolean"
+         "type": "boolean",
+         "default": false,
+         "description": "Enable/disable native SDK for iOS platform"
        }
      }
    }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between a039627 and 20993ae.

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

116-120: LGTM! Security configuration and beta status are properly set

The API key is correctly marked as secret and the beta status is appropriately indicated.


28-30: Verify supported message types configuration

Message types are only defined for the "cloud" source. Please verify if this is intentional and aligns with the destination implementation in rudderlabs/rudder-transformer#3873.

#!/bin/bash
# Check message type configurations in other destinations
rg -A 5 '"supportedMessageTypes"' src/configurations/destinations/

47-47: Verify native SDK support configuration

The useNativeSDK option is only available for web, android, and ios platforms. Please verify this aligns with the actual SDK capabilities in the destination implementation (rudderlabs/rudder-transformer#3873).

#!/bin/bash
# Check native SDK support patterns in other destinations
rg '"useNativeSDK"' src/configurations/destinations/

Also applies to: 54-54, 61-61


1-121: Verify schema validation

Please ensure that the configuration aligns with the validation rules defined in the accompanying schema.json file, particularly for required fields and value constraints.

✅ Verification successful

Configuration validated successfully

The db-config.json aligns perfectly with the schema.json requirements:

  • Required apiKey field is present in the defaultConfig
  • All optional fields (oneTrustCookieCategories, connectionMode, consentManagement, ketchConsentPurposes) are properly structured
  • Connection modes are correctly set to "cloud" across all platforms
  • Platform-specific configurations follow the defined schema patterns
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Find and check the corresponding schema file
fd -t f schema.json src/configurations/destinations/accoil_analytics/

Length of output: 24843


Script:

#!/bin/bash
# Let's check the schema file for Accoil Analytics specifically
cat src/configurations/destinations/accoil_analytics/schema.json

Length of output: 25654


7-7: Verify privacy implications of saving destination responses

The configuration enables saving destination responses. Please ensure this doesn't inadvertently store sensitive user data or PII.

✅ Verification successful

Saving destination responses is a common and safe practice

The search results show that saveDestinationResponse is a standard configuration used across many destinations, with most destinations having it enabled (true). This is a built-in feature of the platform that helps with debugging and monitoring integrations. Only a few destinations like GA4, Firebase, GTM, and Pinterest Tag explicitly disable this feature.

The configuration follows the established pattern and doesn't introduce any privacy concerns as:

  1. It's a system-level configuration for debugging purposes
  2. The platform has built-in controls through includeKeys and excludeKeys to manage what data gets saved
  3. Many sensitive destinations (payment, analytics, etc.) safely use this configuration
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check other destinations for similar settings and any associated privacy controls
rg -l "saveDestinationResponse.*true" src/configurations/destinations/

Length of output: 24843


Script:

#!/bin/bash
# Let's search for saveDestinationResponse configuration in other destinations
rg -A 2 '"saveDestinationResponse"' src/configurations/destinations/

Length of output: 63033

src/configurations/destinations/accoil_analytics/ui-config.json (3)

50-56: Verify empty consent settings section.

The consent settings section has an empty groups array, while detailed consent configurations exist in consentSettingsTemplate. Consider:

  1. Either removing this empty section if it's not needed
  2. Or moving the relevant groups from consentSettingsTemplate here
#!/bin/bash
# Check if other destinations follow similar pattern
fd -e json -x jq -r 'select(.uiConfig.baseTemplate[].sections[].id == "consentSettings") | input_filename' {} \; 2>/dev/null

184-191: ⚠️ Potential issue

Review conflicting feature flag conditions.

The feature flag AMP_enable-gcm appears with different values across the file:

  • false in OneTrust/Ketch sections
  • true in the dynamicCustomForm section

This could lead to unexpected behavior where some consent management features are hidden while others are visible.

#!/bin/bash
# Check for other occurrences of this feature flag
rg -l "AMP_enable-gcm" | xargs jq -r 'paths as $p | select(getpath($p) == "AMP_enable-gcm") | $p | join(".")'

39-40: ⚠️ Potential issue

Connection mode section requires configuration.

The fields array is empty, but the section is present with a title and note. This could lead to confusion as users might expect configuration options here.

src/configurations/destinations/accoil_analytics/schema.json (1)

796-844: Verify connection mode constraints

The connection mode is restricted to "cloud" for all platforms. Verify if this is intentional and if other modes might be needed in the future.

✅ Verification successful

Connection mode restriction is appropriate for this destination

The "cloud" only restriction for all platforms in accoil_analytics is consistent with most other destinations. While Adobe Analytics supports both "cloud" and "device" modes for some platforms, this appears to be an exception rather than the norm. Other major destinations like Zendesk, Salesforce, and Snowflake also restrict their connection modes to "cloud" only, indicating this is a standard pattern.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if other destinations support additional connection modes

# Search for connection mode configurations in other destination schemas
fd . src/configurations/destinations -e json -x grep -l "connectionMode"

Length of output: 23737


Script:

#!/bin/bash
# Let's check the connection mode configurations in other destination schemas
# We'll sample a few schemas to see if they have different connection modes

# Check Adobe Analytics schema
echo "=== Adobe Analytics Connection Mode ==="
rg -A 10 '"connectionMode":\s*{' src/configurations/destinations/adobe_analytics/schema.json

echo -e "\n=== Zendesk Connection Mode ==="
rg -A 10 '"connectionMode":\s*{' src/configurations/destinations/zendesk/schema.json

echo -e "\n=== Salesforce Connection Mode ==="
rg -A 10 '"connectionMode":\s*{' src/configurations/destinations/salesforce/schema.json

echo -e "\n=== Snowflake Connection Mode ==="
rg -A 10 '"connectionMode":\s*{' src/configurations/destinations/snowflake/schema.json

Length of output: 1120


Script:

#!/bin/bash
# Let's fix the regex and check connection modes in other destination schemas

# Check Adobe Analytics schema
echo "=== Adobe Analytics Connection Mode ==="
rg -A 10 '"connectionMode"' src/configurations/destinations/adobe_analytics/schema.json

echo -e "\n=== Zendesk Connection Mode ==="
rg -A 10 '"connectionMode"' src/configurations/destinations/zendesk/schema.json

echo -e "\n=== Salesforce Connection Mode ==="
rg -A 10 '"connectionMode"' src/configurations/destinations/salesforce/schema.json

echo -e "\n=== Snowflake Connection Mode ==="
rg -A 10 '"connectionMode"' src/configurations/destinations/snowflake/schema.json

Length of output: 1752

@accoilmj accoilmj force-pushed the accoil-analytics-destination-ui branch from 20993ae to cfcf256 Compare November 19, 2024 01:26
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 (1)
src/configurations/destinations/accoil_analytics/schema.json (1)

796-844: Simplify connection mode configuration

The connection mode configuration can be simplified since all platforms use the same "cloud" enum.

Apply this refactor:

{
  "configSchema": {
    "properties": {
      "connectionMode": {
        "type": "object",
+       "additionalProperties": {
+         "type": "string",
+         "enum": ["cloud"]
+       },
        "properties": {
-         "cloud": {
-           "type": "string",
-           "enum": ["cloud"]
-         },
-         "android": {
-           "type": "string",
-           "enum": ["cloud"]
-         },
          // ... remove all platform-specific definitions
        }
      }
    }
  }
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 20993ae and cfcf256.

📒 Files selected for processing (3)
  • src/configurations/destinations/accoil_analytics/db-config.json (1 hunks)
  • src/configurations/destinations/accoil_analytics/schema.json (1 hunks)
  • src/configurations/destinations/accoil_analytics/ui-config.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/configurations/destinations/accoil_analytics/db-config.json
  • src/configurations/destinations/accoil_analytics/ui-config.json
🔇 Additional comments (4)
src/configurations/destinations/accoil_analytics/schema.json (4)

1-10: LGTM: Root schema and API key configuration

The schema version and API key validation are properly configured. The pattern allows for environment variables and template strings while limiting the key length to 100 characters.


845-858: LGTM: Native SDK configuration

The Native SDK configuration is well-structured and appropriately limited to web, android, and ios platforms.


11-147: 🛠️ Refactor suggestion

Reduce code duplication in platform configurations

The OneTrust cookie categories configuration is identical across all platforms, leading to significant code duplication.

Apply this refactor to improve maintainability:

{
  "configSchema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
+   "definitions": {
+     "oneTrustCookieCategory": {
+       "type": "array",
+       "items": {
+         "type": "object",
+         "properties": {
+           "oneTrustCookieCategory": {
+             "type": "string",
+             "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$"
+           }
+         }
+       }
+     }
+   },
    "properties": {
      "oneTrustCookieCategories": {
        "type": "object",
        "properties": {
-         "cloud": {
-           "type": "array",
-           "items": {
-             "type": "object",
-             "properties": {
-               "oneTrustCookieCategory": {
-                 "type": "string",
-                 "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$"
-               }
-             }
-           }
-         },
+         "cloud": { "$ref": "#/definitions/oneTrustCookieCategory" },
+         "android": { "$ref": "#/definitions/oneTrustCookieCategory" },
          // ... repeat for other platforms
        }
      }
    }
  }
}

285-795: 🛠️ Refactor suggestion

Improve consent management configuration structure

The consent management configuration has significant duplication and could be better structured.

Apply this refactor:

{
  "configSchema": {
    "definitions": {
+     "consentConfig": {
+       "type": "object",
+       "properties": {
+         "provider": {
+           "type": "string",
+           "enum": ["custom", "ketch", "oneTrust"],
+           "default": "oneTrust"
+         },
+         "consents": {
+           "type": "array",
+           "items": {
+             "type": "object",
+             "properties": {
+               "consent": {
+                 "type": "string",
+                 "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$"
+               }
+             }
+           }
+         }
+       },
+       "allOf": [
+         {
+           "if": {
+             "properties": {
+               "provider": { "const": "custom" }
+             },
+             "required": ["provider"]
+           },
+           "then": {
+             "properties": {
+               "resolutionStrategy": {
+                 "type": "string",
+                 "enum": ["and", "or"]
+               }
+             },
+             "required": ["resolutionStrategy"]
+           }
+         }
+       ]
+     }
    },
    "properties": {
      "consentManagement": {
        "type": "object",
        "properties": {
-         "cloud": {
-           "type": "array",
-           "items": { ... }
-         },
+         "cloud": { "$ref": "#/definitions/consentConfig" },
+         "android": { "$ref": "#/definitions/consentConfig" },
          // ... repeat for other platforms
        }
      }
    }
  }
}

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: 0

🧹 Outside diff range and nitpick comments (1)
src/configurations/destinations/accoil_analytics/schema.json (1)

285-795: Consider adding validation for empty consent arrays.

While the conditional logic for resolution strategy is well implemented, consider adding a minimum length requirement for the consents array when a provider is specified. This would prevent configurations with a provider but no actual consents.

Example validation to add (shown for one platform, apply to all):

{
  "if": {
    "properties": {
      "provider": {
        "type": "string"
      }
    },
    "required": ["provider"]
  },
  "then": {
    "properties": {
      "consents": {
        "minItems": 1
      }
    },
    "required": ["consents"]
  }
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 89d72b2 and 0198392.

📒 Files selected for processing (3)
  • src/configurations/destinations/accoil_analytics/db-config.json (1 hunks)
  • src/configurations/destinations/accoil_analytics/schema.json (1 hunks)
  • src/configurations/destinations/accoil_analytics/ui-config.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/configurations/destinations/accoil_analytics/ui-config.json
  • src/configurations/destinations/accoil_analytics/db-config.json
🧰 Additional context used
📓 Learnings (1)
src/configurations/destinations/accoil_analytics/schema.json (3)
Learnt from: accoilmj
PR: rudderlabs/rudder-integrations-config#1807
File: src/configurations/destinations/accoil_analytics/schema.json:148-284
Timestamp: 2024-12-09T04:17:28.675Z
Learning: The file `src/configurations/destinations/accoil_analytics/schema.json` is autogenerated. Avoid suggesting changes to autogenerated files.
Learnt from: accoilmj
PR: rudderlabs/rudder-integrations-config#1807
File: src/configurations/destinations/accoil_analytics/schema.json:285-795
Timestamp: 2024-12-09T04:17:16.931Z
Learning: The file `src/configurations/destinations/accoil_analytics/schema.json` is autogenerated.
Learnt from: accoilmj
PR: rudderlabs/rudder-integrations-config#1807
File: src/configurations/destinations/accoil_analytics/schema.json:11-147
Timestamp: 2024-12-09T04:17:05.013Z
Learning: The file `src/configurations/destinations/accoil_analytics/schema.json` is autogenerated and should not be manually modified.
🔇 Additional comments (3)
src/configurations/destinations/accoil_analytics/schema.json (3)

1-10: LGTM! Root schema configuration is well-structured.

The schema correctly enforces API key requirements with a secure pattern that supports both direct values and environment variables.


796-844: LGTM! Connection mode configuration is consistent.

The schema correctly enforces cloud-only mode across all platforms, which is appropriate for this analytics destination.


845-858: LGTM! Native SDK configuration is appropriately scoped.

The schema correctly limits native SDK configuration to relevant platforms (web, android, ios) with simple boolean toggles.

@accoilmj accoilmj requested a review from manish339k December 9, 2024 04:32
@accoilmj
Copy link
Author

Hi @manish339k just checking in if there's anything further I need to work on here? Thanks.

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

@accoilmj accoilmj force-pushed the accoil-analytics-destination-ui branch from 0198392 to 7291c52 Compare January 7, 2025 01:49
@accoilmj
Copy link
Author

accoilmj commented Jan 7, 2025

Rebased and pushed to fix staleness

@manish339k
Copy link
Contributor

@accoilmj
Copy link
Author

Please add data validation test. ref: https://github.com/rudderlabs/rudder-integrations-config/blob/develop/test/data/validation/destinations/active_campaign.json

@manish339k I've added this test. When running locally it complained about having one trust cookie and ketch enabled. I removed them from the ui-config and now it passes. I'm not sure if this is correct though?

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: 0

🧹 Nitpick comments (4)
test/data/validation/destinations/accoil_analytics.json (4)

1-15: Enhance basic API configuration test coverage.

Consider adding the following test cases:

  1. Invalid apiUrl format validation
  2. apiKey pattern/length validation
  3. Empty string values for required fields

16-128: Add edge cases for consent management provider validation.

The test suite should include additional cases:

  1. Empty consents array validation for custom provider
  2. Empty consents array validation for oneTrust provider
  3. Invalid consent names/values

129-285: Improve platform-specific configuration validation.

Consider adding test cases for:

  1. Cross-platform configuration consistency
  2. Maximum number of categories/purposes per platform
  3. Duplicate category/purpose validation

286-362: Add common error scenarios to format validation.

Consider adding test cases for:

  1. Null values in required fields
  2. Invalid UTF-8 characters
  3. Mixed case sensitivity in enum values (provider names, resolutionStrategy)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7291c52 and 6569936.

📒 Files selected for processing (3)
  • src/configurations/destinations/accoil_analytics/ui-config.json (1 hunks)
  • src/configurations/destinations/ga4_v2/ui-config.json (2 hunks)
  • test/data/validation/destinations/accoil_analytics.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/configurations/destinations/ga4_v2/ui-config.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/configurations/destinations/accoil_analytics/ui-config.json
🔇 Additional comments (2)
test/data/validation/destinations/accoil_analytics.json (2)

165-165: ⚠️ Potential issue

Review template syntax for potential injection vulnerabilities.

The template syntax {{ event.properties.prop1 || 'val' }} could potentially allow for injection attacks. Consider:

  1. Adding strict validation for allowed template patterns
  2. Documenting safe template usage
  3. Adding test cases for malicious template patterns

Run this script to check for similar template patterns in the codebase:

Also applies to: 226-226


1-362: Ensure test cases align with documentation.

Please verify that all test cases align with:

  1. The UI configuration in the related PR (feat: accoil analytics destination rudder-transformer#3873)
  2. The documentation in the related PR (feat: accoil analytics documentation rudderstack-docs#1196)

Run this script to check documentation consistency:

✅ Verification successful

Test cases provide comprehensive validation coverage ✓

The test file includes thorough validation for all configuration aspects:

  • Required fields and type checking
  • Consent management providers and resolution strategies
  • Platform-specific configurations
  • Edge cases and error conditions
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Fetch and compare documentation
gh api repos/rudderlabs/rudderstack-docs/pulls/1196/files -q '.[] | select(.filename | contains("accoil")) | .patch' | grep -E '^\+.*\b(apiKey|eventKey|actid|provider|resolutionStrategy)\b'

Length of output: 191


Script:

#!/bin/bash
# Search for Accoil documentation and configuration
echo "=== Documentation files ==="
fd -t f -e md accoil

echo -e "\n=== UI Configuration ==="
fd -t f -e json accoil
fd -t f -g "*destination*.json" | xargs grep -l "accoil"

echo -e "\n=== Schema Definition ==="
fd -t f -g "*schema*.json" | xargs grep -l -i "accoil"

Length of output: 412


Script:

#!/bin/bash
# Look for schema validation rules
echo "=== Destination Schema ==="
rg -l "accoil" -g "*.json" | xargs cat

echo -e "\n=== Settings Definition ==="
rg -A 10 "settings.*schema" -g "*.json"

Length of output: 9141

@accoilmj accoilmj force-pushed the accoil-analytics-destination-ui branch from 6569936 to 52ee915 Compare January 25, 2025 05:21
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: 0

🧹 Nitpick comments (3)
src/configurations/destinations/accoil_analytics/schema.json (3)

7-10: Consider strengthening API key validation.

The API key pattern allows both direct values and environment variables, which is good for flexibility. However, consider adding:

  1. A minimum length requirement to prevent empty or very short keys
  2. Additional character restrictions for direct values to enhance security
       "apiKey": {
         "type": "string",
-        "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^[0-9a-zA-Z_]{1,80}$"
+        "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^[0-9a-zA-Z_]{32,80}$"
       },

796-844: Document connection mode restrictions.

All platforms are restricted to "cloud" mode. Consider adding a description field to explain why this is the only supported mode and any future plans for additional modes.

       "connectionMode": {
         "type": "object",
+        "description": "Connection mode configuration. Currently only supports cloud mode across all platforms.",
         "properties": {

845-858: Consider adding default values for Native SDK settings.

The configuration would benefit from explicit default values to ensure consistent behavior when values are not provided.

           "web": {
-            "type": "boolean"
+            "type": "boolean",
+            "default": false
           },
           "android": {
-            "type": "boolean"
+            "type": "boolean",
+            "default": false
           },
           "ios": {
-            "type": "boolean"
+            "type": "boolean",
+            "default": false
           }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6569936 and 52ee915.

📒 Files selected for processing (5)
  • src/configurations/destinations/accoil_analytics/db-config.json (1 hunks)
  • src/configurations/destinations/accoil_analytics/schema.json (1 hunks)
  • src/configurations/destinations/accoil_analytics/ui-config.json (1 hunks)
  • src/configurations/destinations/ga4_v2/ui-config.json (1 hunks)
  • test/data/validation/destinations/accoil_analytics.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • test/data/validation/destinations/accoil_analytics.json
  • src/configurations/destinations/accoil_analytics/db-config.json
  • src/configurations/destinations/accoil_analytics/ui-config.json
  • src/configurations/destinations/ga4_v2/ui-config.json
🧰 Additional context used
📓 Learnings (1)
src/configurations/destinations/accoil_analytics/schema.json (3)
Learnt from: accoilmj
PR: rudderlabs/rudder-integrations-config#1807
File: src/configurations/destinations/accoil_analytics/schema.json:148-284
Timestamp: 2024-12-09T04:17:28.675Z
Learning: The file `src/configurations/destinations/accoil_analytics/schema.json` is autogenerated. Avoid suggesting changes to autogenerated files.
Learnt from: accoilmj
PR: rudderlabs/rudder-integrations-config#1807
File: src/configurations/destinations/accoil_analytics/schema.json:285-795
Timestamp: 2024-12-09T04:17:16.931Z
Learning: The file `src/configurations/destinations/accoil_analytics/schema.json` is autogenerated.
Learnt from: accoilmj
PR: rudderlabs/rudder-integrations-config#1807
File: src/configurations/destinations/accoil_analytics/schema.json:11-147
Timestamp: 2024-12-09T04:17:05.013Z
Learning: The file `src/configurations/destinations/accoil_analytics/schema.json` is autogenerated and should not be manually modified.
🔇 Additional comments (2)
src/configurations/destinations/accoil_analytics/schema.json (2)

285-795: Well-structured consent management configuration.

The implementation demonstrates good practices:

  • Proper use of JSON Schema conditionals for provider-specific requirements
  • Consistent pattern validation across platforms
  • Sensible default provider

1-861: Verify schema completeness against similar destinations.

Let's ensure all necessary configuration options are included by comparing with other analytics destinations.

✅ Verification successful

Schema structure is complete and appropriate for the destination

The schema includes all essential configuration options required for an analytics destination with cloud mode operation. The absence of event filtering capabilities appears intentional based on the implementation context.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Find and analyze schemas of similar analytics destinations
echo "Searching for other analytics destination schemas..."
fd -e json -p 'src/configurations/destinations/.*/schema.json' | grep -i 'analytics' | grep -v 'accoil' | while read -r file; do
  echo "=== Analyzing $file ==="
  # Extract top-level properties for comparison
  jq -r '.configSchema.properties | keys[]' "$file"
done

Length of output: 1213


Script:

#!/bin/bash
# Search for event filtering patterns in Accoil implementation
echo "=== Searching for event filtering implementation ==="
rg -l "eventFilter|blacklist|whitelist" src/configurations/destinations/accoil_analytics/

echo -e "\n=== Checking transformer implementation ==="
rg -A 5 "class Accoil" src/configurations/destinations/accoil_analytics/

Length of output: 384


Script:

#!/bin/bash
# Search for implementation files with broader patterns
echo "=== Searching for Accoil implementation files ==="
fd . src/configurations/destinations/accoil_analytics/

echo -e "\n=== Checking for transformer patterns ==="
rg -l "transform|track|event" src/configurations/destinations/accoil_analytics/

echo -e "\n=== Checking git history for implementation context ==="
git log -n 1 --stat src/configurations/destinations/accoil_analytics/

Length of output: 790

@accoilmj accoilmj force-pushed the accoil-analytics-destination-ui branch from 52ee915 to 807e1ae Compare January 25, 2025 05:25
@manish339k
Copy link
Contributor

cc: @utsabc / @ItsSudip for review.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants