fix: docker properties file to use right format#142
Conversation
📝 WalkthroughWalkthroughUpdated Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/environment/common_docker.properties`:
- Line 31: The property feedAuthUserName is mapped to the wrong env var (uses
${FEED_AUTH_URL}); update the mapping so feedAuthUserName=${FEED_AUTH_USERNAME}
to match the credential pair (the corresponding password uses
${FEED_AUTH_PASSWORD})—edit the feedAuthUserName entry in
common_docker.properties to reference FEED_AUTH_USERNAME.
- Line 15: Replace the legacy MySQL driver class value for the
spring.datasource.driver-class-name property in all environment property files
(currently set to com.mysql.jdbc.Driver) with the Connector/J 8.x compatible
class com.mysql.cj.jdbc.Driver; update the occurrences in the files that contain
spring.datasource.driver-class-name to use com.mysql.cj.jdbc.Driver so
datasource initialization works with MySQL Connector/J 8.2.0.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 40280937-db2c-4c99-93b2-6e76ebfc2e9c
📒 Files selected for processing (1)
src/main/environment/common_docker.properties
| spring.datasource.url=${DATABASE_URL} | ||
| spring.datasource.username=${DATABASE_USERNAME} | ||
| spring.datasource.password=${DATABASE_PASSWORD} | ||
| spring.datasource.driver-class-name=com.mysql.jdbc.Driver |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check configured MySQL connector dependency version and driver references.
fd -a "pom.xml" "build.gradle" "build.gradle.kts" | xargs -r rg -n -C2 'mysql-connector|mysql\.connector|com\.mysql\.jdbc\.Driver|com\.mysql\.cj\.jdbc\.Driver'Repository: PSMRI/FHIR-API
Length of output: 220
🏁 Script executed:
#!/bin/bash
# Find build configuration files
echo "=== Searching for build configuration files ==="
fd "pom\.xml|build\.gradle" --type f
echo -e "\n=== Searching for MySQL connector dependency ==="
fd "pom\.xml|build\.gradle" --type f | xargs -r rg -n "mysql-connector|mysql\.connector"
echo -e "\n=== Searching for driver class references ==="
rg -n "com\.mysql\.(jdbc|cj\.jdbc)\.Driver" --type properties --type java --type gradle --type xmlRepository: PSMRI/FHIR-API
Length of output: 389
🏁 Script executed:
#!/bin/bash
# Get the MySQL connector version from pom.xml
echo "=== MySQL connector dependency details from pom.xml ==="
rg -A 3 -B 1 "mysql-connector-j" pom.xml
# Check the driver class in the properties file
echo -e "\n=== Driver class in common_docker.properties ==="
cat -n src/main/environment/common_docker.properties | grep -i driverRepository: PSMRI/FHIR-API
Length of output: 440
🏁 Script executed:
#!/bin/bash
# Check for all references to MySQL driver classes in the codebase
echo "=== All references to MySQL driver classes ==="
rg "com\.mysql\.(jdbc|cj\.jdbc)\.Driver" -n
# Check if there are other properties files that might have the same issue
echo -e "\n=== Other properties files in environment config ==="
fd "\.properties$" src/main/environment/Repository: PSMRI/FHIR-API
Length of output: 611
Update MySQL driver class in all environment property files for Connector/J 8.2.0 compatibility.
com.mysql.jdbc.Driver is incompatible with MySQL Connector/J 8.x. The project uses version 8.2.0, which requires com.mysql.cj.jdbc.Driver. Using the legacy driver class will cause datasource initialization failures at runtime.
This issue exists in three files:
src/main/environment/common_docker.properties(line 15)src/main/environment/common_ci.properties(line 15)src/main/environment/common_example.properties(line 16)
Proposed fix
Update all three files:
-spring.datasource.driver-class-name=com.mysql.jdbc.Driver
+spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver📝 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.
| spring.datasource.driver-class-name=com.mysql.jdbc.Driver | |
| spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/environment/common_docker.properties` at line 15, Replace the legacy
MySQL driver class value for the spring.datasource.driver-class-name property in
all environment property files (currently set to com.mysql.jdbc.Driver) with the
Connector/J 8.x compatible class com.mysql.cj.jdbc.Driver; update the
occurrences in the files that contain spring.datasource.driver-class-name to use
com.mysql.cj.jdbc.Driver so datasource initialization works with MySQL
Connector/J 8.2.0.
| atomFeedURLPatientDemographic=/openmrs/ws/atomfeed/patient/ | ||
| atomFeedURLPatientEncounter=/openmrs/ws/atomfeed/encounter/ | ||
|
|
||
| feedAuthUserName=${FEED_AUTH_URL} |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify which env var is actually defined/used for feed auth username.
rg -n -C2 'feedAuthUserName|FEED_AUTH_URL|FEED_AUTH_USERNAME|feedAuthPassword' --type=properties --type=yaml --type=env --type=shRepository: PSMRI/FHIR-API
Length of output: 92
🏁 Script executed:
#!/bin/bash
# Search for references to feed auth variables across the entire repo
echo "=== Searching for feedAuthUserName ==="
rg -n 'feedAuthUserName' --no-heading
echo -e "\n=== Searching for FEED_AUTH_URL ==="
rg -n 'FEED_AUTH_URL' --no-heading
echo -e "\n=== Searching for FEED_AUTH_USERNAME ==="
rg -n 'FEED_AUTH_USERNAME' --no-heading
echo -e "\n=== Searching for feedAuthPassword ==="
rg -n 'feedAuthPassword' --no-heading
echo -e "\n=== Searching for FEED_AUTH in properties files ==="
find . -name "*.properties" -type f -exec grep -Hn "FEED_AUTH\|feedAuth" {} \;Repository: PSMRI/FHIR-API
Length of output: 2715
feedAuthUserName is mapped to the wrong environment variable.
feedAuthUserName uses ${FEED_AUTH_URL} while the corresponding password field correctly uses ${FEED_AUTH_PASSWORD}. This mismatch causes authentication failures at runtime since a URL value will be injected where a username is expected. The property should map to ${FEED_AUTH_USERNAME} for consistency.
Proposed fix
-feedAuthUserName=${FEED_AUTH_URL}
+feedAuthUserName=${FEED_AUTH_USERNAME}📝 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.
| feedAuthUserName=${FEED_AUTH_URL} | |
| feedAuthUserName=${FEED_AUTH_USERNAME} |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/environment/common_docker.properties` at line 31, The property
feedAuthUserName is mapped to the wrong env var (uses ${FEED_AUTH_URL}); update
the mapping so feedAuthUserName=${FEED_AUTH_USERNAME} to match the credential
pair (the corresponding password uses ${FEED_AUTH_PASSWORD})—edit the
feedAuthUserName entry in common_docker.properties to reference
FEED_AUTH_USERNAME.



📋 Description
JIRA ID: AMM-1625
Change @@ variables to ${}
✅ Type of Change
Summary by CodeRabbit