Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .agents/references/meshstack-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ resource "meshstack_building_block" "example" {
# ...
lifecycle {
postcondition {
condition = self.status.status == "SUCCEEDED"
error_message = "Building block ${self.metadata.uuid} is ${self.status.status}, not SUCCEEDED. See its run in meshPanel."
condition = self.status.succeeded
error_message = "Building block ${self.metadata.uuid} did not succeed (health status ${self.status.health_status}, action ${self.status.action}). See its run in meshPanel."
}
}
}
Expand All @@ -103,8 +103,9 @@ resource "meshstack_building_block" "example" {
Copy those four lines verbatim, in every child building block, including the ones in
`reference-architectures/` — the scorecard only scans `modules/`, so nothing checks them for you.
Do not write a per-block message: OpenTofu prints the resource address and the file and line of the
failing postcondition, and `self` supplies the uuid and the status, so the identical message names
the specific block anyway.
failing postcondition, and `self` supplies the uuid, health status and action, so the identical
message names the specific block anyway. `status.succeeded` needs meshStack provider v0.27.0, so a
module with this postcondition requires `>= 0.27.0`.

**Why the check has to be in the configuration.** From meshStack provider v0.25.2 on, a run that
does not succeed never fails the apply — the provider warns, keeps the block, and the next plan
Expand All @@ -125,16 +126,16 @@ child block in state for the next apply to repair.
is still `PENDING` or `IN_PROGRESS`, and the postcondition then fails on a run that had not
finished.

**What a non-`SUCCEEDED` status does on the next plan** depends on whether the provider plans a
**What a run that did not succeed does on the next plan** depends on whether the provider plans a
re-run:

- `FAILED` or `ABORTED` — the provider plans an in-place re-run, which makes `status` unknown in the
plan, so the postcondition moves to the apply. If the re-run does not succeed either, the
- `FAILED` or `ABORTED` — the provider plans an in-place re-run, which makes `succeeded` unknown in
the plan, so the postcondition moves to the apply. If the re-run does not succeed either, the
postcondition is what fails that apply: the provider itself only ever warns about a run status.
- One of the four `WAITING_FOR_*` statuses (`OPERATOR_INPUT`, `USER_INPUT`, `DEPENDENT_INPUT`,
`APPROVAL`) — the provider plans no re-run, `status` stays known, and the postcondition **fails
`APPROVAL`) — the provider plans no re-run, `succeeded` stays known, and the postcondition **fails
the plan**, not just the apply. That is the intended signal: no apply will fix this by itself, so
someone has to supply the input or approve the run in meshPanel. A child block that is *meant* to
park — one whose definition requires an approval — is the one case for a looser condition, e.g.
`contains(["SUCCEEDED", "WAITING_FOR_APPROVAL"], self.status.status)`.
`self.status.succeeded || self.status.action == "APPROVE_RUN"`.

