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

Gainsight PX Device Mode new integration #1684

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

Conversation

gs-nwolfe
Copy link

@gs-nwolfe gs-nwolfe commented Sep 16, 2024

What are the changes introduced in this PR?

New Gainsight PX device mode integration

What is the related Linear task?

n/a

Please explain the objectives of your changes below

The intention is to allow customers to load the Gainsight PX javascript SDK in the browser and send events directly to Gainsight PX from the client side. This new integration will likely be used more than the existing home-grown Gainsight PX integration that uses the REST API to send events from server-to-server.

To avoid conflicts with the existing Gainsight PX integration, I used the name of "GAINSIGHT_PX_BROWSER".
There are corresponding PR's to the sdk-js and docs repos.
Docs PR: rudderlabs/rudderstack-docs#1193

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?

  • [n/a] 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

    • Introduced a new configuration file for Gainsight PX browser integration, enhancing user customization options.
    • Added structured settings for connection, SDK usage, event filtering, and consent management in the user interface configuration.
    • Implemented a schema for configuration management, providing a foundation for future enhancements.
  • Documentation

    • New configuration files created to support structured management of Gainsight PX browser settings.

@Gauravudia
Copy link
Contributor

@gs-nwolfe No need to create a new destination GAINSIGHT_PX_BROWSER for device mode usecase. We need to leverage the existing destination GAINSIGHT_PX developed for cloud mode and add the device mode support.
cc- @krishna2020

PR feedback fixed problem with apiKey/productKey confusion
Placeholder for datacenter
@gs-nwolfe
Copy link
Author

@gs-nwolfe No need to create a new destination GAINSIGHT_PX_BROWSER for device mode usecase. We need to leverage the existing destination GAINSIGHT_PX developed for cloud mode and add the device mode support. cc- @krishna2020

@Gauravudia - Can you clarify what needs to be done here? I see the existing "GAINSIGHT_PX" entry in ./configurations/destinations/gainsight_px/db-config.json. How should we go about merging this one with my new destination? I don't want to break any of our existing customers that are already using the old cloud mode destination.

@Gauravudia Gauravudia requested a review from utsabc October 1, 2024 06:08
@Gauravudia
Copy link
Contributor

@gs-nwolfe No need to create a new destination GAINSIGHT_PX_BROWSER for device mode usecase. We need to leverage the existing destination GAINSIGHT_PX developed for cloud mode and add the device mode support. cc- @krishna2020

@Gauravudia - Can you clarify what needs to be done here? I see the existing "GAINSIGHT_PX" entry in ./configurations/destinations/gainsight_px/db-config.json. How should we go about merging this one with my new destination? I don't want to break any of our existing customers that are already using the old cloud mode destination.

We to have update the ./configurations/destinations/gainsight_px/db-config.json to add the support for device mode.
You can refer this destination which is supported in both device and cloud mode.

Copy link

coderabbitai bot commented Oct 7, 2024

Walkthrough

Three new configuration files have been added for the Gainsight PX browser integration: db-config.json, schema.json, and ui-config.json. The db-config.json file outlines key properties and settings for the integration, including processing methods and key management. The schema.json file establishes a placeholder for configuration schema management. The ui-config.json file provides a structured configuration for user interface settings, organizing various user input fields into sections that cover connection settings, SDK usage, event filtering, and consent management.

Changes

File Path Change Summary
src/configurations/destinations/gainsight_px_browser/db-config.json New configuration file defining integration properties and settings.
src/configurations/destinations/gainsight_px_browser/schema.json New configuration file with a key configSchema set to null, indicating a structure for schema management.
src/configurations/destinations/gainsight_px_browser/ui-config.json New configuration file organizing user interface settings into sections: Connection Settings, Native SDK, Client-side Events Filtering, and Consent Settings.

Possibly related PRs

  • feat: gainsight px device mode support #1741: The changes in this PR involve updates to the db-config.json and schema.json files for Gainsight PX, which are directly related to the new configuration file db-config.json introduced in the main PR, as both involve defining keys and settings for Gainsight PX configurations.

Suggested reviewers

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

Poem

In the garden of code, new files bloom,
db-config, schema, ui-config loom.
With settings and keys, they dance in delight,
Crafting a browser that shines ever bright.
Hop, hop, hooray! Let the changes take flight! 🐇✨


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.

