Skip to content

dev#60

Open
goldbergnik1993-cloud wants to merge 4 commits into
mate-academy:mainfrom
goldbergnik1993-cloud:dev
Open

dev#60
goldbergnik1993-cloud wants to merge 4 commits into
mate-academy:mainfrom
goldbergnik1993-cloud:dev

Conversation

@goldbergnik1993-cloud

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, the pull request review was unsuccessful for the following reasons:

Warning

There are no files to review. Please make sure that you have added files to the pull request. Some files and directories may be ignored from the review or failed to load.
[CODE: NFR]

Additional info:
Ignored files list:

  • backend.tf
  • main.tf
  • modules/compute/main.tf
  • modules/compute/outputs.tf
  • modules/compute/variables.tf
  • modules/network/main.tf
  • modules/network/outputs.tf
  • modules/network/variables.tf
  • modules/storage/main.tf
  • modules/storage/outputs.tf
  • modules/storage/variables.tf
  • outputs.tf
  • terraform.tfvars
  • variables.tf

If the issue is within your control, please address it.
The next review attempt will automatically launch in about 1 hour.
If you believe this is an error or need assistance, please contact the support team.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Changes are needed because the submission is critically incomplete: the modules/network/main.tf, modules/compute/main.tf, and modules/storage/main.tf files — which contain the actual Azure resource definitions — are missing. Without these, no virtual network, VM, NIC, public IP, NSG, storage account, or task-artifacts container will be created, directly violating core task requirements. Additionally, the backend storage account name in backend.tf is set to mystsddttorage123 instead of the required yourstorageaccount, and terraform.tfvars is absent — both prevent correct Terraform execution. The file() call in modules/compute/main.tf (if it existed) would also fail due to incorrect path resolution for install-app.sh, and the public IP in modules/network/main.tf must use allocation_method = "Dynamic" with sku = "Basic", not Static. Please add all missing main.tf implementations, fix the storage account name, provide terraform.tfvars, and correct the script path and IP configuration.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread modules/compute/main.tf Outdated

