Skip to content

Conversation

@Kesari3008
Copy link
Contributor

@Kesari3008 Kesari3008 commented May 11, 2025

COMPLETES #https://jira-eng-sjc12.cisco.com/jira/browse/CAI-6482

This pull request addresses

Import webex from @webex/plugin-cc via NPM

by making the following changes

Moved the webex init and export logic within plugin-cc.

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

Testcase 1: Tested contact-center-min.js by testing in SDK Kiichen Sink App
Testcase 2: Locally linked SDK in widgets repo, updated the import and dependency to use @webex/plugin-cc and tested in widgets react sample app.

Vidcast: https://app.vidcast.io/share/c734d2a1-8f5a-4fa1-9b17-7a1ac958f6d3

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines

  • I discussed changes with code owners prior to submitting this pull request

  • I have not skipped any automated checks

  • All existing and new tests passed

  • I have updated the documentation accordingly


Make sure to have followed the contributing guidelines before submitting.

@Kesari3008 Kesari3008 added the validated If the pull request is validated for automation. label May 11, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 11, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

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

📝 Walkthrough

Walkthrough

This set of changes updates the @webex/plugin-cc package by replacing the existing Babel JSON configuration with a new Babel config file that explicitly specifies plugins and presets, including package version injection. The package.json is modified to add contributors, change the main entry point to dist/webex.js, add an exports field, update dependencies by adding internal workspace packages and lodash, and remove the buffer package. A new webex-config.ts file is introduced to centralize configuration parameters. The main module switches from CommonJS requires to ES module imports and merges a new default config during initialization. The webpack config updates the contact-center entry import path. The root webex package removes the contact-center export and updates contributors. The Jest config for @webex/plugin-cc is adjusted to transform the uuid package during tests, and a minor cleanup removes an unused import in a test file.

Possibly related PRs


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

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.

@aws-amplify-us-east-2
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4258.d3m3l2kee0btzx.amplifyapp.com

@Kesari3008 Kesari3008 marked this pull request as ready for review May 12, 2025 08:52
@Kesari3008 Kesari3008 requested a review from a team as a code owner May 12, 2025 08:52
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: 1

🧹 Nitpick comments (1)
packages/@webex/plugin-cc/src/webex-config.ts (1)

3-6: Deduplicate Hydra Service URL keys
Both hydra and hydraServiceUrl are set to the same value. Consider removing one key to avoid redundancy and potential confusion in downstream code.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1508cfe and 0c68d2f.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (8)
  • packages/@webex/plugin-cc/babel.config.js (1 hunks)
  • packages/@webex/plugin-cc/babel.config.json (0 hunks)
  • packages/@webex/plugin-cc/package.json (2 hunks)
  • packages/@webex/plugin-cc/src/webex-config.ts (1 hunks)
  • packages/@webex/plugin-cc/src/webex.js (1 hunks)
  • packages/webex/package.json (0 hunks)
  • packages/webex/src/contact-center.js (0 hunks)
  • webpack.config.js (1 hunks)
💤 Files with no reviewable changes (3)
  • packages/@webex/plugin-cc/babel.config.json
  • packages/webex/src/contact-center.js
  • packages/webex/package.json
🧰 Additional context used
🧬 Code Graph Analysis (1)
webpack.config.js (1)
tooling/lib/build.js (1)
  • path (5-5)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: AWS Amplify Console Web Preview
🔇 Additional comments (6)
packages/@webex/plugin-cc/babel.config.js (1)

1-3: Legacy Babel Configuration Integration
The package now directly reuses the shared legacy Babel configuration, ensuring consistent transpilation settings with other Webex packages.

webpack.config.js (1)

57-63: Update contact-center entry to use new plugin-cc module
The entry point for contact-center now correctly points to packages/@webex/plugin-cc/src/webex.js, reflecting the migration of contact-center functionality into its own scoped package.

packages/@webex/plugin-cc/package.json (2)

16-20: Explicit exports field correctly exposes entry points
The new exports map cleanly delineates the package root, the standalone ./webex entrypoint, and package.json, matching the refactored module layout.


