webex-js-sdk icon indicating copy to clipboard operation
webex-js-sdk copied to clipboard

fix: updated u2c logic to filter out urls with negative priority

Open johnsoter13 opened this issue 1 year ago โ€ข 3 comments

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.

johnsoter13 avatar Jul 29 '25 15:07 johnsoter13

๐Ÿ“ Walkthrough

Walkthrough

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.

Estimated code review effort

๐ŸŽฏ 2 (Simple) | โฑ๏ธ ~7 minutes

[!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.

โค๏ธ 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 generate unit tests to generate unit tests for 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.

coderabbitai[bot] avatar Jul 29 '25 15:07 coderabbitai[bot]

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

chrisadubois avatar Jul 30 '25 18:07 chrisadubois