settings = <<SETTINGS
{
"commandToExecute": "bash -c 'echo \"${base64encode(file("install-app.sh"))}\" | base64 --decode > install-app.sh && bash install-app.sh'"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file() function resolves paths relative to the current module's directory, which is modules/compute/. If install-app.sh is in the root directory of your project, this will fail. To correctly reference the script from the root, you should use path.root, like so: file("${path.root}/install-app.sh").

Comment thread modules/network/main.tf Outdated
name = var.pip_name
location = var.location
resource_group_name = var.rg_name
allocation_method = "Static"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The task description requires the public IP address to use a dynamic allocation method, but it's currently set to Static. To use a Dynamic allocation, the sku of the public IP address must be set to Basic, not Standard.

variable "rg_name" {}
variable "location" {}
variable "subnet_id" {}
variable "public_ip_id" {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The backend storage_account_name is set to 'mystsddttorage123' but the task requirement specifies 'yourstorageaccount'. Either update to match or confirm this is intentional.

Comment on lines +1 to +7
variable "rg_name" {}
variable "location" {}
variable "subnet_id" {}
variable "public_ip_id" {}
variable "vm_name" {}
variable "vm_size" {}
variable "ssh_key_public" {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compute module variables.tf is missing a dns_label variable which might be needed for VM extension or other configuration. Verify if this is required based on the compute module's main.tf implementation.

Comment on lines +1 to +2
output "subnet_id" { value = azurerm_subnet.subnet.id }
output "public_ip_id" { value = azurerm_public_ip.pip.id }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: modules/storage/main.tf is missing. This should create: storage account and container 'task-artifacts'.

Comment thread variables.tf
Comment on lines +1 to +12
variable "location" {}
variable "resource_group_name" {}
variable "virtual_network_name" {}
variable "vnet_address_prefix" {}
variable "subnet_name" {}
variable "subnet_address_prefix" {}
variable "network_security_group_name" {}
variable "public_ip_address_name" {}
variable "vm_name" {}
variable "vm_size" {}
variable "ssh_key_public" {}
variable "dns_label" {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All required variables are defined in variables.tf (location, resource_group_name, virtual_network_name, vnet_address_prefix, subnet_name, subnet_address_prefix, network_security_group_name, public_ip_address_name, vm_name, vm_size, ssh_key_public, dns_label). However, default values should be added to match the task requirements: location='uksouth', resource_group_name='mate-azure-task-12', virtual_network_name='vnet', vnet_address_prefix='10.0.0.0/16', subnet_name='default', subnet_address_prefix='10.0.0.0/24', network_security_group_name='defaultnsg', public_ip_address_name='linuxboxpip', vm_name='matebox', vm_size='Standard_B1s', dns_label='matetask'.

Comment thread variables.tf
Comment on lines +1 to +12
variable "location" {}
variable "resource_group_name" {}
variable "virtual_network_name" {}
variable "vnet_address_prefix" {}
variable "subnet_name" {}
variable "subnet_address_prefix" {}
variable "network_security_group_name" {}
variable "public_ip_address_name" {}
variable "vm_name" {}
variable "vm_size" {}
variable "ssh_key_public" {}
variable "dns_label" {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: modules/network/main.tf is still missing - should create vnet (vnet, 10.0.0.0/16), subnet (default, 10.0.0.0/24), NSG (defaultnsg), and public IP (linuxboxpip with dynamic allocation and dns_label).

Comment thread variables.tf
Comment on lines +1 to +12
variable "location" {}
variable "resource_group_name" {}
variable "virtual_network_name" {}
variable "vnet_address_prefix" {}
variable "subnet_name" {}
variable "subnet_address_prefix" {}
variable "network_security_group_name" {}
variable "public_ip_address_name" {}
variable "vm_name" {}
variable "vm_size" {}
variable "ssh_key_public" {}
variable "dns_label" {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: modules/compute/main.tf is still missing - should create NIC (matebox-nic), VM (matebox, Ubuntu2204, Standard_B1s), and CustomScript extension for install-app.sh.

Comment thread variables.tf
Comment on lines +1 to +12
variable "location" {}
variable "resource_group_name" {}
variable "virtual_network_name" {}
variable "vnet_address_prefix" {}
variable "subnet_name" {}
variable "subnet_address_prefix" {}
variable "network_security_group_name" {}
variable "public_ip_address_name" {}
variable "vm_name" {}
variable "vm_size" {}
variable "ssh_key_public" {}
variable "dns_label" {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: modules/storage/main.tf is still missing - should create storage account and container 'task-artifacts'.

Comment thread variables.tf
Comment on lines +1 to +12
variable "location" {}
variable "resource_group_name" {}
variable "virtual_network_name" {}
variable "vnet_address_prefix" {}
variable "subnet_name" {}
variable "subnet_address_prefix" {}
variable "network_security_group_name" {}
variable "public_ip_address_name" {}
variable "vm_name" {}
variable "vm_size" {}
variable "ssh_key_public" {}
variable "dns_label" {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

terraform.tfvars file is missing - should provide actual values for the deployment.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Excellent progress on implementing all the required modules! The overall structure is correct and very close to completion. However, this requires a change because of a critical configuration error that was also present in the last review.

In backend.tf, the storage_account_name is set to mystsddttorage123, but the task requires it to be yourstorageaccount. This is the main blocker preventing the remote state from being configured correctly.

Additionally, I've left a suggestion in modules/compute/main.tf to use ${path.root} instead of ${path.cwd} for a more robust script path. Please fix the critical backend issue to complete the task. You're almost there!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread backend.tf Outdated
terraform {
backend "azurerm" {
resource_group_name = "mate-azure-task-12"
storage_account_name = "mystsddttorage123"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the task requirements, the storage_account_name for the remote state backend must be yourstorageaccount. Please update this value to match the specification.

Comment thread modules/compute/main.tf

settings = <<SETTINGS
{
"commandToExecute": "bash -c 'cat <<EOF > install-app.sh\n${file("${path.cwd}/install-app.sh")}\nEOF\n bash install-app.sh'"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While using path.cwd might work when you run terraform from the project's root directory, it's not the most robust approach. A better practice is to use path.root, which always refers to the path of the root module, regardless of the current working directory. This makes your configuration more reliable.

Consider changing ${path.cwd} to ${path.root}.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Excellent work on fixing the critical backend configuration! The project is now fully functional and very well-structured. To help you keep moving forward, I am approving this submission. However, there are a couple of small but important improvements to consider for your future projects. In modules/compute/main.tf, the script path uses path.cwd, which can be unreliable. A more robust approach is to use path.root to ensure the script is always found. Additionally, the automated checks failed due to formatting; you can easily fix this by running terraform fmt -recursive. Great job overall, you're very close to a perfect solution!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment thread modules/compute/main.tf

settings = <<SETTINGS
{
"commandToExecute": "bash -c 'cat <<EOF > install-app.sh\n${file("${path.cwd}/install-app.sh")}\nEOF\n bash install-app.sh'"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using path.cwd here is not robust as it depends on the directory from which Terraform is executed. To ensure the install-app.sh script is always found, please use path.root, which consistently refers to the root directory of your Terraform configuration.

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.

2 participants