45-51: Add necessary plugin dependencies and utility libraries
New internal plugin dependencies (@webex/internal-plugin-support, @webex/plugin-authorization, @webex/plugin-logger) and lodash for deep-merging configuration have been added to support the webex.js implementation.

packages/@webex/plugin-cc/src/webex.js (2)

1-7: Avoid importing the package root within itself
Importing @webex/plugin-cc inside its own module may introduce circular dependencies. Verify that this is intentional (e.g., to register the plugin) and doesn’t lead to self-referencing issues. If not, switch to a relative import of the specific internal module.


16-19: Correct merging of configuration attributes
The init method properly creates a fresh config object by merging the default SDK type, local settings, and user overrides—preventing mutation of the imported config. Implementation looks solid.

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

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cf91e3f and 69a05dd.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • packages/@webex/plugin-cc/babel.config.js (1 hunks)
  • packages/@webex/plugin-cc/jest.config.js (1 hunks)
  • packages/@webex/plugin-cc/test/unit/spec/services/task/TaskManager.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • packages/@webex/plugin-cc/test/unit/spec/services/task/TaskManager.ts
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Initialize Project
  • GitHub Check: AWS Amplify Console Web Preview
🔇 Additional comments (1)
packages/@webex/plugin-cc/babel.config.js (1)

1-14: LGTM: Babel configuration provides proper transpilation support

This new Babel configuration replaces the previous JSON configuration and provides proper support for:

  • Package version injection via custom plugin
  • Modern JavaScript features through preset-env targeting current Node
  • TypeScript transpilation

This aligns with the PR objective of restructuring imports to enable directly importing Webex from the @webex/plugin-cc package.

Copy link
Contributor

@sreenara sreenara left a comment

Choose a reason for hiding this comment

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

Please document the tests in the Test section apart from the vidcast.
Good to see this change.
We need to also have changes in the w4d-docs and beta instruction document. Do we have PRs for them?

Copy link
Contributor

@mkesavan13 mkesavan13 left a comment

Choose a reason for hiding this comment

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

Except for comments from Sreekanth, the code changes look good to me. However, here's my list:

  • This is a breaking change PR for the widgets. So, we need to locally link and test the widgets first. A recording of it will be good
  • We also need to have the PR ready on the widgets to quickly update this version, do a thorough testing in the PR amplify app of widgets and merge it in. This is because, if the widgets PR doesn't merge immediately, it is going to block all our SDK fixes from going into widgets

Or as another option, we can have a backward compatible change, take time to make changes in the widgets, test it out extensively, merge and come back here to remove the backward compatibility.

@Kesari3008
Copy link
Contributor Author

Except for comments from Sreekanth, the code changes look good to me. However, here's my list:

  • This is a breaking change PR for the widgets. So, we need to locally link and test the widgets first. A recording of it will be good
  • We also need to have the PR ready on the widgets to quickly update this version, do a thorough testing in the PR amplify app of widgets and merge it in. This is because, if the widgets PR doesn't merge immediately, it is going to block all our SDK fixes from going into widgets

Or as another option, we can have a backward compatible change, take time to make changes in the widgets, test it out extensively, merge and come back here to remove the backward compatibility.

I have the changes ready in widgets with local SDK package linked. Vidcast has the recording for widgets testing also. I will go ahead and raise the PR in widgets the moment SDK version is released with this change. It's one line change in widget for import statement in store.ts file

@Kesari3008
Copy link
Contributor Author

Please document the tests in the Test section apart from the vidcast. Good to see this change. We need to also have changes in the w4d-docs and beta instruction document. Do we have PRs for them?

No we do not have PR for w4d-docs yet but let me get it ready. And update for beta doc also

@sreenara sreenara dismissed mkesavan13’s stale review May 19, 2025 04:39

Comments are addressed and Kesava is on leave.

Copy link
Contributor

@Shreyas281299 Shreyas281299 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@Kesari3008 Kesari3008 enabled auto-merge (squash) May 19, 2025 10:19
@Kesari3008 Kesari3008 merged commit 6d5df5e into webex:next May 19, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants