Skip to content

Assigned port 8085, updated ports for all microservices, and modified database connection in the environment configuration.#115

Merged
drtechie merged 5 commits intoPSMRI:developfrom
Asp-irin:develop
Jan 21, 2025
Merged

Assigned port 8085, updated ports for all microservices, and modified database connection in the environment configuration.#115
drtechie merged 5 commits intoPSMRI:developfrom
Asp-irin:develop

Conversation

@Asp-irin
Copy link
Contributor

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

Description

  • Assigned port 8085 for a specific service.
  • Updated the ports for all microservices to match the new configuration.
  • Modified the database connection settings in the environment configuration for proper connectivity.

Summary by CodeRabbit

  • Configuration Updates
    • Updated database connection settings with local MySQL credentials.
    • Modified service URLs to use different ports across various endpoints.
    • Added Redis port configuration.
    • Set application server port to 8085.
    • Introduced a JDBC interceptor for managing abandoned connections in the Tomcat connection pool.

@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2025

Walkthrough

This pull request updates the configuration files for a local development environment. Key changes in common_example.properties include the addition of a server port setting, specific database connection parameters, and modifications to various service URLs to reflect new ports. The application.properties file sees the introduction of a JDBC interceptor for managing abandoned connections. These adjustments enhance the configuration for local development, ensuring proper connectivity across services.

Changes

File Changes
src/main/environment/common_example.properties - Added server.port=8085
- Updated database connection details (URL, username, password)
- Modified multiple service URLs to use different ports (8083, 8087, 8088, 8094)
- Added Redis port configuration (spring.redis.port=6379)
src/main/resources/application.properties - Added spring.datasource.tomcat.jdbc-interceptors=ResetAbandonedTimer

Poem

🐰 Ports dancing, configs bright,
Localhost leaps with pure delight!
MySQL whispers, Redis sings,
Each number a new connection brings.
Code hops freely, settings clear! 🌈


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.

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: 1

🧹 Nitpick comments (1)
src/main/environment/common_example.properties (1)

89-89: Document Redis configuration requirements.

The Redis port configuration has been added, but consider:

  1. Adding comments explaining Redis usage
  2. Documenting failover/cluster configuration if applicable
  3. Specifying minimum Redis version requirements
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e1eab26 and 54c0a13.

📒 Files selected for processing (2)
  • src/main/environment/common_example.properties (2 hunks)
  • src/main/resources/application.properties (1 hunks)
🔇 Additional comments (3)
src/main/resources/application.properties (1)

1-1: Verify port 8085 availability across environments.

The new port assignment aligns with the PR objectives. However, we should verify:

  1. No conflicts with other microservices
  2. Port availability in all deployment environments
  3. Firewall rules and security group configurations
✅ Verification successful

Port 8085 is unique across all configurations

The port assignment has been verified across all configuration files, including environment-specific properties. No conflicts were found, making port 8085 safe to use.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for potential port conflicts in configuration files
echo "Checking for port 8085 usage in other configurations..."
rg -l "port.*8085|8085" --type properties

Length of output: 199


Script:

#!/bin/bash
# Find all possible configuration files
echo "Finding configuration files..."
fd -e properties -e yml -e yaml -e conf

echo -e "\nChecking for port 8085 usage..."
rg "port.*8085|8085" -i --type-add 'config:*.{properties,yml,yaml,conf}' --type config

Length of output: 677

src/main/environment/common_example.properties (2)

15-15: Verify integration with ID service on port 8094.

Several identity-related endpoints use port 8094, while others use 8083. This inconsistency might indicate:

  1. Incomplete port migration
  2. Split service architecture
  3. Potential configuration errors

Also applies to: 17-17, 23-23


9-9: Standardize service port assignments.

The configuration shows inconsistent port usage across different services:

  • Identity/Registration services: 8083
  • Data sync services: 8087
  • TC specialist services: 8088
  • Search services: 8094

