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

IG Importer doesn't load #312

Merged
merged 6 commits into from
Jul 4, 2024
Merged

Conversation

drizzentic
Copy link
Collaborator

@drizzentic drizzentic commented Jun 21, 2024

Bug fixes

Summary by CodeRabbit

  • New Features

    • Updated configuration files to include new Kafka topics, OpenHIM settings, and service URLs.
    • Added new environment variables for OpenHIM API host and port.
  • Improvements

    • Enhanced URL handling for the FHIR IG microfrontend app by switching from local to cloud-based URLs.
    • Improved CORS handling for OPTIONS requests in Nginx reverse proxy configuration.
  • Configuration Changes

    • Adjusted .env files to include various service endpoints and ports.
    • Updated CLUSTERED_MODE setting in .env.remote for optimized system integration and access control.

@rcrichton
Copy link
Member

Task linked: CU-86byxfvwm IG Importer doesn't load

Copy link
Contributor

coderabbitai bot commented Jun 21, 2024

Walkthrough

The changes involve updates to various configuration files for improved system integration, particularly focusing on adding new environment variables for Kafka, OpenHIM, Nginx, and other services. Notable updates include enhancements to handling CORS requests in Nginx, changing the FHIR IG Importer URL to a cloud-based endpoint, and configuring settings in docker-compose and package-metadata files for better service management.

Changes

Files Summary of Changes
.env.local, .env.remote Added and updated environment variables for Kafka, OpenHIM, Nginx reverse proxy settings, service URLs, and other integrations.
...ig-importer/volume/... Updated URL from a local address to a cloud-based URL for the FHIR IG microfrontend app.
...ig-importer/package-metadata.json, ...openhim/package-metadata.json Updated version references to "latest" for FHIR IG Importer and added OpenHIM API configuration properties.
...openhim/docker-compose.yml Added environment variables OPENHIM_API_HOST and OPENHIM_API_PORT to the services configuration.
...reverse-proxy-nginx/package-conf-secure/http-openhim-secure.conf Enhanced handling of CORS requests by adding specific Access-Control headers and a 204 status code for OPTIONS requests.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Nginx
    participant OpenHIM
    participant Microservice

    User->>Nginx: Send Request
    alt OPTIONS Request
        Nginx->>Nginx: Handle CORS
        Nginx-->>User: Respond with 204
    else Other Requests
        Nginx->>OpenHIM: Proxy to OpenHIM
        OpenHIM->>Microservice: Forward request
        Microservice->>OpenHIM: Response
        OpenHIM->>Nginx: Proxy response
        Nginx->>User: Send Response
    end
Loading

🐰 Amid the code, the changes weave,
Integrations strong, a web they cleave.
From local hosts to clouds they soar,
Configs enhanced, systems core.
Nginx guards, the requests precise,
And Kafka topics added thrice.
Rejoice we shall in this new light,
For services now, a seamless flight. 🌟

Tip

AI model upgrade

gpt-4o model for reviews and chat is now live

OpenAI claims that this model is better at understanding and generating code than the previous models. Please join our Discord Community to provide any feedback or to report any issues.


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 as 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.

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/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.

@drizzentic drizzentic marked this pull request as ready for review July 2, 2024 11:23
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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6916389 and 8f9a21d.

Files selected for processing (6)
  • .env.local (1 hunks)
  • fhir-ig-importer/importer/volume/ig-importer-app.json (1 hunks)
  • fhir-ig-importer/package-metadata.json (1 hunks)
  • interoperability-layer-openhim/docker-compose.yml (1 hunks)
  • interoperability-layer-openhim/package-metadata.json (1 hunks)
  • reverse-proxy-nginx/package-conf-secure/http-openhim-secure.conf (1 hunks)
Files skipped from review due to trivial changes (2)
  • fhir-ig-importer/importer/volume/ig-importer-app.json
  • fhir-ig-importer/package-metadata.json
Additional context used
Gitleaks
interoperability-layer-openhim/package-metadata.json

43-43: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

Additional comments not posted (7)
.env.local (4)

29-30: Verify OpenHIM configuration.

The new variables OPENHIM_CORE_MEDIATOR_HOSTNAME and OPENHIM_MEDIATOR_API_PORT are added. Ensure these values are correct and accessible.

Verification successful

OpenHIM configuration verified.

