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

Port 8082 has been assigned to this service, updated ports for all microservices, and modified database connection in the environment configuration. #67

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

Asp-irin
Copy link

@Asp-irin Asp-irin commented Jan 21, 2025

📋 Description

The service is now configured to run on port 8082. Additionally, the ports for all microservices have been updated to ensure consistent and conflict-free communication. The database connection settings in the environment configuration have also been modified to align with the latest setup, ensuring seamless integration and connectivity across services.


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

Summary by CodeRabbit

  • Configuration Updates

    • Added common-url configuration across multiple environment property files
    • Updated database connection settings in example properties file
    • Modified application URLs for common force logout and biological screening device
  • Environment Configurations

    • Added common-url in CI, dev, test, and UAT environment properties
    • Set local server port to 8082 in example properties
    • Updated database connection details for local MySQL database

Copy link

coderabbitai bot commented Jan 21, 2025

Walkthrough

The pull request introduces configuration changes across multiple environment-specific properties files and the main application properties. The primary modifications involve adding a new common-url configuration in various environment files (CI, dev, test, and UAT) and updating specific URLs in the main application properties. The changes appear to be standardizing configuration settings across different deployment environments and adjusting some service endpoint URLs.

Changes

File Change Summary
src/main/environment/admin_*.properties Added common-url configuration with values like http://localhost:8083/ or @env.COMMON_URL@
src/main/environment/admin_example.properties Updated database connection settings (URL, username, password) and added server.port=8082
src/main/resources/application.properties Updated URLs:
- common-forcelogout changed to /user/userForceLogout
- biological-screening-device-url updated to http://localhost:8096/ezdx-hub-connect-srv

Poem

🐰 Configuration rabbit hops along,
Tweaking URLs with a merry song,
Properties dance from dev to test,
Each environment now passes the quest!
Code configuration, clean and bright,
Deployment settings now just right! 🚀


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>, please review it.
    • 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 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 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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. (Beta)
  • @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.

CodeRabbit Configuration 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/schema.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.

logging.file.name=@env.ADMIN_API_LOGGING_FILE_NAME@

common-url=http://localhost:8083/
Copy link
Member

Choose a reason for hiding this comment

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

For Ci, please use the placeholder with @@ here.
Check how common API Base URL is mentioned in other CI files.

Copy link
Member

Choose a reason for hiding this comment

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

@Asp-irin this is pending

@@ -82,6 +80,7 @@ swymed-edituser-url=swymed-base-url/SwymedWebApi/api/Contact

calibrationPageSize=5

#check this
Copy link
Member

Choose a reason for hiding this comment

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

remove comment.

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 details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 070eac5 and 2e1dbec.

