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

Hetzner module #303

Merged
merged 6 commits into from
Jun 11, 2024
Merged

Hetzner module #303

merged 6 commits into from
Jun 11, 2024

Conversation

DaMandal0rian
Copy link
Contributor

@DaMandal0rian DaMandal0rian commented Apr 9, 2024

This PR improves on #263 and expands by making a general resources module to launch a network from main branch. It also makes the testing framework and main module reuse the templates/hetzner root module.

Note for easier reviewing, the commit f0e7f29 doesn't need to be checked since it restores the scripts deleted in #263 to be used by the testing-framework for devnets.

closes #255

@github-actions github-actions bot added the enhancement New feature or request label Apr 9, 2024
Copy link

github-actions bot commented Apr 9, 2024

PR Description updated to latest commit (1266f66)

@autonomys autonomys deleted a comment from github-actions bot Apr 9, 2024
@autonomys autonomys deleted a comment from github-actions bot Apr 9, 2024
@DaMandal0rian
Copy link
Contributor Author

/review

Copy link

github-actions bot commented Apr 9, 2024

PR Review

⏱️ Estimated effort to review [1-5]

4, due to the extensive changes across multiple Terraform and shell script files, which require a detailed review of syntax, logic, and adherence to best practices.

🧪 Relevant tests

No

🔍 Possible issues

Possible Bug: The use of var.branch_name != "main" in Terraform's null_resource remote-exec provisioner blocks may not work as expected because Terraform does not support conditional logic directly within the provisioner blocks. This could lead to issues when trying to execute conditional logic based on the branch name.

Security Concern: Hardcoding sensitive information like organization = "subspace-sre" in backend.tf and potentially sensitive default values in variables.tf could expose sensitive information if the Terraform state or files are not properly secured.

🔒 Security concerns

Sensitive information exposure: The hardcoded organization name in backend.tf and default values for sensitive variables in variables.tf could lead to unintentional exposure of sensitive information if not properly managed.

Code feedback:
relevant fileresources/hetzner/backend.tf
suggestion      

Consider using a variable for organization to avoid hardcoding sensitive or specific information in your Terraform configuration. This approach enhances flexibility and security. [important]

relevant lineorganization = "subspace-sre"

relevant fileresources/hetzner/variables.tf
suggestion      

For the tf_token variable, ensure that you are securely managing this sensitive variable, possibly using a secrets manager or environment variables, rather than relying on default values or less secure methods. [important]

relevant linevariable "tf_token" {

relevant filetemplates/terraform/hetzner/bootstrap_node_provisioner.tf
suggestion      

Refactor the repeated logic for cloning and checking out a branch into a reusable module or script to reduce duplication and potential errors across different provisioner blocks. [medium]

relevant lineresource "null_resource" "clone_branch" {

relevant filetemplates/terraform/hetzner/bootstrap_node_evm_provisioner.tf
suggestion      

Ensure consistent use of variable names and avoid hardcoding values within the script. For example, use variables for repository URLs and any other configurable parameters. [medium]

relevant line"git clone https://github.com/subspace/subspace.git",


✨ Review tool usage guide:

Overview:
The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.

The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.

  • When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:
/review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
[pr_reviewer]
some_config1=...
some_config2=...

See the review usage page for a comprehensive guide on using this tool.

@DaMandal0rian
Copy link
Contributor Author

@vedhavyas would like to get a review on this please

@DaMandal0rian
Copy link
Contributor Author

@vedhavyas this PR is getting stale and i need to do updates.

@DaMandal0rian DaMandal0rian merged commit 6bdc29a into main Jun 11, 2024
1 check passed
@DaMandal0rian DaMandal0rian deleted the hetzner-module branch June 11, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make hetzner terraform manifests for gemini and devnet
2 participants