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

Cu 86bzf9c4p update platform je mpi images #324

Merged
merged 6 commits into from
Sep 12, 2024

Conversation

MatthewErispe
Copy link
Collaborator

@MatthewErispe MatthewErispe commented Aug 16, 2024

Summary by CodeRabbit

  • New Features

    • Introduced structured schemas for managing patient and auxiliary demographic data fields, enhancing data integrity and user experience.
    • Added new services in Docker configurations, allowing targeted deployment for improved resource management.
    • Enhanced Dgraph cluster setup with additional services and improved scalability.
  • Bug Fixes

    • Increased file upload limit to 128MB in secure HTTP configuration for better handling of data submissions.
    • Updated default password for OpenHIM API to strengthen security.
  • Chores

    • Updated metadata and configuration settings, improving overall application functionality and maintainability.

@rcrichton
Copy link
Member

Task linked: CU-86bzf9c4p Update Platform JeMPI images

Copy link
Contributor

coderabbitai bot commented Aug 16, 2024

Walkthrough

The recent updates enhance the JeMPI project by introducing new configuration files and Docker Compose setups. These changes improve the handling of patient records, auxiliary interactions, and demographic data, while also refining service deployment within a clustered environment. Enhanced logging, resource management, and support for larger file uploads ensure a robust framework for data management and inter-service communication across the microservices architecture.

Changes

Files Change Summary
client-registry-jempi/config/config-api.json, client-registry-jempi/config/config.json New configuration files introduced, defining schemas for patient records and auxiliary interactions.
client-registry-jempi/docker-compose.api-cluster.yml, client-registry-jempi/docker-compose.api.yml, client-registry-jempi/docker-compose.combined-cluster.yml, client-registry-jempi/docker-compose.combined.yml Updates to Docker Compose configurations, adding services and environment variables for improved deployment and configurability.
client-registry-jempi/package-metadata.json Modifications to key-value pairs for environment configurations, adding new entries and changing formats.
client-registry-jempi/swarm.sh Added a new local variable for deployment parameters, enhancing the flexibility of service initialization.
client-registry-jempi/importer/openhim/openhimConfig.js Changed default password for OpenHIM API authentication, impacting security settings.
client-registry-jempi/docker-compose.dgraph-cluster.yml, client-registry-jempi/docker-compose.dgraph.yml, client-registry-jempi/docker-compose.dgraph-dev.yml Modifications to Dgraph service configurations, including removal of services and updates to existing ones.
client-registry-jempi/docker-compose.combined-dev.yml Removed Docker Compose configuration for development services, indicating a shift in deployment architecture.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant WebApp
    participant API
    participant DB
    User->>WebApp: Upload file
    WebApp->>API: Send file data
    API->>DB: Store data
    DB-->>API: Confirm storage
    API-->>WebApp: Acknowledge
    WebApp-->>User: Upload successful
Loading

🐇 Hop along, the changes are bright,
New configs in place, oh what a sight!
Files can grow, and services play,
With patient records safe and sound today.
So let’s dance through code, with joy we’ll sing,
For all the wonders these updates will bring! 🎉

Possibly related PRs


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.
    • @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 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
Contributor

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

Outside diff range, codebase verification and nitpick comments (3)
client-registry-jempi/docker-compose.combined-cluster.yml (1)

15-15: Remove trailing spaces.

There is a trailing space on this line. Consider removing it to adhere to best practices.

-  
Tools
yamllint

[error] 15-15: trailing spaces

(trailing-spaces)

client-registry-jempi/docker-compose.api.yml (1)

133-143: Missing Configuration Files in configs Section

The config.json and config-api.json files specified in the configs section are missing from the expected location. Please ensure these files are added to the ./config/ directory. Additionally, the name fields in the configs section are unique, which is correct.

  • Missing files: ./config/config.json, ./config/config-api.json
Analysis chain

Verify the configs section.

The configs section has been added to define configuration files. Ensure that:

  • The file paths are correct and the files exist.
  • The name fields are correctly formatted and unique.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the configs section in docker-compose.api.yml.

# Test: Check if config.json and config-api.json exist and names are unique. Expect: Both files should exist and names should be unique.
if [ ! -f "./config/config.json" ]; then
  echo "config.json file is missing."
