fix: updated u2c logic to filter out urls with negative priority
COMPLETES #< INSERT LINK TO ISSUE >
This pull request addresses
- Current u2c logic doesn't support update to u2c backend that marks some service urls with a negative priority (-1)
by making the following changes
- Updating filter function when looking for the priority host that removes urls with negative priority as well as hosts that are marked as failed (current logic only looks if url is marked as failed)
Change Type
- [x] 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
Manually tested, and tests written
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)
- [x] Tool used for AI assistance (GitHub Copilot / Other - specify)
- [x] Github Copilot
- [ ] Other - Please Specify
- [ ] This PR is related to
- [ ] Feature
- [ ] Defect fix
- [ ] Tech Debt
- [ ] Automation
I certified that
- [x] I have read and followed contributing guidelines
- [x] I discussed changes with code owners prior to submitting this pull request
- [x] I have not skipped any automated checks
- [x] All existing and new tests passed
- [x] I have updated the documentation accordingly
Make sure to have followed the contributing guidelines before submitting.
The changes modify the logic in the host selection process within the service URL handling code to ensure that only hosts with a positive priority are considered when determining the highest-priority host. Specifically, the reduce function now includes an explicit check for the current host's priority being greater than zero before it can be selected. Additionally, a new integration test was added to verify that hosts with a priority of -1 are correctly ignored in host selection, ensuring that only valid hosts are returned by the service URL resolution logic. ๐ฏ 2 (Simple) | โฑ๏ธ ~7 minutes๐ Walkthrough
Walkthrough
Estimated code review effort
[!NOTE]
โก๏ธ Unit Test Generation is now available in beta!
Learn more here, or try it out under "Finishing Touches" below.
๐ Recent review details
Configuration used: .coderabbit.yaml Review profile: CHILL Plan: Pro
๐ฅ Commits
Reviewing files that changed from the base of the PR and between f3d43b184acf5b23d5eaabf215814c915cf63ad6 and 9450eee522e138ac39ef07ebed07e7410a09aceb.
๐ Files selected for processing (1)
packages/@webex/webex-core/test/integration/spec/services/services.js(1 hunks)
๐ง Files skipped from review as they are similar to previous changes (1)
- packages/@webex/webex-core/test/integration/spec/services/services.js
โฐ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Initialize Project
- GitHub Check: AWS Amplify Console Web Preview
โจ Finishing Touches
- [ ] ๐ Generate Docstrings
๐งช Generate unit tests
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
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.
๐ชง 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
@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai explain this code block.@coderabbitai modularize this function.
- PR comments: Tag
@coderabbitaiin 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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai generate unit teststo generate unit tests for this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere 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.
This pull request is automatically being deployed by Amplify Hosting (learn more).
Access this pull request here: https://pr-4416.d3m3l2kee0btzx.amplifyapp.com
From andrew biggs -> https://wwwin-github.cisco.com/pages/Webex/crr-docs/techdocs/rr-005.html#intolerant-clients