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: npm sanity suites #1810

Merged
merged 7 commits into from
Jul 29, 2024
Merged

Conversation

saikumarrs
Copy link
Member

@saikumarrs saikumarrs commented Jul 26, 2024

PR Description

Fixed the sanity suite package to correctly build it for the NPM variant.

I've also made several improvements:

  • Web device mode integrations POC Slack user group will also be notified for deployment and release communications.
  • Release ticket ID is now mandatory for drafting a new release.
  • Cleaned up the common package directory structure to manage code ownership more easily.
  • Cleaned up the NPM scripts in the sanity suite package to make them more intuitive to use.

Linear task (optional)

https://linear.app/rudderstack/issue/SDK-2075/fix-issues-in-sanity-suites-of-the-npm-package-js-sdk

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

Summary by CodeRabbit

  • New Features

    • Enhanced Slack notifications for new releases to include additional user groups, increasing visibility.
    • Introduced a new input parameter for manual release workflows to improve ticket tracking.
    • Streamlined SDK base URL construction for improved clarity in configuration.
  • Bug Fixes

    • Cleaned up version strings by removing unnecessary suffixes for consistency.
  • Documentation

    • Updated environment variable configurations in .env.example to reflect changes in SDK and plugin references.
  • Style

    • Added favicons to various HTML documents for improved visual branding across the web application.
  • Chores

    • Refactored variable names in configuration files for better readability and maintainability.
    • Updated paths in import statements to reflect the new directory structure for constants and integrations.

@saikumarrs saikumarrs self-assigned this Jul 26, 2024
@saikumarrs saikumarrs changed the title Fix.fix npm sanity suites sdk 2075 fix: npm sanity suites Jul 26, 2024
Copy link
Contributor

coderabbitai bot commented Jul 26, 2024

Walkthrough

Walkthrough

The recent updates enhance GitHub Actions workflows by incorporating additional Slack notifications for new releases, broadening their audience through new user group mentions. A new release_ticket_id input was added to streamline tracking during releases, alongside adjustments to the branch naming convention. Additionally, the codebase was reorganized with clearer structures for constants and improved configuration management, contributing to overall maintainability.

Changes

File(s) Change Summary
.github/workflows/deploy-*.yml Enhanced Slack notification payloads by adding a new user group mention for improved release visibility.
.github/workflows/draft-new-release.yml Introduced a required input parameter (release_ticket_id) for tracking, modified branch naming conventions to include the ticket ID, and updated PR body for clarity.
packages/analytics-js-common/src/constants/index.ts Removed exports for unused constants, streamlining available exports.
packages/analytics-js-common/src/constants/integrations/destinationNames.ts Simplified import paths by removing redundancy, enhancing maintainability.
packages/analytics-js-common/src/constants/integrations/integration_cname.js Added a centralized mapping for integration names to improve organization.
packages/sanity-suite/.env.example Adjusted environment variable definitions, indicating a shift in configuration management.
packages/sanity-suite/public/v*.html Added favicon links to enhance branding across multiple HTML documents.
packages/sanity-suite/rollup.config.mjs Refactored variable names to uppercase constants for improved clarity and maintainability.
packages/sanity-suite/src/index-npm.ts Updated pluginsSDKBaseURL property in getLoadOptions to reflect new configuration standards.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GitHubActions
    participant Slack

    User->>GitHubActions: Trigger Release Workflow
    GitHubActions->>Slack: Notify Release with Ticket ID
    Slack-->>User: Notify relevant user groups
Loading

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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 Jul 26, 2024

Codecov Report

Attention: Patch coverage is 4.21053% with 91 lines in your changes missing coverage. Please review.

Project coverage is 56.61%. Comparing base (b43f60f) to head (4a107df).

Files Patch % Lines
...on/src/constants/integrations/integration_cname.js 0.00% 81 Missing ⚠️
...mon/src/constants/integrations/destinationNames.ts 0.00% 8 Missing ⚠️
packages/analytics-v1.1/src/core/analytics.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1810      +/-   ##
===========================================
+ Coverage    56.54%   56.61%   +0.07%     
===========================================
  Files          473      473              
  Lines        16114    16093      -21     
  Branches      3212     3224      +12     
===========================================
  Hits          9111     9111              
+ Misses        5788     5734      -54     
- Partials      1215     1248      +33     

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

Copy link

github-actions bot commented Jul 26, 2024

size-limit report 📦

