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

fixes to hasura service on monolith squid #337

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

DaMandal0rian
Copy link
Contributor

@DaMandal0rian DaMandal0rian commented Sep 16, 2024

PR Type

bug_fix


Description

  • Fixed the dependency in the Hasura service configuration from postgres to db in both create_nova_squid_node_compose_file.sh and create_squid_node_compose_file.sh.
  • Updated the HASURA_GRAPHQL_METADATA_DATABASE_URL to dynamically use the POSTGRES_DB environment variable instead of hardcoding the database name.

Changes walkthrough 📝

Relevant files
Bug fix
create_nova_squid_node_compose_file.sh
Fix Hasura service configuration in nova squid node script

templates/terraform/explorer/base/scripts/create_nova_squid_node_compose_file.sh

  • Changed dependency from postgres to db.
  • Updated HASURA_GRAPHQL_METADATA_DATABASE_URL to use POSTGRES_DB
    environment variable.
  • +2/-2     
    create_squid_node_compose_file.sh
    Fix Hasura service configuration in squid node script       

    templates/terraform/explorer/base/scripts/create_squid_node_compose_file.sh

  • Changed dependency from postgres to db.
  • Updated HASURA_GRAPHQL_METADATA_DATABASE_URL to use POSTGRES_DB
    environment variable.
  • +2/-2     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No key issues to review

    Copy link

    github-actions bot commented Sep 16, 2024

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Enhancement
    Ensure database name consistency by using environment variables

    Replace the hardcoded database name in the HASURA_GRAPHQL_METADATA_DATABASE_URL with
    the environment variable ${POSTGRES_DB} to ensure consistency and flexibility in
    database naming across different environments.

    templates/terraform/explorer/base/scripts/create_nova_squid_node_compose_file.sh [93]

    +HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://\${POSTGRES_USER}:\${POSTGRES_PASSWORD}@db:5432/\${POSTGRES_DB}
     
    -
    Suggestion importance[1-10]: 9

    Why: The suggestion correctly identifies the improvement made in the PR to use an environment variable for the database name, enhancing flexibility and consistency across environments.

    9
    Security
    Improve security and performance by disabling development mode in production

    Consider setting HASURA_GRAPHQL_DEV_MODE to "false" in production environments to
    enhance security and performance.

    templates/terraform/explorer/base/scripts/create_nova_squid_node_compose_file.sh [97]

    -HASURA_GRAPHQL_DEV_MODE: "true"
    +HASURA_GRAPHQL_DEV_MODE: "false"
     
    Suggestion importance[1-10]: 7

    Why: This suggestion is valid as it highlights a best practice for production environments, though it is not directly related to the changes made in the PR.

    7
    Enhance security by handling environment variables more securely

    Replace the direct usage of environment variables in the
    HASURA_GRAPHQL_METADATA_DATABASE_URL with a more secure handling mechanism if
    possible, to avoid potential security risks.

    templates/terraform/explorer/base/scripts/create_nova_squid_node_compose_file.sh [93]

    -HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://\${POSTGRES_USER}:\${POSTGRES_PASSWORD}@db:5432/\${POSTGRES_DB}
    +HASURA_GRAPHQL_METADATA_DATABASE_URL: postgres://\${DB_USER}:\${DB_PASSWORD}@db:5432/\${DB_NAME}
     
    Suggestion importance[1-10]: 5

    Why: While the suggestion to handle environment variables more securely is valid, it does not provide a concrete alternative method, making it less actionable. Additionally, it is not directly related to the changes made in the PR.

    5
    Possible issue
    Verify the dependency service is correctly configured

    Ensure that the db service is correctly configured and running, as the
    graphql-engine service now depends on it instead of the postgres service.

    templates/terraform/explorer/base/scripts/create_nova_squid_node_compose_file.sh [89]

    -- "db"
    +- "db"  # Ensure this service is correctly set up and running
     
    Suggestion importance[1-10]: 6

    Why: The suggestion is reasonable as it emphasizes the need to ensure the 'db' service is properly configured, which is important due to the change in dependency from 'postgres' to 'db'.

    6

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant