Skip to content

Conversation

@DaMandal0rian
Copy link
Contributor

@DaMandal0rian DaMandal0rian commented Nov 6, 2024

PR Type

enhancement


Description

  • Added a new configuration to set the NETWORK_NAME in the .env file for both nova and standard subql provisioners.
  • Ensures that the NETWORK_NAME is either updated or appended if it does not exist in the .env file.

Changes walkthrough 📝

Relevant files
Enhancement
bootstrap_nova_subql_provisioner.tf
Add NETWORK_NAME configuration to nova subql provisioner 

templates/terraform/subql/base/bootstrap_nova_subql_provisioner.tf

  • Added a command to set NETWORK_NAME in the .env file.
  • Ensures the NETWORK_NAME is updated or appended in the .env file.
  • +2/-0     
    bootstrap_subql_provisioner.tf
    Add NETWORK_NAME configuration to subql provisioner           

    templates/terraform/subql/base/bootstrap_subql_provisioner.tf

  • Added a command to set NETWORK_NAME in the .env file.
  • Ensures the NETWORK_NAME is updated or appended in the .env file.
  • +2/-0     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    @github-actions
    Copy link

    github-actions bot commented Nov 6, 2024

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Variable Consistency
    The variable blue-subql-node-config.network-name is used for both nova-blue and nova-green configurations, which might be an error if different network names are expected for blue and green configurations.

    Variable Consistency
    The variable blue-subql-node-config.network-name is used for both blue and green configurations, which might be an error if different network names are expected for blue and green configurations.

    @github-actions
    Copy link

    github-actions bot commented Nov 6, 2024

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible bug
    Correct the variable used for the network name in the green node configuration to avoid potential configuration errors

    Ensure that the variable var.blue-subql-node-config.network-name is correctly used
    for both blue and green node configurations. It seems to be a copy-paste error, and
    you might need to use var.nova-green-subql-node-config.network-name for the green
    nodes.

    templates/terraform/subql/base/bootstrap_nova_subql_provisioner.tf [240]

    -"grep -q '^NETWORK_NAME=' /home/${var.ssh_user}/astral/.env && sed -i 's/^NETWORK_NAME=.*/NETWORK_NAME=${var.blue-subql-node-config.network-name}/' /home/${var.ssh_user}/astral/.env || echo NETWORK_NAME=${var.blue-subql-node-config.network-name} >> /home/${var.ssh_user}/astral/.env",
    +"grep -q '^NETWORK_NAME=' /home/${var.ssh_user}/astral/.env && sed -i 's/^NETWORK_NAME=.*/NETWORK_NAME=${var.nova-green-subql-node-config.network-name}/' /home/${var.ssh_user}/astral/.env || echo NETWORK_NAME=${var.nova-green-subql-node-config.network-name} >> /home/${var.ssh_user}/astral/.env",
    Suggestion importance[1-10]: 10

    Why: The suggestion correctly identifies a critical configuration error where the variable for the green node's network name was mistakenly set to the blue node's configuration. Fixing this prevents potential operational issues in the environment setup.

    10
    Adjust the variable for the network name in the green node configuration to match its specific settings

    Verify and correct the variable var.blue-subql-node-config.network-name used in the
    green node configuration to ensure it reflects the correct network settings.

    templates/terraform/subql/base/bootstrap_subql_provisioner.tf [240]

    -"grep -q '^NETWORK_NAME=' /home/${var.ssh_user}/astral/.env && sed -i 's/^NETWORK_NAME=.*/NETWORK_NAME=${var.blue-subql-node-config.network-name}/' /home/${var.ssh_user}/astral/.env || echo NETWORK_NAME=${var.blue-subql-node-config.network-name} >> /home/${var.ssh_user}/astral/.env",
    +"grep -q '^NETWORK_NAME=' /home/${var.ssh_user}/astral/.env && sed -i 's/^NETWORK_NAME=.*/NETWORK_NAME=${var.green-subql-node-config.network-name}/' /home/${var.ssh_user}/astral/.env || echo NETWORK_NAME=${var.green-subql-node-config.network-name} >> /home/${var.ssh_user}/astral/.env",
    Suggestion importance[1-10]: 10

    Why: This suggestion is essential as it addresses a similar critical configuration error in another file, ensuring that the green node's network name is correctly set, which is crucial for the correct operation of the infrastructure.

    10

    @DaMandal0rian DaMandal0rian merged commit 4d319e3 into main Nov 6, 2024
    2 checks passed
    @DaMandal0rian DaMandal0rian deleted the subql-network-tag branch November 6, 2024 16:41
    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.

    3 participants