Name Size (Base) Size (Current) Size Limit Status
Cookies Utils - Legacy - NPM (ESM) 1.54 KB 1.54 KB (0%) 2 KB
Cookies Utils - Legacy - NPM (CJS) 1.75 KB 1.75 KB (0%) 2 KB
Cookies Utils - Legacy - NPM (UMD) 1.53 KB 1.53 KB (0%) 2 KB
Cookies Utils - Modern - NPM (ESM) 1.17 KB 1.17 KB (0%) 1.5 KB
Cookies Utils - Modern - NPM (CJS) 1.4 KB 1.4 KB (0%) 1.5 KB
Cookies Utils - Modern - NPM (UMD) 1.16 KB 1.16 KB (0%) 1.5 KB
Plugins Module Federation Mapping - Legacy - CDN 332 B 332 B (0%) 512 B
Plugins - Legacy - CDN 15.82 KB 15.82 KB (0%) 16 KB
Plugins Module Federation Mapping - Modern - CDN 331 B 331 B (0%) 512 B
Plugins - Modern - CDN 7.19 KB 7.19 KB (0%) 7.5 KB
Common - No bundling 15.92 KB 15.83 KB (-0.58% ▼) 16.5 KB
Service Worker - Legacy - NPM (ESM) 29.46 KB 29.46 KB (0%) 30 KB
Service Worker - Legacy - NPM (CJS) 29.61 KB 29.61 KB (0%) 30 KB
Service Worker - Legacy - NPM (UMD) 29.44 KB 29.44 KB (0%) 30 KB
Service Worker - Modern - NPM (ESM) 24.59 KB 24.59 KB (0%) 25 KB
Service Worker - Modern - NPM (CJS) 24.88 KB 24.88 KB (0%) 25 KB
Service Worker - Modern - NPM (UMD) 24.67 KB 24.67 KB (0%) 25 KB
Core (v1.1) - NPM (ESM) 29.81 KB 29.81 KB (0%) 32 KB
Core (v1.1) - NPM (CJS) 29.97 KB 29.97 KB (0%) 32 KB
Core (v1.1) - NPM (UMD) 29.89 KB 29.89 KB (0%) 32 KB
Core (Content Script - v1.1) - NPM (ESM) 29.33 KB 29.33 KB (0%) 30 KB
Core (Content Script - v1.1) - NPM (CJS) 29.54 KB 29.54 KB (0%) 30 KB
Core (Content Script - v1.1) - NPM (UMD) 29.42 KB 29.42 KB (0%) 30 KB
Core - Legacy - CDN 47.46 KB 47.46 KB (0%) 48 KB
Core - Modern - CDN 24 KB 24 KB (0%) 24.5 KB
Load Snippet 724 B 724 B (0%) 1 KB
Core - Legacy - NPM (ESM) 47.28 KB 47.28 KB (0%) 47.5 KB
Core - Legacy - NPM (CJS) 47.57 KB 47.57 KB (0%) 48 KB
Core - Legacy - NPM (UMD) 47.32 KB 47.32 KB (0%) 47.5 KB
Core - Modern - NPM (ESM) 23.76 KB 23.76 KB (0%) 24.5 KB
Core - Modern - NPM (CJS) 23.99 KB 23.99 KB (0%) 24.5 KB
Core - Modern - NPM (UMD) 23.8 KB 23.8 KB (0%) 24.5 KB
Core (Bundled) - Legacy - NPM (ESM) 47.28 KB 47.28 KB (0%) 47.5 KB
Core (Bundled) - Legacy - NPM (CJS) 47.56 KB 47.56 KB (0%) 48 KB
Core (Bundled) - Legacy - NPM (UMD) 47.32 KB 47.32 KB (0%) 47.5 KB
Core (Bundled) - Modern - NPM (ESM) 38.55 KB 38.55 KB (0%) 39 KB
Core (Bundled) - Modern - NPM (CJS) 38.86 KB 38.86 KB (0%) 39 KB
Core (Bundled) - Modern - NPM (UMD) 38.57 KB 38.57 KB (0%) 39 KB
Core (Content Script) - Legacy - NPM (ESM) 46.75 KB 46.75 KB (0%) 47 KB
Core (Content Script) - Legacy - NPM (CJS) 47.05 KB 47.05 KB (0%) 47.5 KB
Core (Content Script) - Legacy - NPM (UMD) 46.8 KB 46.8 KB (0%) 47 KB
Core (Content Script) - Modern - NPM (ESM) 38.05 KB 38.05 KB (0%) 38.5 KB
Core (Content Script) - Modern - NPM (CJS) 38.29 KB 38.29 KB (0%) 38.5 KB
Core (Content Script) - Modern - NPM (UMD) 38.07 KB 38.07 KB (0%) 38.5 KB
All Integrations - Legacy - CDN 93.68 KB 93.68 KB (0%) 95.3 KB
All Integrations - Modern - CDN 88.71 KB 88.71 KB (0%) 91 KB

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