fi

if [ ! -f "./config/config-api.json" ]; then
  echo "config-api.json file is missing."
fi

# Check for unique names
rg --type yaml -A 1 'configs:' client-registry-jempi/docker-compose.api.yml | grep 'name:' | sort | uniq -d

Length of output: 327

client-registry-jempi/swarm.sh (1)

40-40: Initialize api_cluster_compose_param with a default value.

The api_cluster_compose_param is initialized but not used unless CLUSTERED_MODE is true. Consider setting a default value or handling the case where it might be empty.

-  local api_cluster_compose_param=""
+  local api_cluster_compose_param="default-value"
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0882027 and 1e558ec.

Files selected for processing (11)
  • client-registry-jempi/config/config-api.json (1 hunks)
  • client-registry-jempi/config/config.json (1 hunks)
  • client-registry-jempi/docker-compose.api-cluster.yml (1 hunks)
  • client-registry-jempi/docker-compose.api.yml (5 hunks)
  • client-registry-jempi/docker-compose.combined-cluster.yml (1 hunks)
  • client-registry-jempi/docker-compose.combined.yml (6 hunks)
  • client-registry-jempi/package-metadata.json (3 hunks)
  • client-registry-jempi/swarm.sh (3 hunks)
  • config.yaml (1 hunks)
  • mpi-qa.env (1 hunks)
  • reverse-proxy-nginx/package-conf-secure/http-jempi-secure.conf (2 hunks)
Additional context used
yamllint
client-registry-jempi/docker-compose.combined-cluster.yml

[error] 15-15: trailing spaces

(trailing-spaces)

client-registry-jempi/docker-compose.combined.yml

[error] 84-84: trailing spaces

(trailing-spaces)

Additional comments not posted (26)
client-registry-jempi/docker-compose.api-cluster.yml (1)

1-8: Verify node label for deployment constraint.

The deployment constraint specifies node.labels.name==node-2. Ensure that this node label is correctly set up in your Docker Swarm environment.

client-registry-jempi/docker-compose.combined-cluster.yml (2)

16-20: Verify node label for jempi-async-receiver deployment constraint.

The deployment constraint specifies node.labels.name==node-2. Ensure that this node label is correctly set up in your Docker Swarm environment.


9-15: Verify node label for jempi-em-scala deployment constraint.

The deployment constraint specifies node.labels.name==node-1. Ensure that this node label is correctly set up in your Docker Swarm environment.

Tools
yamllint

[error] 15-15: trailing spaces

(trailing-spaces)

reverse-proxy-nginx/package-conf-secure/http-jempi-secure.conf (2)

56-56: Verify the necessity and security of increased upload limit.

The client_max_body_size 128M directive allows file uploads up to 128 megabytes. Ensure that this change aligns with your application's requirements and security policies.


21-21: Verify the necessity and security of increased upload limit.

The client_max_body_size 128M directive allows file uploads up to 128 megabytes. Ensure that this change aligns with your application's requirements and security policies.

config.yaml (1)

82-93: Verify the new mpi-qa profile configuration.

The new mpi-qa profile has been added with specific packages and an environment file. Ensure that:

  • The mpi-qa.env file exists and is correctly configured.
  • There are no conflicts with existing profiles.
  • The packages listed are intended for the mpi-qa profile.
Verification successful

The mpi-qa profile configuration is correct and conflict-free. The mpi-qa profile includes the intended packages and an environment file, with no conflicts detected among existing profiles. The mpi-qa.env file exists as expected.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence and configuration of mpi-qa.env and check for conflicts.

# Test: Check if mpi-qa.env exists. Expect: File should exist.
if [ ! -f "mpi-qa.env" ]; then
  echo "mpi-qa.env file is missing."
fi

# Test: List all profiles and check for conflicts. Expect: No conflicts.
rg --type yaml -A 5 'profiles:' config.yaml

Length of output: 205


Script:

#!/bin/bash
# Description: List all profiles in config.yaml and verify mpi-qa profile configuration.

# Test: List all profiles to check for conflicts and verify mpi-qa profile configuration.
rg --type yaml -A 10 'name:' config.yaml