PR feedback - removed extra config
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 (4)
src/configurations/destinations/gainsight_px_browser/db-config.json (4)

1-3: Consider merging with existing Gainsight PX integration

The PR objectives suggest updating the existing "GAINSIGHT_PX" destination to support both cloud and device modes, rather than creating a new "GAINSIGHT_PX_BROWSER" destination. This approach would align with the suggestion made by Gauravudia in the PR comments.

Consider discussing with the team whether it would be more appropriate to update the existing Gainsight PX integration in ./configurations/destinations/gainsight_px/db-config.json to support both cloud and device modes, similar to the Ninetailed destination mentioned in the PR comments. This could help streamline the integration process and avoid redundancy.


4-20: Configuration looks good, minor suggestion for clarity

The configuration in this section is well-structured and aligns with the PR objectives. It correctly specifies the supported source types, connection modes, and message types for the device mode integration.

For improved clarity, consider adding a brief comment explaining the purpose of the transformAtV1 and saveDestinationResponse settings. This would help other developers understand the significance of these configurations.


21-32: destConfig looks good, minor optimization suggested

The destConfig section is well-structured and includes all necessary keys for both default and web-specific configurations.

To avoid redundancy, consider removing consentManagement from the web array since it's already included in the defaultConfig array. This would ensure that the key is not duplicated in the configuration.


1-35: Overall, excellent configuration with one architectural consideration

The db-config.json file is well-structured, comprehensive, and aligns closely with the PR objectives for the Gainsight PX browser integration. It correctly configures the necessary settings for device mode, including supported source types, connection modes, and message types.

While the configuration itself is solid, the main point to consider is whether this should be a separate integration (GAINSIGHT_PX_BROWSER) or an update to the existing GAINSIGHT_PX integration to support both cloud and device modes. This decision could impact the overall architecture and maintainability of the Gainsight PX integration in RudderStack. Consider discussing this with the team to ensure the chosen approach aligns with the long-term vision for the product.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6339410 and 85b0d34.

📒 Files selected for processing (3)
  • src/configurations/destinations/gainsight_px_browser/db-config.json (1 hunks)
  • src/configurations/destinations/gainsight_px_browser/schema.json (1 hunks)
  • src/configurations/destinations/gainsight_px_browser/ui-config.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/configurations/destinations/gainsight_px_browser/schema.json
🧰 Additional context used
🔇 Additional comments (5)
src/configurations/destinations/gainsight_px_browser/db-config.json (1)

33-33: secretKeys configuration is appropriate

The secretKeys array correctly includes "productKey", which is appropriate for maintaining the security of sensitive information.

This configuration aligns with best practices for handling API keys and other sensitive data.

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

3-51: Connection Settings section looks good.

The Connection Settings section is well-structured with appropriate fields:

  • The Product Key field has a suitable regex pattern for validation.
  • The Data Center options cover the necessary choices (US, EU, US2).
  • The Additional Configuration field provides flexibility for advanced users.

52-62: Native SDK section is appropriately configured.

The Native SDK section contains a single checkbox for using device-mode to send events, which aligns with the PR objective of introducing device mode integration. Setting it to true by default is a good choice for encouraging the use of this new feature.


63-117: Client-side Events Filtering section is well-designed.

The Client-side Events Filtering section provides a flexible and user-friendly configuration for event filtering:

  • Users can choose between disabling filtering, allowlisting, or denylisting events.
  • Dynamic forms for entering event names in both allowlist and denylist provide ease of use.
  • The section note clearly states that this is applicable only for device-mode integrations.

1-231: Overall, the UI configuration is well-structured and aligns with PR objectives.

The ui-config.json file provides a comprehensive and well-organized configuration for the Gainsight PX browser integration. It successfully addresses the PR objective of introducing a device mode integration with the following strengths:

  1. Clear separation of concerns with distinct sections for different aspects of the integration.
  2. Flexible options for connection settings, event filtering, and consent management.
  3. Good use of dynamic forms and select inputs to simplify user interaction.
  4. Appropriate default values and validation patterns where necessary.

The configuration strikes a good balance between simplicity for basic users and flexibility for advanced users. It should provide a solid foundation for implementing the new Gainsight PX browser integration.