Outside diff range, codebase verification and nitpick comments (2)
packages/analytics-js-common/src/v1.1/utils/index.ts (1)

1-1: Issues found due to the removal of integration_cname.

The removal of integration_cname will break dependencies in the following files:

  • packages/analytics-v1.1/src/core/analytics.js
  • packages/analytics-v1.1/src/utils/utils.js

Please ensure to address these dependencies before proceeding.

Analysis chain

Verify the removal of integration_cname.

Ensure that the removal of integration_cname does not break any dependencies in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if the removal of `integration_cname` breaks any dependencies.

# Test: Search for the usage of `integration_cname`. Expect: No occurrences.
rg --type python -A 5 $'integration_cname'

Length of output: 72


Script:

#!/bin/bash
# Description: Verify if the removal of `integration_cname` breaks any dependencies.

# Test: Search for the usage of `integration_cname`. Expect: No occurrences.
rg 'integration_cname' -A 5

Length of output: 5747

packages/analytics-v1.1/src/core/analytics.js (1)

18-19: Incorrect import paths for configToIntNames and commonNames

The files config_to_integration_names.js and integration_cname.js do not exist at the specified paths @rudderstack/analytics-js-common/constants/integrations/config_to_integration_names and @rudderstack/analytics-js-common/constants/integrations/integration_cname.

  • Please verify and correct the import paths for these modules.
Analysis chain

LGTM! But verify the new import paths.

The import paths for configToIntNames and commonNames have been updated correctly.

However, ensure that the new paths @rudderstack/analytics-js-common/constants/integrations/config_to_integration_names and @rudderstack/analytics-js-common/constants/integrations/integration_cname are correct and valid.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new import paths are correct and valid.

# Test: Search for the imported modules in the new paths. Expect: Only valid paths.
rg --type js $'@rudderstack/analytics-js-common/constants/integrations/config_to_integration_names'
rg --type js $'@rudderstack/analytics-js-common/constants/integrations/integration_cname'

Length of output: 858


Script:

#!/bin/bash
# Description: Verify the existence of the files at the new import paths.

# Test: Check if the files exist at the specified paths. Expect: Files should exist.
if [ -f "packages/analytics-js-common/constants/integrations/config_to_integration_names.js" ]; then echo "config_to_integration_names.js exists"; else echo "config_to_integration_names.js does not exist"; fi
if [ -f "packages/analytics-js-common/constants/integrations/integration_cname.js" ]; then echo "integration_cname.js exists"; else echo "integration_cname.js does not exist"; fi

Length of output: 363

Tools
GitHub Check: codecov/patch

[warning] 18-19: packages/analytics-v1.1/src/core/analytics.js#L18-L19
Added lines #L18 - L19 were not covered by tests

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b43f60f and 6b9fc04.

Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json, !**/*.json
  • packages/sanity-suite/package.json is excluded by !**/*.json