Length of output: 1215

client-registry-jempi/docker-compose.api.yml (4)

58-62: Verify the configuration files for jempi-api-kc.

The jempi-api-kc service now includes configuration files. Ensure that:

  • The config.json and config-api.json files exist and are correctly configured.
  • The paths specified in the configs section are correct.

90-94: Verify new environment variables for jempi-api-kc.

The jempi-api-kc service has new environment variables. Ensure that:

  • All variables are defined in the environment or have default values.
  • The values are correctly referenced in the application.

28-32: Verify new environment variables for jempi-api.

The jempi-api service has new environment variables. Ensure that:

  • All variables are defined in the environment or have default values.
  • The values are correctly referenced in the application.
Verification successful

Environment variables for jempi-api are correctly managed. The new environment variables are referenced in the docker-compose.api.yml file and have default values specified in package-metadata.json. This ensures that the application can function correctly even if these variables are not explicitly defined in the environment.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that new environment variables for jempi-api are defined.

# Test: Check if variables are defined in the environment. Expect: All should be defined.
for var in SYSTEM_CONFIG_DIR API_CONFIG_REFERENCE_FILENAME API_CONFIG_MASTER_FILENAME API_FIELDS_CONFIG_FILENAME JEMPI_FILE_IMPORT_MAX_SIZE_BYTE; do
  if [ -z "${!var}" ]; then
    echo "Environment variable $var is not defined."
  fi
done

Length of output: 1497


Script:

#!/bin/bash
# Search for references to the environment variables in the codebase
for var in SYSTEM_CONFIG_DIR API_CONFIG_REFERENCE_FILENAME API_CONFIG_MASTER_FILENAME API_FIELDS_CONFIG_FILENAME JEMPI_FILE_IMPORT_MAX_SIZE_BYTE; do
  echo "Searching for $var in the codebase..."
  rg --fixed-strings "$var" --context 5
done

Length of output: 16420


6-10: Verify the configuration files for jempi-api.

The jempi-api service now includes configuration files. Ensure that:

  • The config.json and config-api.json files exist and are correctly configured.
  • The paths specified in the configs section are correct.
Verification successful

Configuration Files for jempi-api Found in Expected Location

The config.json and config-api.json files for the jempi-api service exist in the client-registry-jempi/config/ directory. Please manually verify their contents to ensure they are correctly configured for your application's needs.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence of config.json and config-api.json for jempi-api.

# Test: Check if config.json and config-api.json exist. Expect: Both files should exist.
if [ ! -f "./config/config.json" ]; then
  echo "config.json file is missing."
fi

if [ ! -f "./config/config-api.json" ]; then
  echo "config-api.json file is missing."
fi

Length of output: 221


Script:

#!/bin/bash
# Search for config.json and config-api.json files in the repository
fd --type f --name 'config.json' .
fd --type f --name 'config-api.json' .

# Search for references to these files in documentation or other files
rg 'config.json' --glob '*.md'
rg 'config-api.json' --glob '*.md'

Length of output: 641


Script:

#!/bin/bash
# Correct the search for config.json and config-api.json files in the repository
fd 'config.json' .
fd 'config-api.json' .

# Search for references to these files in documentation or other files
rg 'config.json' --glob '*.md'
rg 'config-api.json' --glob '*.md'

Length of output: 359

client-registry-jempi/package-metadata.json (3)

99-106: Verify new configuration entries.

New entries have been added for JEMPI_EM_SCALA and configuration filenames. Ensure that:

  • These entries are correctly referenced in the codebase.
  • The application uses these configurations as intended.
Verification successful

Configuration Entries Verified

The new configuration entries for JEMPI_EM_SCALA and configuration filenames are correctly referenced and utilized in the codebase. They are used in environment and Docker Compose files, ensuring they are part of the application's configuration management.

  • JEMPI_EM_SCALA_IMAGE_TAG is used in mpi-qa.env and docker-compose.combined.yml.
  • SYSTEM_CONFIG_DIR and API_CONFIG_REFERENCE_FILENAME are used in docker-compose.api.yml.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of new configuration entries in the codebase.