@gs-nwolfe
Copy link
Author

@gs-nwolfe No need to create a new destination GAINSIGHT_PX_BROWSER for device mode usecase. We need to leverage the existing destination GAINSIGHT_PX developed for cloud mode and add the device mode support. cc- @krishna2020

@Gauravudia - Can you clarify what needs to be done here? I see the existing "GAINSIGHT_PX" entry in ./configurations/destinations/gainsight_px/db-config.json. How should we go about merging this one with my new destination? I don't want to break any of our existing customers that are already using the old cloud mode destination.

We to have update the ./configurations/destinations/gainsight_px/db-config.json to add the support for device mode. You can refer this destination which is supported in both device and cloud mode.

@Gauravudia - Thanks for the help. I need additional assistance with the merge process. The ui config for the new device mode destination is different than the config for the old cloud mode destination. I don't understand how to have two different configs in the same directory. I don't see two blocks of config info in the ninetailed destination, am I missing something? I don't want to break any existing customers that are using the current web mode destination.

@Gauravudia
Copy link
Contributor

@gs-nwolfe No need to create a new destination GAINSIGHT_PX_BROWSER for device mode usecase. We need to leverage the existing destination GAINSIGHT_PX developed for cloud mode and add the device mode support. cc- @krishna2020

@Gauravudia - Can you clarify what needs to be done here? I see the existing "GAINSIGHT_PX" entry in ./configurations/destinations/gainsight_px/db-config.json. How should we go about merging this one with my new destination? I don't want to break any of our existing customers that are already using the old cloud mode destination.

We to have update the ./configurations/destinations/gainsight_px/db-config.json to add the support for device mode. You can refer this destination which is supported in both device and cloud mode.

@Gauravudia - Thanks for the help. I need additional assistance with the merge process. The ui config for the new device mode destination is different than the config for the old cloud mode destination. I don't understand how to have two different configs in the same directory. I don't see two blocks of config info in the ninetailed destination, am I missing something? I don't want to break any existing customers that are using the current web mode destination.

I have raised the Integration config PR to add the support for device mode
Ref: #1741
We can close this PR

Copy link
Contributor

@shrouti1507 shrouti1507 left a comment

Choose a reason for hiding this comment

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

We need to enable web device mode via our existing gainsight px destination only. We can take this up internally.

@Gauravudia
Copy link
Contributor

We need to enable web device mode via our existing gainsight px destination only. We can take this up internally.

@shrouti1507 I have already raised the PR for that.
Ref: #1741

@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 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 (3)
src/configurations/destinations/gainsight_px_browser/db-config.json (1)

1-3: Merge with existing Gainsight PX destination instead of creating a new one.

Based on the PR discussion, this should be integrated into the existing Gainsight PX destination (GAINSIGHT_PX) rather than creating a new destination. This approach:

  • Maintains a single destination supporting both cloud and device modes
  • Follows the pattern used by other destinations (e.g., Ninetailed)
  • Prevents redundancy and simplifies maintenance

The configuration should be moved to ./configurations/destinations/gainsight_px/db-config.json and merged with the existing cloud mode configuration.

src/configurations/destinations/gainsight_px_browser/ui-config.json (2)

1-42: Consider merging with existing Gainsight PX integration.

Based on the PR discussion, instead of creating a new destination named "GAINSIGHT_PX_BROWSER", this configuration should be integrated into the existing "GAINSIGHT_PX" destination at ./configurations/destinations/gainsight_px/. This approach would:


54-108: Update to more inclusive terminology.

While the UI shows "Allowlist" and "Denylist", the underlying values still use "whitelistedEvents" and "blacklistedEvents". Consider updating these to align with inclusive terminology:

-              "value": "whitelistedEvents"
+              "value": "allowlistedEvents"
-              "value": "blacklistedEvents"
+              "value": "deniedEvents"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 85b0d34 and e32468f.

📒 Files selected for processing (2)
  • src/configurations/destinations/gainsight_px_browser/db-config.json (1 hunks)
  • src/configurations/destinations/gainsight_px_browser/ui-config.json (1 hunks)