Files selected for processing (31)
  • .github/workflows/deploy-npm.yml (6 hunks)
  • .github/workflows/deploy-sanity-suite.yml (2 hunks)
  • .github/workflows/deploy.yml (2 hunks)
  • .github/workflows/draft-new-release.yml (4 hunks)
  • .github/workflows/publish-new-release.yml (3 hunks)
  • CODEOWNERS (1 hunks)
  • packages/analytics-js-common/src/constants/index.ts (1 hunks)
  • packages/analytics-js-common/src/constants/integrations/destinationNames.ts (1 hunks)
  • packages/analytics-js-common/src/constants/integrations/integration_cname.js (1 hunks)
  • packages/analytics-js-common/src/v1.1/utils/index.ts (1 hunks)
  • packages/analytics-js-integrations/scripts/integrationBuildScript.js (1 hunks)
  • packages/analytics-js-plugins/src/deviceModeDestinations/index.ts (1 hunks)
  • packages/analytics-v1.1/src/core/analytics.js (1 hunks)
  • packages/analytics-v1.1/src/features/core/metrics/errorReporting/providers/Bugsnag.js (1 hunks)
  • packages/analytics-v1.1/src/utils/utils.js (1 hunks)
  • packages/sanity-suite/.env.example (1 hunks)
  • packages/sanity-suite/public/v1.1/index-cdn.html (1 hunks)
  • packages/sanity-suite/public/v1.1/index-local.html (1 hunks)
  • packages/sanity-suite/public/v1.1/index-npm.html (1 hunks)
  • packages/sanity-suite/public/v1.1/integrations/index-cdn.html (1 hunks)
  • packages/sanity-suite/public/v1.1/integrations/index-local.html (1 hunks)
  • packages/sanity-suite/public/v1.1/integrations/index-npm.html (1 hunks)
  • packages/sanity-suite/public/v1.1/manualLoadCall/index-cdn.html (1 hunks)
  • packages/sanity-suite/public/v1.1/manualLoadCall/index-local.html (1 hunks)
  • packages/sanity-suite/public/v1.1/manualLoadCall/index-npm.html (1 hunks)
  • packages/sanity-suite/public/v3/index-local.html (1 hunks)
  • packages/sanity-suite/public/v3/integrations/index-local.html (1 hunks)
  • packages/sanity-suite/public/v3/manualLoadCall/index-local.html (1 hunks)
  • packages/sanity-suite/rollup.config.mjs (6 hunks)
  • packages/sanity-suite/src/index-npm.ts (1 hunks)
  • sonar-project.properties (1 hunks)
Files skipped from review due to trivial changes (17)
  • .github/workflows/deploy-npm.yml
  • CODEOWNERS
  • packages/analytics-js-common/src/constants/index.ts
  • packages/analytics-js-integrations/scripts/integrationBuildScript.js
  • packages/analytics-js-plugins/src/deviceModeDestinations/index.ts
  • packages/analytics-v1.1/src/features/core/metrics/errorReporting/providers/Bugsnag.js
  • packages/analytics-v1.1/src/utils/utils.js
  • packages/sanity-suite/public/v1.1/index-cdn.html
  • packages/sanity-suite/public/v1.1/index-local.html
  • packages/sanity-suite/public/v1.1/index-npm.html
  • packages/sanity-suite/public/v1.1/integrations/index-cdn.html
  • packages/sanity-suite/public/v1.1/integrations/index-local.html
  • packages/sanity-suite/public/v1.1/integrations/index-npm.html
  • packages/sanity-suite/public/v1.1/manualLoadCall/index-cdn.html
  • packages/sanity-suite/public/v1.1/manualLoadCall/index-local.html
  • packages/sanity-suite/public/v1.1/manualLoadCall/index-npm.html
  • packages/sanity-suite/src/index-npm.ts
Additional context used
GitHub Check: codecov/patch
packages/analytics-js-common/src/constants/integrations/integration_cname.js

[warning] 1-79: packages/analytics-js-common/src/constants/integrations/integration_cname.js#L1-L79
Added lines #L1 - L79 were not covered by tests


[warning] 83-83: packages/analytics-js-common/src/constants/integrations/integration_cname.js#L83
Added line #L83 was not covered by tests


[warning] 166-166: packages/analytics-js-common/src/constants/integrations/integration_cname.js#L166
Added line #L166 was not covered by tests

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

[warning] 45-45: packages/analytics-js-common/src/constants/integrations/destinationNames.ts#L45
Added line #L45 was not covered by tests


[warning] 54-55: packages/analytics-js-common/src/constants/integrations/destinationNames.ts#L54-L55
Added lines #L54 - L55 were not covered by tests


[warning] 72-72: packages/analytics-js-common/src/constants/integrations/destinationNames.ts#L72
Added line #L72 was not covered by tests


[warning] 85-85: packages/analytics-js-common/src/constants/integrations/destinationNames.ts#L85
Added line #L85 was not covered by tests


[warning] 166-166: packages/analytics-js-common/src/constants/integrations/destinationNames.ts#L166
Added line #L166 was not covered by tests


[warning] 183-183: packages/analytics-js-common/src/constants/integrations/destinationNames.ts#L183
Added line #L183 was not covered by tests


[warning] 220-220: packages/analytics-js-common/src/constants/integrations/destinationNames.ts#L220
Added line #L220 was not covered by tests