Consider:

  1. Documenting the port allocation strategy
  2. Using consistent ports for related services
  3. Adding comments explaining the service groupings

Also applies to: 13-13, 19-19, 21-21, 26-26, 29-29, 32-32, 35-35, 38-38, 41-41, 44-44, 47-47, 50-50

Comment on lines +3 to +5
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: Avoid committing credentials in configuration files.

The database credentials should not be committed to version control, even in example files. Consider:

  1. Using placeholder values (e.g., ${DB_USERNAME}, ${DB_PASSWORD})
  2. Documenting the required variables in README
  3. Using a secure secrets management solution
-spring.datasource.url=jdbc:mysql://localhost:3306/db_iemr
-spring.datasource.username=root
-spring.datasource.password=1234
+spring.datasource.url=${DB_URL:jdbc:mysql://localhost:3306/db_iemr}
+spring.datasource.username=${DB_USERNAME}
+spring.datasource.password=${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=${DB_URL:jdbc:mysql://localhost:3306/db_iemr}
spring.datasource.username=${DB_USERNAME}
spring.datasource.password=${DB_PASSWORD}

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: 1

♻️ Duplicate comments (1)
src/main/environment/common_example.properties (1)

4-6: ⚠️ Potential issue

Security: Credentials should not be committed in configuration files.

The database credentials are still hardcoded in the configuration file. This is a security risk that needs to be addressed.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 54c0a13 and 4a15505.

📒 Files selected for processing (2)
  • src/main/environment/common_example.properties (2 hunks)
  • src/main/resources/application.properties (0 hunks)
💤 Files with no reviewable changes (1)
  • src/main/resources/application.properties
🔇 Additional comments (4)
src/main/environment/common_example.properties (4)

2-2: LGTM: Server port configuration is appropriate.

The port assignment to 8085 aligns with the PR objectives and is within a suitable range for microservices.


10-10: LGTM: Service ports updated consistently.

The port updates across different services have been implemented consistently, aligning with the microservices architecture.

Also applies to: 14-14, 16-16, 18-18, 20-20, 22-22, 24-24, 27-27, 30-30, 33-33, 36-36, 39-39, 42-42, 45-45, 48-48, 51-51


90-90: LGTM: Redis configuration uses standard port.

The Redis port configuration follows the standard practice of using port 6379.


Line range hint 1-90: Verify completeness of port updates.

While the port changes look consistent, please verify that all required microservices have been updated. The PR objectives mention updating ports for all microservices.

✅ Verification successful

Port updates are complete and consistent

All microservice endpoints are using the updated port numbers consistently, with no instances of the old ports (8080, 9091) found in the configuration.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining URLs with old ports (8080, 9091)
rg -i "localhost:(8080|9091)" --type properties

Length of output: 84


Script:

#!/bin/bash
# Search for any remaining URLs with old ports (8080, 9091) in all files
rg -i "localhost:(8080|9091)" --glob "*.properties"

# Also search for all localhost URLs to verify port consistency
rg -i "localhost:\d+" --glob "*.properties"

Length of output: 2088


## Data Sync API
dataSyncUploadUrl==http://localhost:8080/dataSync/van-to-server
dataSyncUploadUrl==http://localhost:8087/dataSync/van-to-server
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 property assignment syntax.

The data sync URLs use incorrect syntax with double equals signs.

Apply this fix:

-dataSyncUploadUrl==http://localhost:8087/dataSync/van-to-server
+dataSyncUploadUrl=http://localhost:8087/dataSync/van-to-server

-dataSyncDownloadUrl==http://localhost:8087/dataSync/server-to-van
+dataSyncDownloadUrl=http://localhost:8087/dataSync/server-to-van

Also applies to: 39-39

@sonarqubecloud
Copy link

@drtechie drtechie merged commit a70fa30 into PSMRI:develop Jan 21, 2025
2 checks passed
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