# Test: Search for the usage of new entries. Expect: Entries should be used in the codebase.
rg --type json 'JEMPI_EM_SCALA_IMAGE_TAG' client-registry-jempi
rg --type json 'SYSTEM_CONFIG_DIR' client-registry-jempi
rg --type json 'API_CONFIG_REFERENCE_FILENAME' client-registry-jempi

Length of output: 457


Script:

#!/bin/bash
# Description: Search for the usage of new configuration entries across the entire codebase.

# Test: Search for the usage of new entries in all files. Expect: Entries should be used in the codebase.
rg 'JEMPI_EM_SCALA_IMAGE_TAG'
rg 'SYSTEM_CONFIG_DIR'
rg 'API_CONFIG_REFERENCE_FILENAME'

Length of output: 917


72-72: Verify the renaming of JEMPI_POSTGRESQL_USER.

The key JEMPI_POSTGRESQL_USER has been renamed to JEMPI_POSTGRESQL_USERNAME. Ensure that:

  • All references to this key in the codebase are updated.
  • There are no broken references or errors due to this change.
Verification successful

Renaming of JEMPI_POSTGRESQL_USER to JEMPI_POSTGRESQL_USERNAME Verified Successfully

The key JEMPI_POSTGRESQL_USER has been successfully renamed to JEMPI_POSTGRESQL_USERNAME across the codebase. The new key is consistently used in relevant configuration files without any broken references or errors.

  • Files using JEMPI_POSTGRESQL_USERNAME:
    • mpi-qa.env
    • client-registry-jempi/package-metadata.json
    • client-registry-jempi/docker-compose.api.yml
    • client-registry-jempi/docker-compose.combined.yml
    • client-registry-jempi/importer/postgres/docker-compose.config.yml
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the references to JEMPI_POSTGRESQL_USERNAME in the codebase.

# Test: Search for the old and new keys in the codebase. Expect: Only new key should be used.
rg --type json 'JEMPI_POSTGRESQL_USER' client-registry-jempi
rg --type json 'JEMPI_POSTGRESQL_USERNAME' client-registry-jempi

Length of output: 297


Script:

#!/bin/bash
# Description: Verify the references to JEMPI_POSTGRESQL_USERNAME in the entire codebase.

# Search for the old key in the entire codebase to ensure it has been completely removed.
rg 'JEMPI_POSTGRESQL_USER'

# Search for the new key in the entire codebase to ensure it is being used correctly.
rg 'JEMPI_POSTGRESQL_USERNAME'

Length of output: 1561


55-55: Verify JEMPI_FILE_IMPORT_MAX_SIZE_BYTE format change.

The JEMPI_FILE_IMPORT_MAX_SIZE_BYTE value has been changed to a string format. Ensure that:

  • The application correctly parses and handles this new format.
  • There are no issues with size calculations.
client-registry-jempi/swarm.sh (2)

60-60: Set api_cluster_compose_param for clustered mode.

The line correctly assigns the api_cluster_compose_param when CLUSTERED_MODE is true, ensuring that the appropriate Docker Compose file is used for API deployment in clustered environments.


82-82: Add api_cluster_compose_param to docker::deploy_service.

The addition of api_cluster_compose_param to the docker::deploy_service call allows for more flexible deployments by specifying different configurations for clustered environments.

client-registry-jempi/config/config.json (1)

1-189: Ensure JSON schema validity and consistency.

The JSON configuration file is well-structured, defining fields and rules for data handling. Ensure that this schema is consistent with the application's requirements and that all necessary fields are included.

mpi-qa.env (1)

1-130: Verify environment variable values and consistency.

The environment configuration file is comprehensive, covering multiple system aspects. Ensure that all variable values are correct and consistent with the system's operational requirements.

client-registry-jempi/docker-compose.combined.yml (6)

6-8: LGTM! Configuration mapping is consistent.

The addition of the configs section for jempi-async-receiver is consistent with the other services.


29-31: LGTM! Configuration mapping is consistent.

The addition of the configs section for jempi-etl is consistent with the other services.


50-52: LGTM! Configuration mapping is consistent.

The addition of the configs section for jempi-controller is consistent with the other services.