📒 Files selected for processing (6)
  • src/main/environment/admin_ci.properties (1 hunks)
  • src/main/environment/admin_dev.properties (1 hunks)
  • src/main/environment/admin_example.properties (1 hunks)
  • src/main/environment/admin_test.properties (1 hunks)
  • src/main/environment/admin_uat.properties (1 hunks)
  • src/main/resources/application.properties (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/main/environment/admin_test.properties
🔇 Additional comments (5)
src/main/environment/admin_example.properties (2)

1-1: LGTM! Port configuration aligns with PR objectives.

The server port configuration matches the intended port 8082 as specified in the PR objectives.


18-18: Verify the common-url configuration.

The common-url is set to localhost:8083, which needs verification to ensure it matches the intended service.

Run this script to check common-url usage across the codebase:

✅ Verification successful

The common-url configuration is correctly set for the development environment

The value http://localhost:8083/ is consistent across development environments (dev/test/uat) and is used as a base URL for internal service communication (password encryption, CTI, and campaign management). The CI environment properly uses environment variable injection via @env.COMMON_URL@ for production deployment.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for references to common-url in the codebase
echo "Searching for common-url usage in code..."
rg -l "common-url|common\.url" --type java

echo "Searching for localhost:8083 references..."
rg "localhost:8083" --type properties

Length of output: 750


Script:

#!/bin/bash
# Check common-url values across environment files
echo "=== Environment Files Content ==="
for file in src/main/environment/admin_*.properties; do
  echo "=== $file ==="
  grep "common-url" "$file" || true
done

echo -e "\n=== localhost:8083 References ==="
rg "localhost:8083"

echo -e "\n=== Java Usage Patterns ==="
rg -A 3 "common.url|common-url" --type java

Length of output: 6986

src/main/environment/admin_ci.properties (1)

23-23: LGTM! Correct usage of environment variable in CI.

The common-url configuration correctly uses the environment variable placeholder, which is the appropriate approach for CI environments.

src/main/resources/application.properties (2)

15-15: Verify the impact of force logout path change.

The change from a full URL to a relative path needs verification to ensure all services can handle this change.

Run this script to check usage:

✅ Verification successful

Force logout path change is properly handled

The relative path change is safe as the code in EmployeeMasterServiceImpl properly combines it with the base URL before use.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for force logout URL usage
echo "Searching for force logout implementations..."
ast-grep --pattern 'common-forcelogout' --lang java

Length of output: 152


Script:

#!/bin/bash
# Search for force logout related configurations and implementations
echo "Searching for force logout property references..."
rg -i "common-forcelogout|forcelogout" -g "*.{java,properties,yml,yaml,xml}" -A 2 -B 2

echo -e "\nSearching for userForceLogout endpoint implementations..."
rg -i "userForceLogout" -g "*.{java,properties,yml,yaml,xml}" -A 2 -B 2

Length of output: 2111


80-80: Verify biological screening device port change.

The port change from 8085 to 8096 needs verification to ensure it's coordinated with the device service deployment.

Run this script to check port usage:

Comment on lines +4 to +6
spring.datasource.url=jdbc:mysql://localhost:3306/db_iemr
spring.datasource.username=root
spring.datasource.password=1234
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Security: Replace database credentials with placeholders.

Even in example properties files, it's not recommended to commit actual database credentials. Replace them with placeholders to prevent potential security risks.

Apply this diff:

-spring.datasource.url=jdbc:mysql://localhost:3306/db_iemr
-spring.datasource.username=root
-spring.datasource.password=1234
+spring.datasource.url=<Enter your DB URL here>
+spring.datasource.username=<Enter your DB username>
+spring.datasource.password=<Enter your DB password>
📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
spring.datasource.url=jdbc:mysql://localhost:3306/db_iemr
spring.datasource.username=root
spring.datasource.password=1234
spring.datasource.url=<Enter your DB URL here>
spring.datasource.username=<Enter your DB username>
spring.datasource.password=<Enter your DB password>

spring.redis.host=localhost
spring.main.allow-bean-definition-overriding=true

common-url=http://localhost:8083/
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Critical: Remove hardcoded localhost URL in UAT environment.

Using localhost in the UAT environment configuration is incorrect and will cause connectivity issues. UAT should use actual service URLs.

Apply this diff:

-common-url=http://localhost:8083/
+common-url=<Enter UAT common service URL>

Committable suggestion skipped: line range outside the PR's diff.

callcentre-server-ip=10.208.122.99

videoConsultation-apikey=<Enter Swymed API key>
videoConsultation-base-url=https://psmri.swymed.com:92744
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix incorrect port in video consultation URL.

The port number 92744 appears to have an extra digit compared to other environment files (9274).

Apply this diff:

-videoConsultation-base-url=https://psmri.swymed.com:92744
+videoConsultation-base-url=https://psmri.swymed.com:9274
📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
videoConsultation-base-url=https://psmri.swymed.com:92744
videoConsultation-base-url=https://psmri.swymed.com:9274

@@ -82,7 +77,7 @@ swymed-edituser-url=swymed-base-url/SwymedWebApi/api/Contact

calibrationPageSize=5

biological-screening-device-url=http://localhost:8085/ezdx-hub-connect-srv
biological-screening-device-url=http://localhost:8096/ezdx-hub-connect-srv
Copy link
Member

Choose a reason for hiding this comment

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

What is this change about?
@ravishanigarapu do you know what this URL is?

Copy link
Author

Choose a reason for hiding this comment

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

8085 is assigned to someother API, so i shifted it to 8096, which is vacant

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.

2 participants