-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(webex-core): method for manually updating the host catalog #4033
base: next
Are you sure you want to change the base?
Conversation
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
warning eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options. (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) WalkthroughThe changes introduce a new method Changes
Sequence DiagramsequenceDiagram
participant Client
participant Services
participant Catalog
Client->>Services: updateCatalog(serviceGroup, hostMap)
Services->>Catalog: _getCatalog()
Services->>Services: _formatReceivedHostmap(hostMap)
Services->>Catalog: Update service URLs
Services-->>Client: Updated catalog
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
packages/@webex/webex-core/src/lib/services/services.js (1)
507-513
: Validate service group & provide error handlingIt may be prudent to add validation for "serviceGroup" (e.g., ensuring it is one of "preauth", "signin", or "postauth") to guard against misconfiguration. Consider also providing error handling or reject conditions for malformed inputs.
packages/@webex/webex-core/test/unit/spec/services/services.js (1)
291-308
: Good test coverage with potential for negative testsThis test effectively verifies that a properly formatted host map updates the catalog as expected. Consider adding a negative test case to verify the behavior when "_formatReceivedHostmap" or "updateServiceUrls" throws an error, ensuring robust coverage of failure paths.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/@webex/webex-core/src/lib/services/services.js
(1 hunks)packages/@webex/webex-core/test/unit/spec/services/services.js
(1 hunks)
🔇 Additional comments (1)
packages/@webex/webex-core/src/lib/services/services.js (1)
501-506
: Docstring looks good
The new JSDoc comments are clear and consistent with the existing style.
This pull request is automatically being deployed by Amplify Hosting (learn more). |
COMPLETES #< INSERT LINK TO ISSUE >
This pull request addresses
It will be necessary to update the catalog with an externally supplied host map
by making the following changes
A new method to allow for updating of a particular service catalog
Change Type
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
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.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
updateCatalog
method to ensure proper functionality and error handling.