85-103: LGTM! New service configuration is well-structured.

The introduction of the jempi-em-scala service with its configuration and deployment parameters is consistent with existing services.


107-109: LGTM! Configuration mapping is consistent.

The addition of the configs section for jempi-linker is consistent with the other services.


145-147: LGTM! Configuration mapping is consistent.

The addition of the configs section for jempi-bootstrapper is consistent with the other services.

client-registry-jempi/config/config-api.json (3)

4-15: LGTM! Field configuration is appropriate.

The aux_id field is correctly configured as a read-only identifier.


45-69: LGTM! Field configuration is appropriate.

The familyName field is correctly configured with appropriate validation rules.


97-121: LGTM! Field configuration is appropriate.

The dob field is correctly configured with appropriate validation rules.

Comment on lines +142 to +153
"fieldName": "phoneNumber",
"fieldType": "String",
"fieldLabel": "Phone No",
"groups": ["demographics", "filter", "linked_records", "record_details"],
"scope": [
"/record-details/:uid",
"/notifications/match-details",
"/record-details/:uid/relink",
"/search/custom",
"/browse-records"
],
"accessLevel": []
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding validation rules for phone numbers.

The phoneNumber field lacks validation rules. Consider adding a regex pattern to ensure correct formatting.

"validation": {
  "regex": "^[+]?[0-9]{1,15}$",
  "onErrorMessage": "Phone number must be a valid international format"
}

