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

Task #0000 fix: Orchestration Api Url changes #28

Merged
merged 1 commit into from
Apr 4, 2024
Merged

Task #0000 fix: Orchestration Api Url changes #28

merged 1 commit into from
Apr 4, 2024

Conversation

deepali-chavhan
Copy link
Contributor

@deepali-chavhan deepali-chavhan commented Apr 3, 2024

Summary by CodeRabbit

  • New Features
    • Updated API endpoint hosts across various components for enhanced service integration.
    • Modified API endpoint URLs in urlConstants.json for better clarity and consistency.
  • Improvements
    • Adjusted the condition for percentage range checks in VoiceAnalyser.js for more accurate feedback.
  • Refactor
    • Standardized the use of milestone parameter across components, replacing milestoneLevel.

Copy link

coderabbitai bot commented Apr 3, 2024

Walkthrough

The recent updates primarily focus on standardizing API endpoint hosts across various components, shifting from a specific app host to a more general orchestration host. Additionally, there's a minor adjustment in the voice analysis logic and a simplification in parameter naming for better clarity. These changes are aimed at enhancing the system's integration and data handling capabilities.

Changes

Files Change Summary
.../Assesment/Assesment.jsx
.../AssesmentEnd/AssesmentEnd.jsx
.../DiscoverSentance/DiscoverSentance.jsx
.../Practice/Practice.jsx
Updated API endpoint host from REACT_APP_LEARNER_AI_APP_HOST to REACT_APP_LEARNER_AI_ORCHESTRATION_HOST. Parameter milestoneLevel changed to milestone.
src/utils/VoiceAnalyser.js Adjusted percentage range check for assigning redLivesToShow and blackLivesToShow from 24 <= percentage <= 29 to 24 <= percentage <= 30.
src/utils/urlConstants.json Modified endpoint URLs for getting and adding pointers. GET_POINTER endpoint changed to "api/pointer/getPoints" and ADD_POINTER endpoint updated to "api/pointer/addPoints".

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration 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/coderabbit-overrides.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

@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: 3

Review Status

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 03b253b and 7a14270.
Files selected for processing (6)
  • src/components/Assesment/Assesment.jsx (2 hunks)
  • src/components/AssesmentEnd/AssesmentEnd.jsx (1 hunks)
  • src/components/DiscoverSentance/DiscoverSentance.jsx (2 hunks)
  • src/utils/VoiceAnalyser.js (1 hunks)
  • src/utils/urlConstants.json (1 hunks)
  • src/views/Practice/Practice.jsx (2 hunks)
Additional comments not posted (6)
src/utils/urlConstants.json (2)

5-5: LGTM! The update to the GET_POINTER endpoint URL aligns with the PR objectives.


7-7: LGTM! The update to the ADD_POINTER endpoint URL aligns with the PR objectives.

src/utils/VoiceAnalyser.js (1)

441-441: LGTM! The adjustment to the percentage range check aligns with the PR objectives and potentially improves the voice analysis feature.

src/components/Assesment/Assesment.jsx (1)

516-516: Ensure the environment variable REACT_APP_LEARNER_AI_ORCHESTRATION_HOST is correctly configured in your deployment environment.

Also applies to: 541-541

src/views/Practice/Practice.jsx (2)

146-146: Ensure the environment variable REACT_APP_LEARNER_AI_ORCHESTRATION_HOST is correctly configured in your deployment environment.


152-152: Verify that the backend API correctly expects the parameter name milestone instead of milestoneLevel.

@@ -44,7 +44,7 @@ const AssesmentEnd = () => {
setLocalData("userLevel", data.data.milestone_level?.replace("m", ""));
const sessionId = getLocalData("sessionId");
const getPointersDetails = await axios.get(
`${process.env.REACT_APP_LEARNER_AI_APP_HOST}/${config.URLS.GET_POINTER}/${virtualId}/${sessionId}?language=${lang}`
`${process.env.REACT_APP_LEARNER_AI_ORCHESTRATION_HOST}/${config.URLS.GET_POINTER}/${virtualId}/${sessionId}?language=${lang}`
Copy link

Choose a reason for hiding this comment

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

Consider encapsulating the access to environment variables in a configuration module or utility function. This approach enhances maintainability and testing.

- `${process.env.REACT_APP_LEARNER_AI_ORCHESTRATION_HOST}/${config.URLS.GET_POINTER}/${virtualId}/${sessionId}?language=${lang}`
+ `${getApiHost()}/${config.URLS.GET_POINTER}/${virtualId}/${sessionId}?language=${lang}`

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
`${process.env.REACT_APP_LEARNER_AI_ORCHESTRATION_HOST}/${config.URLS.GET_POINTER}/${virtualId}/${sessionId}?language=${lang}`
`${getApiHost()}/${config.URLS.GET_POINTER}/${virtualId}/${sessionId}?language=${lang}`

@@ -71,7 +71,7 @@ const SpeakSentenceComponent = () => {
const virtualId = getLocalData("virtualId");
const lang = getLocalData("lang");
const getPointersDetails = await axios.get(
`${process.env.REACT_APP_LEARNER_AI_APP_HOST}/${config.URLS.GET_POINTER}/${virtualId}/${sessionId}?language=${lang}`
`${process.env.REACT_APP_LEARNER_AI_ORCHESTRATION_HOST}/${config.URLS.GET_POINTER}/${virtualId}/${sessionId}?language=${lang}`
Copy link

Choose a reason for hiding this comment

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

Consider encapsulating the access to environment variables in a configuration module or utility function, similar to previous recommendations.

- `${process.env.REACT_APP_LEARNER_AI_ORCHESTRATION_HOST}/${config.URLS.GET_POINTER}/${virtualId}/${sessionId}?language=${lang}`
+ `${getApiHost()}/${config.URLS.GET_POINTER}/${virtualId}/${sessionId}?language=${lang}`

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
`${process.env.REACT_APP_LEARNER_AI_ORCHESTRATION_HOST}/${config.URLS.GET_POINTER}/${virtualId}/${sessionId}?language=${lang}`
`${getApiHost()}/${config.URLS.GET_POINTER}/${virtualId}/${sessionId}?language=${lang}`

Comment on lines +122 to +128
`${process.env.REACT_APP_LEARNER_AI_ORCHESTRATION_HOST}/${config.URLS.ADD_POINTER}`,
{
userId: localStorage.getItem("virtualId"),
sessionId: localStorage.getItem("sessionId"),
points: 1,
language: lang,
milestoneLevel: "m0",
milestone: "m0",
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

The verification process has revealed that the old parameter name milestoneLevel is still present in multiple locations within the application, specifically in src/views/Practice/Practice.jsx and src/components/DiscoverSentance/DiscoverSentance.jsx. This suggests that the change to milestone may not have been consistently applied across the application.

Analysis chain

Ensure the change from milestoneLevel to milestone is consistently applied across the application to maintain parameter naming consistency.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for occurrences of the old parameter name to ensure it's been fully updated.
rg --type js "milestoneLevel"

Length of output: 703

@gouravmore gouravmore merged commit ea4f3d8 into Sunbird-ALL:all-1.1 Apr 4, 2024
bharathrams pushed a commit to Bhashabyasa/nd-all-learner-ai-app that referenced this pull request Nov 25, 2024
…n-service

Task #0000 fix: Orchestration Api Url changes
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.

3 participants