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

add network tag for subql .env #376

Merged
merged 1 commit into from
Nov 6, 2024
Merged

add network tag for subql .env #376

merged 1 commit into from
Nov 6, 2024

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

    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.

    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.

    2 participants