packages/analytics-v1.1/src/core/analytics.js

[warning] 18-19: packages/analytics-v1.1/src/core/analytics.js#L18-L19
Added lines #L18 - L19 were not covered by tests

Biome
packages/sanity-suite/rollup.config.mjs

[error] 57-57: Useless case clause.

because the default clause is present:

Unsafe fix: Remove the useless case.

(lint/complexity/noUselessSwitchCase)

Additional comments not posted (37)
packages/sanity-suite/.env.example (6)

3-3: Verify the necessity of an empty value for CONFIG_SERVER_HOST.

An empty value for CONFIG_SERVER_HOST can cause issues if the application expects a valid URL. Ensure this is intentional or provide a default value.


4-4: Verify the necessity of an empty value for SDK_CDN_VERSION_PATH_PREFIX.

An empty value for SDK_CDN_VERSION_PATH_PREFIX can cause issues if the application expects a valid path prefix. Ensure this is intentional or provide a default value.


5-5: Verify the necessity of an empty value for DEST_SDK_BASE_URL.

An empty value for DEST_SDK_BASE_URL can cause issues if the application expects a valid base URL. Ensure this is intentional or provide a default value.


8-8: Verify the necessity of commenting out PLUGINS_SDK_BASE_URL.

Commenting out PLUGINS_SDK_BASE_URL might indicate it is no longer needed or temporarily disabled. Ensure this change is intentional.


11-11: Verify the necessity of commenting out IS_DEV_TESTBOOK.

Commenting out IS_DEV_TESTBOOK might indicate it is no longer needed or temporarily disabled. Ensure this change is intentional.


14-14: Verify the necessity of commenting out IS_DMT.

Commenting out IS_DMT might indicate it is temporarily disabled. Ensure this change is intentional.

packages/analytics-js-common/src/v1.1/utils/index.ts (2)

1-1: Verify the removal of config_to_integration_names.

Ensure that the removal of config_to_integration_names does not break any dependencies in the codebase.

Verification successful

Let's correct the file type and search for the usage of config_to_integration_names in TypeScript files.


The removal of config_to_integration_names does not break any dependencies.

The search for config_to_integration_names in the TypeScript files returned no results, indicating that this export is not used elsewhere in the codebase.

  • No occurrences of config_to_integration_names were found.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if the removal of `config_to_integration_names` breaks any dependencies.

# Test: Search for the usage of `config_to_integration_names`. Expect: No occurrences.
rg --type python -A 5 $'config_to_integration_names'

Length of output: 82


Script:

#!/bin/bash
# Description: Verify if the removal of `config_to_integration_names` breaks any dependencies.

# Test: Search for the usage of `config_to_integration_names` in TypeScript files. Expect: No occurrences.
rg --type ts -A 5 $'config_to_integration_names'

Length of output: 47


1-1: Verify the removal of client_server_name.

Ensure that the removal of client_server_name does not break any dependencies in the codebase.

Verification successful

The removal of client_server_name does not break any dependencies.

The search for occurrences of client_server_name within the TypeScript files did not produce any results, indicating that it is not used elsewhere in the codebase.

  • No occurrences of client_server_name found in the TypeScript files.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if the removal of `client_server_name` breaks any dependencies.

# Test: Search for the usage of `client_server_name`. Expect: No occurrences.
rg --type python -A 5 $'client_server_name'

Length of output: 73


Script:

#!/bin/bash
# Description: Verify if the removal of `client_server_name` breaks any dependencies.

# Test: Search for the usage of `client_server_name`. Expect: No occurrences.
rg --type ts -A 5 'client_server_name'

Length of output: 38

sonar-project.properties (2)

31-31: Verify the necessity of excluding packages/analytics-js-common/src/constants/integrations/**/* from coverage analysis.

Ensure that excluding this path from coverage analysis is intentional and does not omit critical code from testing.


37-37: Verify the necessity of excluding packages/analytics-js-common/src/constants/integrations/**/* from copy-paste detection.

Ensure that excluding this path from copy-paste detection is intentional and does not omit critical code from analysis.

.github/workflows/draft-new-release.yml (3)

5-8: LGTM! New required input added correctly.

The new required input release_ticket_id is correctly defined for the workflow_dispatch trigger.


61-61: LGTM! Branch naming convention updated.

The branch naming convention now includes the release_ticket_id, which improves traceability.


106-110: LGTM! PR body updated to include linear ticket reference.

