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

fix: fixing display name issues #1908

Closed
wants to merge 4 commits into from

Conversation

shrouti1507
Copy link
Contributor

@shrouti1507 shrouti1507 commented Nov 7, 2024

PR Description

While verifying the device mode destinations loading across the entire repository we found out that the below destinations were not loading due to display name mismatch:

  • Active campaign
  • Livechat
  • Lemnisk
  • ConvertFlow
Screenshot 2024-11-07 at 12 01 23 PM

Linear task (optional)

https://linear.app/rudderstack/issue/INT-2811/test-web-device-mode-destinations-for-proper-loading
Resolves INT-2811

Cross Browser Tests

Please confirm you have tested for the following browsers:

  • Chrome
  • Firefox
  • IE11

Sanity Suite

  • All sanity suite test cases pass locally

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

Summary by CodeRabbit

  • New Features
    • Updated display names for various integrations to ensure consistent naming conventions:
      • ActiveCampaign is now displayed as 'ActiveCampaign'.
      • ConvertFlow is now displayed as 'Convertflow'.
      • Lemnisk is now displayed as 'Lemnisk Marketing Automation'.
      • LiveChat is now displayed as 'livechat'.

saikumarrs and others added 4 commits October 28, 2024 17:11
* feat: sanitize input data

* feat: sanitize all user inputs

* fix: exclude sensitive data auth token from bugsnag metadata

* chore: address ai bot review comments

* refactor: move utilities to the correct location and add tests

* chore: revert unnecessary changes
* feat: add date datatype

* chore: update allowed datatypes

* chore: address review comment
@shrouti1507 shrouti1507 requested a review from a team November 7, 2024 05:50
Copy link
Contributor

coderabbitai bot commented Nov 7, 2024

📝 Walkthrough

Walkthrough

This pull request introduces modifications to the DISPLAY_NAME constants across several integration files in the analytics-js-common package. The changes include updates to the values of DISPLAY_NAME for ActiveCampaign, ConvertFlow, Lemnisk, and LiveChat, ensuring consistent naming conventions. Each update also affects the corresponding DISPLAY_NAME_TO_DIR_NAME_MAP and CNameMapping to reflect the new values. The overall structure of the exports remains unchanged.

Changes

File Change Summary
packages/analytics-js-common/src/constants/integrations/ActiveCampaign/constants.js Updated DISPLAY_NAME from 'Active Campaign' to 'ActiveCampaign'.
packages/analytics-js-common/src/constants/integrations/ConvertFlow/constants.ts Updated DISPLAY_NAME from 'ConvertFlow' to 'Convertflow', changing the casing.
packages/analytics-js-common/src/constants/integrations/Lemnisk/constants.ts Updated DISPLAY_NAME from 'Lemnisk' to 'Lemnisk Marketing Automation'.
packages/analytics-js-common/src/constants/integrations/LiveChat/constants.ts Updated DISPLAY_NAME from 'LiveChat' to 'livechat', changing to lowercase.