The hostname openhimcomms.platform.jembi.cloud and port 443 are accessible, as indicated by the HTTP/1.1 401 Unauthorized response, which confirms that the server is reachable.

  • .env.local lines 29-30
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify OpenHIM configuration.

# Test: Check if OpenHIM core mediator hostname and API port are accessible.
curl -I https://openhimcomms.platform.jembi.cloud:443

Length of output: 790



Script:

#!/bin/bash
# Description: Verify OpenHIM configuration without SSL verification.

# Test: Check if OpenHIM core mediator hostname and API port are accessible without SSL verification.
curl -Ik https://openhimcomms.platform.jembi.cloud:443

Length of output: 570


27-27: Ensure Kafka topics are correctly configured.

The new Kafka topics include 2xx-async, patient, and observation. Verify that these topics are correctly set up in the Kafka broker.

Verification successful

Kafka topics are correctly configured.

The .env files confirm the presence of the Kafka topics 2xx-async, patient, and observation along with other topics.

  • cdr.env
  • cdr-dw.env
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify Kafka topics configuration in the Kafka broker.

# Test: List Kafka topics. Expect: Topics include 2xx-async, patient, observation.
kafka-topics.sh --list --bootstrap-server localhost:9092

Length of output: 141



Script:

#!/bin/bash
# Searching for Kafka topics configuration in the codebase.
rg --fixed-strings '2xx-async' --files-with-matches
rg --fixed-strings 'patient' --files-with-matches
rg --fixed-strings 'observation' --files-with-matches

Length of output: 2149



Script:

#!/bin/bash
# Display the contents of the relevant .env files to verify Kafka topics configuration.
cat cdr.env
cat cdr-dw.env

Length of output: 1271


47-51: Verify service URLs configuration.

The new service URLs include REACT_APP_JEMPI_BASE_API_HOST, REACT_APP_JEMPI_BASE_API_PORT, OPENHIM_CONSOLE_BASE_URL, OPENHIM_API_HOST, and OPENHIM_API_PORT. Ensure these URLs and ports are correct and accessible.


33-35: Verify Nginx reverse proxy settings.

The new variables REVERSE_PROXY_INSTANCES, DOMAIN_NAME, and SUBDOMAINS are added. Ensure these values are correctly set for the Nginx reverse proxy.

Verification successful

Nginx reverse proxy settings are correctly configured.

The domains and subdomains are correctly listed in the .env.local file, and the file is referenced in various setup scripts, ensuring the Nginx reverse proxy settings are applied as intended.

  • .env.local contains the required domain and subdomain configurations.
  • The .env.local file is referenced in multiple setup scripts, confirming its usage in the configuration process.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify Nginx reverse proxy settings.

# Test: Check if the domain and subdomains are correctly configured in Nginx.
nginx -T | grep -E 'platform.jembi.cloud|openhimcomms.platform.jembi.cloud'

Length of output: 150



Script:

#!/bin/bash
# Description: Verify Nginx reverse proxy settings in configuration files.

# Test: Search for domain and subdomains in Nginx configuration files.
fd -e conf -e nginx | xargs grep -E 'platform.jembi.cloud|openhimcomms.platform.jembi.cloud'

Length of output: 94



Script:

#!/bin/bash
# Description: Verify Nginx reverse proxy settings and .env.local references.

# Test 1: Search for domain and subdomains in all files.
grep -rE 'platform.jembi.cloud|openhimcomms.platform.jembi.cloud' .

# Test 2: Search for references to .env.local in the codebase.
grep -r '.env.local' .

Length of output: 7795

interoperability-layer-openhim/package-metadata.json (2)

46-46: Verify OPENHIM_CONSOLE_BASE_URL configuration.

The new variable OPENHIM_CONSOLE_BASE_URL is added. Ensure this value is correct and accessible.


47-48: Verify OpenHIM API host and port configuration.

The new variables OPENHIM_API_HOST and OPENHIM_API_PORT are added. Ensure these values are correct and accessible.

reverse-proxy-nginx/package-conf-secure/http-openhim-secure.conf (1)

62-71: Review new OPTIONS block for CORS handling.

The new block handles OPTIONS requests by adding CORS headers and returning a 204 status code. Ensure this block is correctly implemented.