The PR body now includes a reference to the linear ticket, improving documentation and traceability.

.github/workflows/publish-new-release.yml (2)

33-36: LGTM! Suffix removal from version string implemented correctly.

The awk command correctly removes the -SDK-<ticket_number> suffix from the version string, ensuring versioning consistency.


119-119: LGTM! Slack notification payload updated.

The Slack notification payload now includes an additional subteam mention, broadening the reach of release notifications.

Also applies to: 135-135

.github/workflows/deploy-sanity-suite.yml (1)

154-154: LGTM! Slack notification payload updated.

The Slack notification payload now includes an additional subteam mention, broadening the reach of deployment notifications.

Also applies to: 170-170

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

1-80: LGTM!

The import statements are well-organized and correctly reference the constants from various integrations.

Tools
GitHub Check: codecov/patch

[warning] 1-79: packages/analytics-js-common/src/constants/integrations/integration_cname.js#L1-L79
Added lines #L1 - L79 were not covered by tests


81-166: LGTM!

The commonNames mapping is correctly defined and the export statement is appropriate.

Tools
GitHub Check: codecov/patch

[warning] 83-83: packages/analytics-js-common/src/constants/integrations/integration_cname.js#L83
Added line #L83 was not covered by tests


[warning] 166-166: packages/analytics-js-common/src/constants/integrations/integration_cname.js#L166
Added line #L166 was not covered by tests

packages/sanity-suite/public/v3/index-local.html (2)

Line range hint 1-119:
LGTM!

The HTML structure is well-formed and correctly defines the RudderStack JS SDK Sanity Suite.


120-122: LGTM!

The changes to the SDK base URLs are appropriate and improve the consistency and predictability of the configuration.

packages/sanity-suite/rollup.config.mjs (3)

19-21: LGTM!

The variable declarations are correct and the renaming to uppercase constants improves clarity and readability.


63-76: LGTM!

The changes to the URL construction logic are appropriate and improve robustness.


78-89: LGTM!

The changes to the URL construction logic are appropriate and improve robustness.

packages/sanity-suite/public/v3/integrations/index-local.html (2)

109-109: LGTM! Simplified URL configuration.

The destSDKBaseURL has been simplified to a static value, which reduces complexity and potential errors.


111-111: LGTM! Simplified URL configuration.

The pluginsSDKBaseURL has been simplified to a static value, which reduces complexity and potential errors.

packages/sanity-suite/public/v3/manualLoadCall/index-local.html (2)

106-106: LGTM! Simplified URL configuration.

The destSDKBaseURL has been simplified to a static value, which reduces complexity and potential errors.


108-108: LGTM! Simplified URL configuration.

The pluginsSDKBaseURL has been simplified to a static value, which reduces complexity and potential errors.

packages/analytics-js-common/src/constants/integrations/destinationNames.ts (8)

4-4: LGTM! Simplified import path.

The import path for AdobeAnalytics has been simplified, improving clarity and maintainability.


8-8: LGTM! Simplified import path.

The import path for Amplitude has been simplified, improving clarity and maintainability.


12-12: LGTM! Simplified import path.

The import path for Appcues has been simplified, improving clarity and maintainability.


16-16: LGTM! Simplified import path.

The import path for BingAds has been simplified, improving clarity and maintainability.


20-20: LGTM! Simplified import path.

The import path for Braze has been simplified, improving clarity and maintainability.


24-24: LGTM! Simplified import path.

The import path for Bugsnag has been simplified, improving clarity and maintainability.


49-49: LGTM! Simplified import path.

The import path for FacebookPixel has been simplified, improving clarity and maintainability.


53-53: LGTM! Simplified import path.

The import path for Fullstory has been simplified, improving clarity and maintainability.

.github/workflows/deploy.yml (2)

186-186: LGTM! But verify the new Slack subteam mention.

The new subteam mention <!subteam^S07CCQ05F2T> is correctly added to the "text" field.

However, ensure that the subteam ID S07CCQ05F2T is correct and valid.


202-202: LGTM! But verify the new Slack subteam mention.

The new subteam mention <!subteam^S07CCQ05F2T> is correctly added to the "blocks" field.

However, ensure that the subteam ID S07CCQ05F2T is correct and valid.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jul 26, 2024
@saikumarrs saikumarrs marked this pull request as ready for review July 29, 2024 07:02
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
66.7% Coverage on New Code (required ≥ 90%)