🧰 Additional context used
📓 Learnings (1)
src/configurations/destinations/gainsight_px_browser/ui-config.json (2)
Learnt from: gs-nwolfe
PR: rudderlabs/rudder-integrations-config#1684
File: src/configurations/destinations/gainsight_px_browser/ui-config.json:109-220
Timestamp: 2024-10-08T15:52:59.819Z
Learning: In `ui-config.json` files, using multiple conditions for the same `configKey` in the `preRequisites`, such as for `AMP_enable-gcm`, is acceptable and commonly used across multiple destinations.
Learnt from: gs-nwolfe
PR: rudderlabs/rudder-integrations-config#1684
File: src/configurations/destinations/gainsight_px_browser/ui-config.json:109-220
Timestamp: 2024-10-07T23:42:32.854Z
Learning: In `ui-config.json` files, using multiple conditions for the same `configKey` in the `preRequisites`, such as for `AMP_enable-gcm`, is acceptable and commonly used across multiple destinations.
🔇 Additional comments (7)
src/configurations/destinations/gainsight_px_browser/db-config.json (5)

17-19: LGTM: Source and message type configuration.

The configuration correctly:

  • Limits source type to "web"
  • Specifies device mode for web connections
  • Supports appropriate message types (identify, track, group)

31-32: LGTM: Security configuration.

The productKey is correctly marked as a secret key, ensuring proper handling of sensitive information.


4-6: Verify processor transformation configuration.

The transformAtV1 setting is set to "processor". Please ensure this aligns with the existing Gainsight PX destination's transformation logic to maintain consistency when merging.

#!/bin/bash
# Check transformation configuration in existing Gainsight PX destination
rg -g "db-config.json" '"transformAtV1"' ./configurations/destinations/gainsight_px/

20-30: Verify consent management implementation.

The configuration includes consent management features:

  • oneTrustCookieCategories in defaultConfig
  • consentManagement in web config

Please ensure this aligns with Gainsight PX's consent management requirements and documentation.


7-16: Review the completeness of configuration keys.

The configuration includes essential keys for device mode operation. However, when merging with the existing destination:

  1. Ensure no cloud mode keys are accidentally removed
  2. Consider adding validation for required keys
✅ Verification successful

Configuration keys are correctly separated between browser and cloud modes

After comparing both configurations, I can confirm that:

  1. The browser mode configuration (gainsight_px_browser) correctly includes device-mode specific keys like productKey, dataCenter, and event filtering options.
  2. The cloud mode configuration (gainsight_px) maintains its separate set of keys including apiKey, productTagKey, and attribute mappings.
  3. Common keys like oneTrustCookieCategories and consentManagement are present in both configurations.

No cloud mode keys were accidentally removed, and the configuration separation is properly maintained between the two integration modes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Compare with existing Gainsight PX destination keys
echo "Checking existing Gainsight PX configuration keys:"
rg -g "db-config.json" '"includeKeys"' -A 10 ./configurations/destinations/gainsight_px/

Length of output: 283


Script:

#!/bin/bash
# Let's try searching for all db-config.json files in the repository
echo "Finding all db-config.json files:"
fd "db-config.json"

# Search for any Gainsight PX related configuration files
echo -e "\nSearching for Gainsight PX related files:"
fd -t f -i "gainsight.*px"

# Let's also check the content of the browser destination config
echo -e "\nChecking browser destination config content:"
cat src/configurations/destinations/gainsight_px_browser/db-config.json

Length of output: 21049


Script:

#!/bin/bash
# Let's check the content of the regular Gainsight PX destination config
echo "Checking Gainsight PX destination config content:"
cat src/configurations/destinations/gainsight_px/db-config.json

# Also check if there are any cloud mode specific configurations
echo -e "\nSearching for cloud mode configurations in Gainsight PX files:"
rg -i "cloud.*mode" src/configurations/destinations/gainsight_px/
rg -i "cloud.*mode" src/configurations/destinations/gainsight_px_browser/

Length of output: 3313

src/configurations/destinations/gainsight_px_browser/ui-config.json (2)

43-53: LGTM: Native SDK configuration is clear and appropriate.

The default value of true for device-mode event sending aligns well with the integration's purpose.


109-220: LGTM: Comprehensive consent management configuration.

The consent settings section provides:

  • Clear guidance about using category IDs over names
  • Flexible consent management provider options
  • Support for environment variables in category IDs
  • Proper feature flag controls

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