Comment on lines +156 to +175
"fieldName": "nationalId",
"fieldType": "String",
"fieldLabel": "National ID",
"groups": ["identifiers", "linked_records", "record_details"],
"scope": [
"/record-details/:uid",
"/notifications/match-details",
"/record-details/:uid/relink",
"/search/simple",
"/search/custom",
"/search-results/golden",
"/search-results/patient",
"/browse-records"
],
"accessLevel": [],
"validation": {
"required": true,
"regex": "",
"onErrorMessage": "The national Id cannot be empty"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider defining a regex pattern for national ID validation.

The nationalId field's validation rule has an empty regex pattern. Consider specifying a pattern for validation.

"regex": "^[A-Z0-9]{5,10}$",
"onErrorMessage": "The national ID must be alphanumeric and between 5 to 10 characters"

Comment on lines +72 to +94
"fieldName": "gender",
"fieldType": "String",
"fieldLabel": "Gender",
"groups": [
"demographics",
"filter",
"sub_heading",
"linked_records",
"record_details"
],
"scope": [
"/record-details/:uid",
"/notifications/match-details",
"/record-details/:uid/relink",
"/search/custom",
"/browse-records"
],
"validation": {
"required": true,
"regex": "^(male|female)$",
"onErrorMessage": "The Gender cannot be empty and should either be male, female or neutral"
},
"accessLevel": []
Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the regex pattern for gender validation.

The regex pattern should include "neutral" to match the error message.

-  "regex": "^(male|female)$"
+  "regex": "^(male|female|neutral)$"
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
"fieldName": "gender",
"fieldType": "String",
"fieldLabel": "Gender",
"groups": [
"demographics",
"filter",
"sub_heading",
"linked_records",
"record_details"
],
"scope": [
"/record-details/:uid",
"/notifications/match-details",
"/record-details/:uid/relink",
"/search/custom",
"/browse-records"
],
"validation": {
"required": true,
"regex": "^(male|female)$",
"onErrorMessage": "The Gender cannot be empty and should either be male, female or neutral"
},
"accessLevel": []
"fieldName": "gender",
"fieldType": "String",
"fieldLabel": "Gender",
"groups": [
"demographics",
"filter",
"sub_heading",
"linked_records",
"record_details"
],
"scope": [
"/record-details/:uid",
"/notifications/match-details",
"/record-details/:uid/relink",
"/search/custom",
"/browse-records"
],
"validation": {
"required": true,
"regex": "^(male|female|neutral)$",
"onErrorMessage": "The Gender cannot be empty and should either be male, female or neutral"
},
"accessLevel": []

Comment on lines +18 to +42
"fieldName": "givenName",
"fieldType": "String",
"fieldLabel": "First Name",
"groups": [
"name",
"demographics",
"filter",
"linked_records",
"record_details"
],
"scope": [
"/notifications/match-details",
"/record-details/:uid/relink",
"/search/simple",
"/search/custom",
"/search-results/golden",
"/search-results/patient",
"/record-details/:uid",
"/browse-records"
],
"validation": {
"required": true,
"onErrorMessage": "The family name cannot be empty"
},
"accessLevel": []
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct the validation error message.

The validation error message for givenName should refer to the "first name" instead of the "family name."

-  "onErrorMessage": "The family name cannot be empty"
+  "onErrorMessage": "The first name cannot be empty"
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
"fieldName": "givenName",
"fieldType": "String",
"fieldLabel": "First Name",
"groups": [
"name",
"demographics",
"filter",
"linked_records",
"record_details"
],
"scope": [
"/notifications/match-details",
"/record-details/:uid/relink",
"/search/simple",
"/search/custom",
"/search-results/golden",
"/search-results/patient",
"/record-details/:uid",
"/browse-records"
],
"validation": {
"required": true,
"onErrorMessage": "The family name cannot be empty"
},
"accessLevel": []
"fieldName": "givenName",
"fieldType": "String",
"fieldLabel": "First Name",
"groups": [
"name",
"demographics",
"filter",
"linked_records",
"record_details"
],
"scope": [
"/notifications/match-details",
"/record-details/:uid/relink",
"/search/simple",
"/search/custom",
"/search-results/golden",
"/search-results/patient",
"/record-details/:uid",
"/browse-records"
],
"validation": {
"required": true,
"onErrorMessage": "The first name cannot be empty"
},
"accessLevel": []

Comment on lines +124 to +139
"fieldName": "city",
"fieldType": "String",
"fieldLabel": "City",
"groups": ["demographics", "filter", "linked_records", "record_details"],
"scope": [
"/record-details/:uid",
"/notifications/match-details",
"/record-details/:uid/relink",
"/search/custom",
"/browse-records"
],
"accessLevel": [],
"validation": {
"required": true,
"onErrorMessage": "Date of birth cannot be empty"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct the validation error message.

The validation error message for city should refer to the "city" field instead of "Date of birth."

-  "onErrorMessage": "Date of birth cannot be empty"
+  "onErrorMessage": "City cannot be empty"
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
"fieldName": "city",
"fieldType": "String",
"fieldLabel": "City",
"groups": ["demographics", "filter", "linked_records", "record_details"],
"scope": [
"/record-details/:uid",
"/notifications/match-details",
"/record-details/:uid/relink",
"/search/custom",
"/browse-records"
],
"accessLevel": [],
"validation": {
"required": true,
"onErrorMessage": "Date of birth cannot be empty"
}
"fieldName": "city",
"fieldType": "String",
"fieldLabel": "City",
"groups": ["demographics", "filter", "linked_records", "record_details"],
"scope": [
"/record-details/:uid",
"/notifications/match-details",
"/record-details/:uid/relink",
"/search/custom",
"/browse-records"
],
"accessLevel": [],
"validation": {
"required": true,
"onErrorMessage": "City cannot be empty"
}

Copy link
Member

@rcrichton rcrichton left a comment

Choose a reason for hiding this comment

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

Looks good to me. Just a few comments.

client-registry-jempi/docker-compose.api-cluster.yml Outdated Show resolved Hide resolved
client-registry-jempi/docker-compose.combined-cluster.yml Outdated Show resolved Hide resolved
Copy link
Member

@rcrichton rcrichton left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

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

Outside diff range and nitpick comments (1)
client-registry-jempi/docker-compose.dgraph.yml (1)

18-18: Cache configuration looks good, but consider security and monitoring enhancements.

The addition of cache parameters can help optimize the performance of the Dgraph service. The specified cache size of 4096 MB and the percentage distribution across different cache types seem reasonable. However, consider the following suggestions:

  1. Monitor the cache usage and adjust the size if needed to ensure optimal performance.
  2. Restrict the security whitelist to specific IP ranges, if possible, to enhance security.
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1e558ec and 92c7601.

Files selected for processing (7)
  • client-registry-jempi/docker-compose.combined-dev.yml (0 hunks)
  • client-registry-jempi/docker-compose.dgraph-cluster.yml (1 hunks)
  • client-registry-jempi/docker-compose.dgraph-dev.yml (0 hunks)
  • client-registry-jempi/docker-compose.dgraph.yml (1 hunks)
  • client-registry-jempi/importer/openhim/openhimConfig.js (1 hunks)
  • client-registry-jempi/package-metadata.json (5 hunks)
  • client-registry-jempi/swarm.sh (1 hunks)
Files not reviewed due to no reviewable changes (2)
  • client-registry-jempi/docker-compose.combined-dev.yml
  • client-registry-jempi/docker-compose.dgraph-dev.yml
Files skipped from review due to trivial changes (1)
  • client-registry-jempi/swarm.sh
Additional context used
yamllint
client-registry-jempi/docker-compose.dgraph-cluster.yml

[error] 9-9: trailing spaces

(trailing-spaces)


[warning] 38-38: wrong indentation: expected 8 but found 10

(indentation)


[error] 60-60: trailing spaces

(trailing-spaces)

Additional comments not posted (14)
client-registry-jempi/docker-compose.dgraph-cluster.yml (2)

10-29: LGTM!

The jempi-alpha-02 service is well-configured for deploying a Dgraph alpha node in a clustered environment. The resource limits, memory reservations, restart policy, volume mapping, and network configuration all follow best practices and ensure that the service will operate effectively.


31-50: LGTM!

The jempi-alpha-03 service is well-configured for deploying a Dgraph alpha node in a clustered environment. The resource limits, memory reservations, restart policy, volume mapping, and network configuration all follow best practices and ensure that the service will operate effectively.

Tools
yamllint

[warning] 38-38: wrong indentation: expected 8 but found 10

(indentation)

client-registry-jempi/package-metadata.json (12)

16-16: LGTM!

The version upgrade of the JEMPI_ZERO_IMAGE from v22.0.0 to v23.1.1 is a significant update to the underlying technology stack. Ensure that the application is thoroughly tested with this new version to confirm compatibility and expected behavior.


43-43: LGTM!

The image tag update for JEMPI_ASYNC_RECEIVER from 1.0.1-beta to 1.1.0 indicates a shift to a newer version, likely incorporating bug fixes and new features. Ensure that the application is thoroughly tested with this new version to confirm compatibility and expected behavior.


44-44: LGTM!

The image tag update for JEMPI_CONTROLLER from 1.0.1-beta to 1.1.0 indicates a shift to a newer version, likely incorporating bug fixes and new features. Ensure that the application is thoroughly tested with this new version to confirm compatibility and expected behavior.


45-45: LGTM!

The image tag update for JEMPI_LINKER from 1.0.1-beta to 1.1.1 indicates a shift to a newer version, likely incorporating bug fixes and new features. Ensure that the application is thoroughly tested with this new version to confirm compatibility and expected behavior.


46-46: LGTM!

The image tag update for JEMPI_API from 1.0.1-beta to 1.1.1 indicates a shift to a newer version, likely incorporating bug fixes and new features. Ensure that the application is thoroughly tested with this new version to confirm compatibility and expected behavior.


47-47: LGTM!

The image tag update for JEMPI_API_KC from 1.0.1-beta to 1.1.1 indicates a shift to a newer version, likely incorporating bug fixes and new features. Ensure that the application is thoroughly tested with this new version to confirm compatibility and expected behavior.


48-48: LGTM!

The image tag update for JEMPI_ETL from 1.0.1-beta to 1.1.0 indicates a shift to a newer version, likely incorporating bug fixes and new features. Ensure that the application is thoroughly tested with this new version to confirm compatibility and expected behavior.


55-55: LGTM!

The change in the format for specifying the maximum file import size from 128000000 to 128m standardizes the configuration and improves readability.


72-72: Verify if the username change is consistently applied.

The modification of the PostgreSQL username from jempi to postgres could reflect a change in database access credentials. Please ensure that this change is consistently applied across all relevant configurations and doesn't cause any authentication issues.

Verification successful

PostgreSQL username change is consistently applied.

The modification of the PostgreSQL username to postgres for JEMPI is consistently applied within the client-registry-jempi/package-metadata.json file. There are no conflicting entries in other configuration files.

  • client-registry-jempi/package-metadata.json: Both JEMPI_POSTGRESQL_USERNAME and POSTGRESQL_USERNAME are set to postgres.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if the PostgreSQL username change is consistently applied across all relevant configurations.

# Test: Search for the PostgreSQL username in all configuration files.
rg --type-add 'config:*.{yaml,yml,json,properties}' -tc config $'POSTGRESQL_USERNAME|JEMPI_POSTGRESQL_USERNAME'

Length of output: 198


Script:

#!/bin/bash
# Description: Verify if the PostgreSQL username change is consistently applied across all relevant configurations.

# Test: Search for the PostgreSQL username in all JSON configuration files.
rg --type json 'POSTGRESQL_USERNAME|JEMPI_POSTGRESQL_USERNAME'

Length of output: 777


23-23: Verify if the memory increase is sufficient.

The memory limit increase for JEMPI_ALPHA_01_MEMORY_LIMIT from 3G to 6G suggests a need for enhanced resource allocation. Please ensure that this increase is sufficient for the component's requirements and doesn't cause resource contention with other components.


51-51: Verify if the increased instances are properly load balanced.

The increase in the number of instances for JEMPI_LINKER from 1 to 3 may enhance the application's scalability and performance. Please ensure that these instances are properly load balanced and don't cause resource contention with other components.


85-86: Verify the architectural change and the usage of new environment variables.

The simplification of the DGRAPH_HOSTS configuration to a single host, jempi-alpha-01, and the reduction of ports to 9080 indicate a potential architectural change in how the application interacts with Dgraph. Please ensure that this change is thoroughly tested to confirm the expected behavior and performance.

Additionally, the introduction of several new environment variables related to Scala and system configuration, such as JEMPI_EM_SCALA_IMAGE_TAG, JEMPI_EM_SCALA_INSTANCES, and various configuration filenames, suggests an expansion of the application's capabilities and configuration management. Please verify that these new environment variables are properly used, documented, and have appropriate default values.

Also applies to: 98-106

@@ -7,7 +7,7 @@ const path = require("path");
const OPENHIM_CORE_SERVICE_NAME = 'openhim-core'
const OPENHIM_MEDIATOR_API_PORT = 8080
const OPENHIM_API_PASSWORD =
process.env.OPENHIM_API_PASSWORD || 'openhim-password'
process.env.OPENHIM_API_PASSWORD || 'instant101'
Copy link
Contributor

Choose a reason for hiding this comment

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

Use a stronger default password and ensure the environment variable is set.

The change in the default value of OPENHIM_API_PASSWORD from 'openhim-password' to 'instant101' raises security concerns. The new default password appears to be weak and easily guessable, which could introduce vulnerabilities if the environment variable is not consistently set to override it.

Please consider the following recommendations:

  1. Replace 'instant101' with a stronger default password that adheres to security best practices. The password should:
    • Have a minimum length (e.g., 12 characters)
    • Include a mix of uppercase letters, lowercase letters, numbers, and special characters
    • Avoid common words, phrases, or patterns
  2. Verify that the OPENHIM_API_PASSWORD environment variable is properly set in all relevant environments (development, staging, production) to override the default value with a strong, unique password. Do not rely solely on the default value.

@@ -6,21 +6,60 @@ services:
placement:
constraints:
- node.labels.name == node-1

Copy link
Contributor

Choose a reason for hiding this comment

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

Fix the trailing spaces issues.

The yamllint static analysis tool has identified trailing spaces at lines 9 and 60. Please remove the trailing spaces to improve the code quality and readability.

Apply this diff to fix the trailing spaces issues:

-  
+
-  jempi-alpha-03-data: 
+  jempi-alpha-03-data:

Also applies to: 60-60

Tools
yamllint

[error] 9-9: trailing spaces

(trailing-spaces)

@rcrichton rcrichton merged commit e3c8f06 into main Sep 12, 2024
2 checks passed
@rcrichton rcrichton deleted the CU-86bzf9c4p_Update-Platform-JeMPI-images branch September 12, 2024 08:23
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