See analysis details on SonarCloud

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

Outside diff range, codebase verification and nitpick comments (1)
packages/sanity-suite/public/v3/index-npm-bundled.html (1)

1-24: Improve readability of OneTrust script.

Format the OneTrust script for better readability.

- <script>
-   window.OneTrust = {
-     GetDomainData: function () {
-       return {
-         Groups: [
-           { CustomGroupId: 'C0001', GroupName: 'Functional Cookies' },
-           { CustomGroupId: 'C0002', GroupName: 'Performance Cookies' },
-           { CustomGroupId: 'C0003', GroupName: 'Analytical Cookies' },
-           { CustomGroupId: 'C0004', GroupName: 'Targeting Cookies' },
-           { CustomGroupId: 'C0005', GroupName: 'Social Media Cookies' },
-           { CustomGroupId: 'C0006', GroupName: 'Advertisement Cookies' },
-         ],
-       };
-     },
-   };
-   window.OnetrustActiveGroups = ',C0001,C0003,';
- </script>

+ <script>
+   window.OneTrust = {
+     GetDomainData: function () {
+       return {
+         Groups: [
+           { CustomGroupId: 'C0001', GroupName: 'Functional Cookies' },
+           { CustomGroupId: 'C0002', GroupName: 'Performance Cookies' },
+           { CustomGroupId: 'C0003', GroupName: 'Analytical Cookies' },
+           { CustomGroupId: 'C0004', GroupName: 'Targeting Cookies' },
+           { CustomGroupId: 'C0005', GroupName: 'Social Media Cookies' },
+           { CustomGroupId: 'C0006', GroupName: 'Advertisement Cookies' },
+         ],
+       };
+     },
+   };
+   window.OnetrustActiveGroups = ',C0001,C0003,';
+ </script>
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6b9fc04 and 4a107df.