Possibly related PRs

  • feat: gainsight PX destination (#1852) #1889: The changes in this PR involve modifying constants related to DISPLAY_NAME in various files, similar to the main PR's update of the DISPLAY_NAME constant for ActiveCampaign. Both PRs focus on ensuring consistency in naming conventions across different integrations.

Suggested reviewers

  • saikumarrs

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

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 94.73684% with 7 lines in your changes missing coverage. Please review.

Project coverage is 57.47%. Comparing base (8bb4145) to head (6b20d73).

Files with missing lines Patch % Lines
...constants/integrations/ActiveCampaign/constants.js 0.00% 1 Missing ⚠️
...rc/constants/integrations/ConvertFlow/constants.ts 0.00% 1 Missing ⚠️
...on/src/constants/integrations/Lemnisk/constants.ts 0.00% 1 Missing ⚠️
...n/src/constants/integrations/LiveChat/constants.ts 0.00% 1 Missing ⚠️
...ckages/analytics-js-common/src/utilities/errors.ts 50.00% 1 Missing ⚠️
.../analytics-js-plugins/src/beaconQueue/utilities.ts 0.00% 1 Missing ⚠️
...ages/analytics-js/src/components/core/Analytics.ts 91.66% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           hotfix/nov07.2024    #1908      +/-   ##
=====================================================
- Coverage              57.49%   57.47%   -0.02%     
=====================================================
  Files                    485      485              
  Lines                  16493    16495       +2     
  Branches                3291     3304      +13     
=====================================================
- Hits                    9482     9481       -1     
+ Misses                  5792     5745      -47     
- Partials                1219     1269      +50     

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

Copy link

sonarcloud bot commented Nov 7, 2024

Copy link
Contributor

@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 (2)
packages/analytics-js-common/src/constants/integrations/ConvertFlow/constants.ts (1)

3-3: Add test coverage for the constants.

The static analysis indicates that the constants are not covered by tests. Consider adding tests to verify the correct export and mapping of these constants.

Would you like me to help generate test cases for these constants? I can create a test suite that verifies:

  1. The correct value of DISPLAY_NAME
  2. The mapping in DISPLAY_NAME_TO_DIR_NAME_MAP
  3. All variations in CNameMapping
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/ConvertFlow/constants.ts#L3
Added line #L3 was not covered by tests

packages/analytics-js-common/src/constants/integrations/Lemnisk/constants.ts (1)

3-3: Add test coverage for the display name constant.

The DISPLAY_NAME constant is not covered by tests. Consider adding integration tests to verify:

  1. Correct display name in destination UI
  2. Proper mapping in destination configurations

Would you like me to help generate test cases for this constant?

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/Lemnisk/constants.ts#L3
Added line #L3 was not covered by tests

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 9c207f1 and 6b20d73.

📒 Files selected for processing (4)
  • packages/analytics-js-common/src/constants/integrations/ActiveCampaign/constants.js (1 hunks)
  • packages/analytics-js-common/src/constants/integrations/ConvertFlow/constants.ts (1 hunks)
  • packages/analytics-js-common/src/constants/integrations/Lemnisk/constants.ts (1 hunks)
  • packages/analytics-js-common/src/constants/integrations/LiveChat/constants.ts (1 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
packages/analytics-js-common/src/constants/integrations/ActiveCampaign/constants.js

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/ActiveCampaign/constants.js#L3
Added line #L3 was not covered by tests

packages/analytics-js-common/src/constants/integrations/ConvertFlow/constants.ts

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/ConvertFlow/constants.ts#L3
Added line #L3 was not covered by tests

packages/analytics-js-common/src/constants/integrations/Lemnisk/constants.ts

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/Lemnisk/constants.ts#L3
Added line #L3 was not covered by tests

packages/analytics-js-common/src/constants/integrations/LiveChat/constants.ts

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/LiveChat/constants.ts#L3
Added line #L3 was not covered by tests

🔇 Additional comments (5)
packages/analytics-js-common/src/constants/integrations/LiveChat/constants.ts (1)

3-3: Add test coverage for DISPLAY_NAME constant

The DISPLAY_NAME constant is crucial for destination loading but lacks test coverage. Please add tests to verify the mapping works correctly with the integration.

Would you like me to help create test cases for this constant?

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/LiveChat/constants.ts#L3
Added line #L3 was not covered by tests

packages/analytics-js-common/src/constants/integrations/ConvertFlow/constants.ts (1)

3-3: LGTM! Verify the display name change impact.

The standardization of DISPLAY_NAME to 'Convertflow' aligns with the PR's objective of fixing display name issues. The CNameMapping already handles this case variation appropriately.

Let's verify the usage of this constant across the codebase:

✅ Verification successful

Display name change is safe to proceed

The change from 'ConvertFlow' to 'Convertflow' is safe because:

  1. The CNameMapping in constants.ts already handles all case variations including 'Convertflow'
  2. The browser.js integration only uses DISPLAY_NAME for logging purposes
  3. The integration_cname.js and destinationNames.ts files import and use the constant correctly through proper exports
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any direct string references that might need updating
# and verify the usage of DISPLAY_NAME constant

# Search for any hardcoded references to 'ConvertFlow' that might need updating
rg -l 'ConvertFlow' --type ts --type js

# Check imports and usage of DISPLAY_NAME from this constants file
rg -A 2 "from ['|\"].*ConvertFlow/constants" --type ts --type js

Length of output: 2121


Script:

#!/bin/bash
# Let's check the actual content of the files that import DISPLAY_NAME
# to ensure they're using it correctly and won't be affected by the case change

# Check browser.js implementation
cat packages/analytics-js-integrations/src/integrations/ConvertFlow/browser.js

# Check integration_cname.js to see CNameMapping usage
cat packages/analytics-js-common/src/constants/integrations/integration_cname.js

# Check destinationNames.ts to see how DISPLAY_NAME is used
cat packages/analytics-js-common/src/constants/integrations/destinationNames.ts

# Also check the original constants file to see full context
cat packages/analytics-js-common/src/constants/integrations/ConvertFlow/constants.ts

Length of output: 18933

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/ConvertFlow/constants.ts#L3
Added line #L3 was not covered by tests

packages/analytics-js-common/src/constants/integrations/ActiveCampaign/constants.js (2)

3-3: LGTM! Display name update matches official branding.

The change from 'Active Campaign' to 'ActiveCampaign' aligns with the official product branding while maintaining backward compatibility through CNameMapping.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/ActiveCampaign/constants.js#L3
Added line #L3 was not covered by tests


3-3: ⚠️ Potential issue

Add test coverage for the DISPLAY_NAME constant.

The static analysis indicates that this line isn't covered by tests. Since display names are critical for integration identification, we should ensure proper test coverage.

Let's check existing test coverage:

Would you like me to help generate test cases to cover this constant?

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/ActiveCampaign/constants.js#L3
Added line #L3 was not covered by tests

packages/analytics-js-common/src/constants/integrations/Lemnisk/constants.ts (1)

Line range hint 5-14: LGTM! Comprehensive mapping coverage.

The mappings appropriately handle all variations of the name, maintaining backward compatibility while supporting the new display name.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/Lemnisk/constants.ts#L3
Added line #L3 was not covered by tests

@@ -1,6 +1,6 @@
const DIR_NAME = 'LiveChat';
const NAME = 'LIVECHAT';
const DISPLAY_NAME = 'LiveChat';
const DISPLAY_NAME = 'livechat';
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Maintain proper casing for company name "LiveChat"

The change to lowercase 'livechat' appears incorrect as LiveChat is a company name and should maintain proper casing. This is consistent with how other integration display names are handled (e.g., ActiveCampaign, Lemnisk Marketing Automation).

Apply this diff to fix the casing:

-const DISPLAY_NAME = 'livechat';
+const DISPLAY_NAME = 'LiveChat';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const DISPLAY_NAME = 'livechat';
const DISPLAY_NAME = 'LiveChat';
🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/LiveChat/constants.ts#L3
Added line #L3 was not covered by tests

@@ -1,6 +1,6 @@
const DIR_NAME = 'Lemnisk';
const NAME = 'LEMNISK';
const DISPLAY_NAME = 'Lemnisk';
const DISPLAY_NAME = 'Lemnisk Marketing Automation';
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Update required: Inconsistent display name found in multiple files

The display name change from 'Lemnisk' to 'Lemnisk Marketing Automation' needs to be synchronized across these files:

  • packages/analytics-js-common/src/constants/integrations/config_to_integration_names.js
  • packages/analytics-js-common/src/constants/integrations/client_server_name.js
  • examples/chrome-extension/content-script-v1.1/foreground.js
  • examples/chrome-extension/content-script-v3/foreground.js
🔗 Analysis chain

LGTM! Verify impact on destination configurations.

The more descriptive display name aligns with the standardization effort across integration files.

Let's verify if this display name is consistently used across the codebase:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining occurrences of the old display name 'Lemnisk'
# that might need updating
rg -l "['\"](Lemnisk)['\"]" --type ts --type js

Length of output: 413


Script:

#!/bin/bash
# Let's check the actual content and context of these occurrences
echo "=== Checking config_to_integration_names.js ==="
rg -A 2 -B 2 "Lemnisk" packages/analytics-js-common/src/constants/integrations/config_to_integration_names.js

echo -e "\n=== Checking client_server_name.js ==="
rg -A 2 -B 2 "Lemnisk" packages/analytics-js-common/src/constants/integrations/client_server_name.js

echo -e "\n=== Checking chrome extension files ==="
rg -A 2 -B 2 "Lemnisk" examples/chrome-extension/content-script-v1.1/foreground.js
rg -A 2 -B 2 "Lemnisk" examples/chrome-extension/content-script-v3/foreground.js

Length of output: 125778

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 3-3: packages/analytics-js-common/src/constants/integrations/Lemnisk/constants.ts#L3
Added line #L3 was not covered by tests

Copy link

github-actions bot commented Nov 7, 2024

size-limit report 📦

Name Size (Base) Size (Current) Size Limit Status
Plugins Module Federation Mapping - Legacy - CDN 332 B 332 B (0%) 512 B
Plugins - Legacy - CDN 15.48 KB 15.5 KB (+0.18% ▲) 16 KB
Plugins Module Federation Mapping - Modern - CDN 331 B 331 B (0%) 512 B
Plugins - Modern - CDN 7.2 KB 7.2 KB (0%) 7.5 KB
Common - No bundling 16.28 KB 16.27 KB (-0.08% ▼) 16.5 KB
Cookies Utils - Legacy - NPM (ESM) 1.45 KB 1.45 KB (0%) 2 KB
Cookies Utils - Legacy - NPM (CJS) 1.65 KB 1.65 KB (0%) 2 KB
Cookies Utils - Legacy - NPM (UMD) 1.43 KB 1.43 KB (0%) 2 KB
Cookies Utils - Modern - NPM (ESM) 1.11 KB 1.11 KB (0%) 1.5 KB
Cookies Utils - Modern - NPM (CJS) 1.34 KB 1.34 KB (0%) 1.5 KB
Cookies Utils - Modern - NPM (UMD) 1.08 KB 1.08 KB (0%) 1.5 KB
Load Snippet 758 B 758 B (0%) 1 KB
Core (v1.1) - NPM (ESM) 30.36 KB 30.36 KB (0%) 32 KB
Core (v1.1) - NPM (CJS) 30.55 KB 30.55 KB (0%) 32 KB
Core (v1.1) - NPM (UMD) 30.37 KB 30.37 KB (0%) 32 KB
Core (Content Script - v1.1) - NPM (ESM) 29.89 KB 29.89 KB (0%) 30.5 KB
Core (Content Script - v1.1) - NPM (CJS) 30.09 KB 30.09 KB (0%) 30.5 KB
Core (Content Script - v1.1) - NPM (UMD) 29.92 KB 29.92 KB (0%) 30 KB
Core - Legacy - CDN 48.33 KB 48.31 KB (-0.04% ▼) 48.5 KB
Core - Modern - CDN 24.75 KB 24.75 KB (0%) 25 KB
Core - Legacy - NPM (ESM) 48.24 KB 48.21 KB (-0.07% ▼) 48.5 KB
Core - Legacy - NPM (CJS) 48.46 KB 48.42 KB (-0.1% ▼) 49 KB
Core - Legacy - NPM (UMD) 48.19 KB 48.21 KB (+0.05% ▲) 48.5 KB
Core - Modern - NPM (ESM) 24.48 KB 24.48 KB (0%) 25 KB
Core - Modern - NPM (CJS) 24.72 KB 24.72 KB (0%) 25 KB
Core - Modern - NPM (UMD) 24.53 KB 24.53 KB (0%) 25 KB
Core (Bundled) - Legacy - NPM (ESM) 48.24 KB 48.21 KB (-0.07% ▼) 48.5 KB
Core (Bundled) - Legacy - NPM (CJS) 48.44 KB 48.44 KB (+0.02% ▲) 49 KB
Core (Bundled) - Legacy - NPM (UMD) 48.19 KB 48.21 KB (+0.05% ▲) 48.5 KB
Core (Bundled) - Modern - NPM (ESM) 39.34 KB 39.36 KB (+0.05% ▲) 39.5 KB
Core (Bundled) - Modern - NPM (CJS) 39.6 KB 39.64 KB (+0.09% ▲) 40 KB
Core (Bundled) - Modern - NPM (UMD) 39.29 KB 39.29 KB (+0.02% ▲) 39.5 KB
Core (Content Script) - Legacy - NPM (ESM) 47.61 KB 47.63 KB (+0.05% ▲) 48 KB
Core (Content Script) - Legacy - NPM (CJS) 47.89 KB 47.9 KB (+0.04% ▲) 48 KB
Core (Content Script) - Legacy - NPM (UMD) 47.62 KB 47.64 KB (+0.05% ▲) 48 KB
Core (Content Script) - Modern - NPM (ESM) 38.84 KB 38.83 KB (-0.03% ▼) 39 KB
Core (Content Script) - Modern - NPM (CJS) 39.05 KB 39.08 KB (+0.08% ▲) 40 KB
Core (Content Script) - Modern - NPM (UMD) 38.76 KB 38.81 KB (+0.12% ▲) 39 KB
Service Worker - Legacy - NPM (ESM) 30.6 KB 30.6 KB (0%) 31 KB
Service Worker - Legacy - NPM (CJS) 30.88 KB 30.88 KB (0%) 31 KB
Service Worker - Legacy - NPM (UMD) 30.68 KB 30.68 KB (0%) 31 KB
Service Worker - Modern - NPM (ESM) 25.74 KB 25.74 KB (0%) 26 KB
Service Worker - Modern - NPM (CJS) 26.02 KB 26.02 KB (0%) 26.5 KB
Service Worker - Modern - NPM (UMD) 25.79 KB 25.79 KB (0%) 26 KB
All Integrations - Legacy - CDN 94.68 KB 94.83 KB (+0.16% ▲) 95.3 KB
All Integrations - Modern - CDN 89.82 KB 89.92 KB (+0.12% ▲) 91 KB

@shrouti1507 shrouti1507 changed the base branch from develop to hotfix/nov07.2024 November 7, 2024 06:43
@shrouti1507 shrouti1507 requested a review from a team as a code owner November 7, 2024 06:43
@shrouti1507
Copy link
Contributor Author

we are handling it in #1909

@shrouti1507 shrouti1507 closed this Nov 7, 2024
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.

3 participants