.env.local Outdated Show resolved Hide resolved
@drizzentic drizzentic marked this pull request as draft July 3, 2024 09:29
@drizzentic drizzentic marked this pull request as ready for review July 3, 2024 09:29
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8f9a21d and b5cfba8.

Files selected for processing (1)
  • .env.remote (1 hunks)
Additional comments not posted (7)
.env.remote (7)

3-3: Verify the clustered mode change.

The CLUSTERED_MODE is set to false. Ensure that this change is intentional and aligns with the deployment strategy.


7-9: Verify the logging configuration.

The DEBUG is set to 0, BASHLOG_FILE is set to 0, and BASHLOG_FILE_PATH is set to platform.log. Ensure that these settings meet the operational requirements.


13-14: Verify the Logstash configuration.

The LOGSTASH_DEV_MOUNT is set to false, and LOGSTASH_PACKAGE_PATH is empty. Ensure that Logstash is configured correctly.


19-20: Verify the JS Report configuration.

The JS_REPORT_DEV_MOUNT is set to false, and JS_REPORT_PACKAGE_PATH is empty. Ensure that JS Report is configured correctly.


27-27: Verify the Kafka topics configuration.

The KAFKA_TOPICS is set to 2xx,2xx-async,reprocess,3xx,metrics:3:3,patient,observation. Ensure that these topics are correctly configured with the necessary partitions and replication factors.


33-35: Verify the reverse proxy configuration.

The REVERSE_PROXY_INSTANCES is set to 1, DOMAIN_NAME is set to <domain>, and SUBDOMAINS is set to a list of subdomains. Ensure that these settings are correct.


40-51: Verify the URLs for IAM and related services.

The URLs for Keycloak, Grafana, Jempi, Superset, and OpenHIM are set. Ensure that these URLs are correct and accessible.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8f9a21d and b5cfba8.

Files selected for processing (1)
  • .env.remote (1 hunks)
Additional comments not posted (7)
.env.remote (7)

3-3: Verify the impact of setting CLUSTERED_MODE to false.

Ensure this change aligns with the intended deployment strategy and does not affect the application's performance or availability.


7-9: Verify the logging configurations.

Ensure the DEBUG, BASHLOG_FILE, and BASHLOG_FILE_PATH variables are set correctly for the intended environment.


13-14: Verify the Logstash configurations.

Ensure the LOGSTASH_DEV_MOUNT and LOGSTASH_PACKAGE_PATH variables are set correctly and the paths are valid.


19-20: Verify the JS Report configurations.

Ensure the JS_REPORT_DEV_MOUNT and JS_REPORT_PACKAGE_PATH variables are set correctly and the paths are valid.


27-27: Verify the Kafka topics configuration.

Ensure the KAFKA_TOPICS variable is correctly configured and matches the application's requirements.


33-35: Verify the Nginx reverse proxy configurations.

Ensure the REVERSE_PROXY_INSTANCES, DOMAIN_NAME, and SUBDOMAINS variables are set correctly and the domain names are valid.


40-51: Verify the Keycloak and related services configurations.

Ensure the Keycloak and related services variables (KC_FRONTEND_URL, KC_GRAFANA_ROOT_URL, KC_JEMPI_ROOT_URL, KC_SUPERSET_ROOT_URL, KC_OPENHIM_ROOT_URL, GF_SERVER_DOMAIN, REACT_APP_JEMPI_BASE_API_HOST, REACT_APP_JEMPI_BASE_API_PORT, OPENHIM_CONSOLE_BASE_URL, OPENHIM_API_HOST, OPENHIM_API_PORT) are set correctly and the URLs are valid.

@drizzentic drizzentic force-pushed the CU-86byxfvwm_IG-Importer-doesnt-load branch from b5cfba8 to 94c734b Compare July 3, 2024 13:56
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b5cfba8 and 94c734b.

Files selected for processing (1)
  • fhir-ig-importer/importer/volume/ig-importer-app.json (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • fhir-ig-importer/importer/volume/ig-importer-app.json

@drizzentic drizzentic requested a review from BMartinos July 3, 2024 13:59
@drizzentic drizzentic merged commit e3267d6 into main Jul 4, 2024
1 check passed
@drizzentic drizzentic deleted the CU-86byxfvwm_IG-Importer-doesnt-load branch July 4, 2024 06:11
This pull request was closed.
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.

4 participants