Files ignored due to path filters (1)
  • packages/sanity-suite/package.json is excluded by !**/*.json
Files selected for processing (19)
  • packages/sanity-suite/public/v1.1/index-cdn.html (2 hunks)
  • packages/sanity-suite/public/v1.1/index-local.html (2 hunks)
  • packages/sanity-suite/public/v1.1/index-npm.html (2 hunks)
  • packages/sanity-suite/public/v1.1/integrations/index-cdn.html (2 hunks)
  • packages/sanity-suite/public/v1.1/integrations/index-local.html (2 hunks)
  • packages/sanity-suite/public/v1.1/integrations/index-npm.html (2 hunks)
  • packages/sanity-suite/public/v1.1/manualLoadCall/index-cdn.html (2 hunks)
  • packages/sanity-suite/public/v1.1/manualLoadCall/index-local.html (2 hunks)
  • packages/sanity-suite/public/v1.1/manualLoadCall/index-npm.html (2 hunks)
  • packages/sanity-suite/public/v3/index-npm-bundled.html (1 hunks)
  • packages/sanity-suite/public/v3/index-npm.html (1 hunks)
  • packages/sanity-suite/public/v3/integrations/index-npm-bundled.html (1 hunks)
  • packages/sanity-suite/public/v3/integrations/index-npm.html (1 hunks)
  • packages/sanity-suite/public/v3/manualLoadCall/index-npm-bundled.html (1 hunks)
  • packages/sanity-suite/public/v3/manualLoadCall/index-npm.html (1 hunks)
  • packages/sanity-suite/rollup.config.mjs (7 hunks)
  • packages/sanity-suite/src/index-npm-bundled.ts (1 hunks)
  • packages/sanity-suite/src/index-npm-v1.1.ts (1 hunks)
  • packages/sanity-suite/src/index-npm.ts (1 hunks)
Files skipped from review due to trivial changes (4)
  • packages/sanity-suite/public/v3/index-npm.html
  • packages/sanity-suite/public/v3/integrations/index-npm.html
  • packages/sanity-suite/public/v3/manualLoadCall/index-npm.html
  • packages/sanity-suite/src/index-npm-v1.1.ts
Files skipped from review as they are similar to previous changes (8)
  • packages/sanity-suite/public/v1.1/index-cdn.html
  • packages/sanity-suite/public/v1.1/index-local.html
  • packages/sanity-suite/public/v1.1/index-npm.html
  • packages/sanity-suite/public/v1.1/integrations/index-cdn.html
  • packages/sanity-suite/public/v1.1/integrations/index-local.html
  • packages/sanity-suite/public/v1.1/integrations/index-npm.html
  • packages/sanity-suite/public/v1.1/manualLoadCall/index-cdn.html
  • packages/sanity-suite/src/index-npm.ts
Additional context used
Biome
packages/sanity-suite/rollup.config.mjs

[error] 61-61: Useless case clause.

because the default clause is present:

Unsafe fix: Remove the useless case.

(lint/complexity/noUselessSwitchCase)

Additional comments not posted (31)
packages/sanity-suite/src/index-npm-bundled.ts (1)

55-55: LGTM!

The invocation of sanitySuiteApp looks good.

packages/sanity-suite/public/v3/index-npm-bundled.html (2)

27-57: LGTM!

The RudderAnalytics snippet looks good.


122-129: LGTM!

The body section looks good.

packages/sanity-suite/public/v1.1/manualLoadCall/index-npm.html (3)

4-4: LGTM!

The new link tag for the favicon looks good.


72-72: LGTM!

The updated script tag for polyfills looks good.


1-1: LGTM!

The body section looks good.

packages/sanity-suite/public/v1.1/manualLoadCall/index-local.html (2)

4-4: Addition of favicon link looks good.

The link to the favicon enhances the visual branding of the web page.


102-102: Modification of polyfill script source URL looks good.

The updated URL includes additional features, enhancing compatibility across different environments.

packages/sanity-suite/public/v3/integrations/index-npm-bundled.html (7)

4-4: Addition of favicon link looks good.

The link to the favicon enhances the visual branding of the web page.


9-25: Addition of OneTrust script looks good.

The script is correctly implemented to manage cookie consent.


27-58: Addition of RudderStack snippet looks good.

The snippet is correctly implemented to load the RudderStack SDK.


81-81: Addition of polyfill script source URL looks good.

The URL includes necessary features, enhancing compatibility across different environments.


83-94: Addition of globalThis polyfill looks good.

The polyfill ensures compatibility across different environments.


95-95: Addition of clipboard script looks good.

The script is correctly implemented to enable clipboard functionality.


108-118: Addition of jQuery script looks good.

The script is correctly implemented to enable jQuery functionality.

packages/sanity-suite/public/v3/manualLoadCall/index-npm-bundled.html (7)

4-4: Addition of favicon link looks good.

The link to the favicon enhances the visual branding of the web page.


9-25: Addition of OneTrust script looks good.

The script is correctly implemented to manage cookie consent.


27-58: Addition of RudderStack snippet looks good.

The snippet is correctly implemented to load the RudderStack SDK.


81-81: Addition of polyfill script source URL looks good.

The URL includes necessary features, enhancing compatibility across different environments.


83-94: Addition of globalThis polyfill looks good.

The polyfill ensures compatibility across different environments.


95-95: Addition of clipboard script looks good.

The script is correctly implemented to enable clipboard functionality.


108-118: Addition of jQuery script looks good.

The script is correctly implemented to enable jQuery functionality.

packages/sanity-suite/rollup.config.mjs (9)

19-21: Constants definition improves readability.

Defining SERVER_PORT, BASE_CDN_URL, and DEFAULT_SDK_VERSION as constants enhances code clarity and maintainability.


24-24: Variable renaming enhances clarity.

Renaming isLegacy to isLegacySdk makes the code more readable by clearly indicating its purpose.


48-49: Consistent changes.

The changes are consistent with the rest of the code.


58-59: Consistent use of renamed variable.

The getJSSource function now uses the isLegacySdk variable, maintaining consistency and improving readability.


67-82: Enhanced robustness in getDestinationSDKBaseURL.

The function now returns a default value when DEST_SDK_BASE_URL is not set, enhancing robustness.


84-97: Improved clarity in getPluginsBaseURL.

The function now effectively uses the new constants, improving code clarity and maintainability.


106-109: Consistent changes.

The changes are consistent with the rest of the code.


128-144: Consistent changes.

The changes are consistent with the rest of the code.


Line range hint 171-216:
Consistent use of new constants in build configuration.

The build configuration object now uses the getDestinationSDKBaseURL and getPluginsBaseURL functions, promoting consistency and reducing potential errors.

@saikumarrs saikumarrs merged commit 22e43da into develop Jul 29, 2024
9 of 10 checks passed
@saikumarrs saikumarrs deleted the fix.fix-npm-sanity-suites-sdk-2075 branch July 29, 2024 10:09
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.

2 participants