2 changes: 1 addition & 1 deletion .agents/skills/e2e-test/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ target_ref = {

- Name the file `<cloud>_<service>.tftest.hcl`, or `<cloud>_<service>_<variant>.tftest.hcl` when a
module has several variants. Older modules carry a `_hub` suffix from when the file was hub-only.
- Always assert `status.status == "SUCCEEDED"` as the first check.
- Always assert `status.succeeded` as the first check.
- Assert meaningful output values (URLs, strings, booleans) to validate the building block executed
correctly. Every output `value` is a `jsonencode`d string — read it with
`jsondecode(<res>.status.outputs["<name>"].value)` (a CODE/JSON output decodes twice).
Expand Down
1 change: 0 additions & 1 deletion modules/aks/github-connector/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ EOT
terraform = {
repository_url = "https://github.com/meshcloud/meshstack-hub.git"
terraform_version = "1.12.5"
async = false
ref_name = var.hub.git_ref
repository_path = "modules/aks/github-connector/buildingblock"
use_mesh_http_backend_fallback = true
Expand Down
2 changes: 1 addition & 1 deletion modules/aks/starterkit/buildingblock/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This documentation is intended as a reference documentation for cloud foundation

| Name | Version |
|------|---------|
| <a name="requirement_meshstack"></a> [meshstack](#requirement\_meshstack) | >= 0.24.4 |
| <a name="requirement_meshstack"></a> [meshstack](#requirement\_meshstack) | >= 0.27.0 |

## Modules

Expand Down
8 changes: 4 additions & 4 deletions modules/aks/starterkit/buildingblock/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ resource "meshstack_building_block" "repo" {

lifecycle {
postcondition {
condition = self.status.status == "SUCCEEDED"
error_message = "Building block ${self.metadata.uuid} is ${self.status.status}, not SUCCEEDED. See its run in meshPanel."
condition = self.status.succeeded
error_message = "Building block ${self.metadata.uuid} did not succeed (health status ${self.status.health_status}, action ${self.status.action}). See its run in meshPanel."
}
}
}
Expand Down Expand Up @@ -146,8 +146,8 @@ resource "meshstack_building_block" "github_actions" {

lifecycle {
postcondition {
condition = self.status.status == "SUCCEEDED"
error_message = "Building block ${self.metadata.uuid} is ${self.status.status}, not SUCCEEDED. See its run in meshPanel."
condition = self.status.succeeded
error_message = "Building block ${self.metadata.uuid} did not succeed (health status ${self.status.health_status}, action ${self.status.action}). See its run in meshPanel."
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/aks/starterkit/buildingblock/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.24.4"
version = ">= 0.27.0"
}
}
}
3 changes: 1 addition & 2 deletions modules/aks/starterkit/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ EOT
terraform = {
repository_url = "https://github.com/meshcloud/meshstack-hub.git"
terraform_version = "1.12.5"
async = false
ref_name = var.hub.git_ref
repository_path = "modules/aks/starterkit/buildingblock"
use_mesh_http_backend_fallback = true
Expand Down Expand Up @@ -327,7 +326,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.24.0"
version = ">= 0.27.0"
}
}
}
4 changes: 2 additions & 2 deletions modules/aws/s3_bucket/e2e/tests/aws_s3_bucket_hub.tftest.hcl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
run "building_block_aws_s3_bucket_hub" {
assert {
condition = meshstack_building_block.this.status.status == "SUCCEEDED"
error_message = "aws s3_bucket hub building block expected SUCCEEDED, got ${meshstack_building_block.this.status.status}"
condition = meshstack_building_block.this.status.succeeded
error_message = "aws s3_bucket hub building block expected SUCCEEDED, got health status ${meshstack_building_block.this.status.health_status}, action ${meshstack_building_block.this.status.action}"
}

assert {
Expand Down
2 changes: 1 addition & 1 deletion modules/aws/s3_bucket/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ terraform {
}
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.26.2"
version = ">= 0.27.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The Azure VM Starterkit building block automates the creation of a complete Azur

| Name | Version |
|------|---------|
| <a name="requirement_meshstack"></a> [meshstack](#requirement\_meshstack) | >= 0.23.0 |
| <a name="requirement_meshstack"></a> [meshstack](#requirement\_meshstack) | >= 0.27.0 |

## Modules

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ resource "meshstack_building_block" "azure_vm" {

lifecycle {
postcondition {
condition = self.status.status == "SUCCEEDED"
error_message = "Building block ${self.metadata.uuid} is ${self.status.status}, not SUCCEEDED. See its run in meshPanel."
condition = self.status.succeeded
error_message = "Building block ${self.metadata.uuid} did not succeed (health status ${self.status.health_status}, action ${self.status.action}). See its run in meshPanel."
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.23.0"
version = ">= 0.27.0"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
run "azure_budget_alert_hub" {
assert {
condition = meshstack_building_block.this.status.status == "SUCCEEDED"
error_message = "azure/budget-alert hub building block expected SUCCEEDED, got ${meshstack_building_block.this.status.status}"
condition = meshstack_building_block.this.status.succeeded
error_message = "azure/budget-alert hub building block expected SUCCEEDED, got health status ${meshstack_building_block.this.status.health_status}, action ${meshstack_building_block.this.status.action}"
}

assert {
Expand Down
2 changes: 1 addition & 1 deletion modules/azure/budget-alert/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.26.2"
version = ">= 0.27.0"
}
azurerm = {
source = "hashicorp/azurerm"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
run "azure_entra_id_groups_hub" {
assert {
condition = meshstack_building_block.this.status.status == "SUCCEEDED"
error_message = "azure/entra-id-groups hub building block expected SUCCEEDED, got ${meshstack_building_block.this.status.status}"
condition = meshstack_building_block.this.status.succeeded
error_message = "azure/entra-id-groups hub building block expected SUCCEEDED, got health status ${meshstack_building_block.this.status.health_status}, action ${meshstack_building_block.this.status.action}"
}

# group_object_ids is a role -> object ID map serialised into a STRING output. Counting GUIDs in
Expand Down
2 changes: 1 addition & 1 deletion modules/azure/entra-id-groups/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.26.2"
version = ">= 0.27.0"
}
azurerm = {
source = "hashicorp/azurerm"
Expand Down
4 changes: 2 additions & 2 deletions modules/azure/ipam-pool/e2e/tests/azure_ipam_pool.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

run "azure_ipam_pool" {
assert {
condition = meshstack_building_block.this.status.status == "SUCCEEDED"
error_message = "Building block run did not succeed: ${meshstack_building_block.this.status.status}"
condition = meshstack_building_block.this.status.succeeded
error_message = "Building block run did not succeed: health status ${meshstack_building_block.this.status.health_status}, action ${meshstack_building_block.this.status.action}"
}

assert {
Expand Down
2 changes: 1 addition & 1 deletion modules/azure/ipam-pool/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.26.2"
version = ">= 0.27.0"
}
azurerm = {
source = "hashicorp/azurerm"
Expand Down
4 changes: 2 additions & 2 deletions modules/azure/key-vault/e2e/tests/azure_key_vault.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

run "azure_key_vault" {
assert {
condition = meshstack_building_block.this.status.status == "SUCCEEDED"
error_message = "Building block run did not succeed: ${meshstack_building_block.this.status.status}"
condition = meshstack_building_block.this.status.succeeded
error_message = "Building block run did not succeed: health status ${meshstack_building_block.this.status.health_status}, action ${meshstack_building_block.this.status.action}"
}

assert {
Expand Down
2 changes: 1 addition & 1 deletion modules/azure/key-vault/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.26.2"
version = ">= 0.27.0"
}
azurerm = {
source = "hashicorp/azurerm"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
run "azure_resource_group_hub" {
assert {
condition = meshstack_building_block.this.status.status == "SUCCEEDED"
error_message = "azure/resource-group hub building block expected SUCCEEDED, got ${meshstack_building_block.this.status.status}"
condition = meshstack_building_block.this.status.succeeded
error_message = "azure/resource-group hub building block expected SUCCEEDED, got health status ${meshstack_building_block.this.status.health_status}, action ${meshstack_building_block.this.status.action}"
}

assert {
Expand Down
2 changes: 1 addition & 1 deletion modules/azure/resource-group/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.26.2"
version = ">= 0.27.0"
}
azurerm = {
source = "hashicorp/azurerm"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
run "azure_service_principal_hub" {
assert {
condition = meshstack_building_block.this.status.status == "SUCCEEDED"
error_message = "azure/service-principal hub building block expected SUCCEEDED, got ${meshstack_building_block.this.status.status}"
condition = meshstack_building_block.this.status.succeeded
error_message = "azure/service-principal hub building block expected SUCCEEDED, got health status ${meshstack_building_block.this.status.health_status}, action ${meshstack_building_block.this.status.action}"
}

assert {
Expand Down
2 changes: 1 addition & 1 deletion modules/azure/service-principal/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.26.2"
version = ">= 0.27.0"
}
azurerm = {
source = "hashicorp/azurerm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ variables {

run "azure_spoke_network" {
assert {
condition = meshstack_building_block.this.status.status == "SUCCEEDED"
error_message = "Building block run did not succeed: ${meshstack_building_block.this.status.status}"
condition = meshstack_building_block.this.status.succeeded
error_message = "Building block run did not succeed: health status ${meshstack_building_block.this.status.health_status}, action ${meshstack_building_block.this.status.action}"
}

assert {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ variables {

run "azure_spoke_network_ipam" {
assert {
condition = meshstack_building_block.this.status.status == "SUCCEEDED"
error_message = "Building block run did not succeed: ${meshstack_building_block.this.status.status}"
condition = meshstack_building_block.this.status.succeeded
error_message = "Building block run did not succeed: health status ${meshstack_building_block.this.status.health_status}, action ${meshstack_building_block.this.status.action}"
}

assert {
Expand Down
2 changes: 1 addition & 1 deletion modules/azure/spoke-network/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.26.2"
version = ">= 0.27.0"
}
azurerm = {
source = "hashicorp/azurerm"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
run "azure_storage_account_hub" {
assert {
condition = meshstack_building_block.this.status.status == "SUCCEEDED"
error_message = "azure/storage-account hub building block expected SUCCEEDED, got ${meshstack_building_block.this.status.status}"
condition = meshstack_building_block.this.status.succeeded
error_message = "azure/storage-account hub building block expected SUCCEEDED, got health status ${meshstack_building_block.this.status.health_status}, action ${meshstack_building_block.this.status.action}"
}

assert {
Expand Down
2 changes: 1 addition & 1 deletion modules/azure/storage-account/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.26.2"
version = ">= 0.27.0"
}
azurerm = {
source = "hashicorp/azurerm"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
run "building_block_gcp_budget_alert_hub" {
assert {
condition = meshstack_building_block.this.status.status == "SUCCEEDED"
error_message = "gcp budget-alert hub building block expected SUCCEEDED, got ${meshstack_building_block.this.status.status}"
condition = meshstack_building_block.this.status.succeeded
error_message = "gcp budget-alert hub building block expected SUCCEEDED, got health status ${meshstack_building_block.this.status.health_status}, action ${meshstack_building_block.this.status.action}"
}

assert {
Expand Down
2 changes: 1 addition & 1 deletion modules/gcp/budget-alert/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.26.2"
version = ">= 0.27.0"
}
google = {
source = "hashicorp/google"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
run "building_block_gcp_storage_bucket_hub" {
assert {
condition = meshstack_building_block.this.status.status == "SUCCEEDED"
error_message = "gcp storage-bucket hub building block expected SUCCEEDED, got ${meshstack_building_block.this.status.status}"
condition = meshstack_building_block.this.status.succeeded
error_message = "gcp storage-bucket hub building block expected SUCCEEDED, got health status ${meshstack_building_block.this.status.health_status}, action ${meshstack_building_block.this.status.action}"
}

assert {
Expand Down
2 changes: 1 addition & 1 deletion modules/gcp/storage-bucket/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ terraform {
required_providers {
meshstack = {
source = "meshcloud/meshstack"
version = ">= 0.26.2"
version = ">= 0.27.0"
}
google = {
source = "hashicorp/google"
Expand Down
1 change: 0 additions & 1 deletion modules/github/repository/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ EOT
terraform = {
repository_url = "https://github.com/meshcloud/meshstack-hub.git"
terraform_version = "1.12.5"
async = false
ref_name = var.hub.git_ref
repository_path = "modules/github/repository/buildingblock"
use_mesh_http_backend_fallback = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ resource "meshstack_building_block_definition" "this" {
repository_path = "modules/kubernetes/github-connector/buildingblock"
ref_name = var.hub.git_ref
terraform_version = "1.12.5"
async = false
use_mesh_http_backend_fallback = true
}
}
Expand Down
1 change: 0 additions & 1 deletion modules/kubernetes/ingress/meshstack_integration.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ resource "meshstack_building_block_definition" "this" {
repository_url = "https://github.com/meshcloud/meshstack-hub.git"
repository_path = "modules/kubernetes/ingress/buildingblock"
ref_name = var.hub.git_ref
async = false
use_mesh_http_backend_fallback = true
}
}
Expand Down
Loading
Loading