Repository navigation
feat: add tag, JSON-schema, and conditional inputs to NoOp BB - #307
Conversation
Scorecard Check
📊 meshstack-hub Module Scorecard
📋 Per-Module Category SummaryScore per category per building block.
Core Structure — ✅ all passingBasic module file structure and documentation — applies to 1 modules
Core Structure — Summary
Integration — ✅ all passingmeshstack_integration.tf conventions — applies to 1 modules
Integration — Summary
AWS Backplane — not applicableAWS automation principal conventions (WIF or cross-account StackSet) — applies to 0 modules No applicable modules. Azure Backplane — not applicableAzure UAMI-based automation principal conventions — applies to 0 modules No applicable modules. GCP Backplane — not applicableGCP workload-identity-federation automation principal conventions — applies to 0 modules No applicable modules. STACKIT Backplane — not applicableSTACKIT WIF-based automation principal conventions — applies to 0 modules No applicable modules. Testing — ✅ all passingEnd-to-end test coverage — applies to 1 modules
Testing — Summary
|
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
91f4dcb to
af261bd
Compare
738d1b2 to
bc6c2de
Compare
|
Smoke Test is green: https://github.com/meshcloud/meshstack-smoke-test/actions/runs/34586859362 |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Untagged runs can fail, and the e2e fixtures introduce unsafe shared-workspace tag mutations.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 3
Open (5)
What changed in this PR
Extends the NoOp reference building block with tag, JSON-schema, and conditional inputs plus end-to-end coverage.
Changes:
- Adds new input/output definitions and provider requirement.
- Extends standard and custom-runner e2e fixtures.
- Updates reference documentation and expected outputs.
| File | Description |
|---|---|
modules/meshstack/noop/meshstack_integration.tf |
Defines new inputs/outputs and provider floor. |
modules/meshstack/noop/buildingblock/variables.tf |
Declares corresponding Terraform variables. |
modules/meshstack/noop/buildingblock/outputs.tf |
Exposes and debugs new values. |
modules/meshstack/noop/buildingblock/README.md |
Documents new input types. |
modules/meshstack/noop/e2e/main.tf |
Adds tag fixtures and input values. |
modules/meshstack/noop/e2e/runner/main.tf |
Extends custom-runner coverage. |
modules/meshstack/noop/e2e/tests/building_block_noop_hub.tftest.hcl |
Asserts new standard-runner outputs. |
modules/meshstack/noop/e2e/tests/building_block_noop_runner_hub.tftest.hcl |
Asserts conditional and JSON outputs. |
modules/meshstack/noop/e2e/tests/building_block_noop_hub.debug_input_variables_json.expected.json |
Updates expected debug payload. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
* This is WIP because we need a meshStack release first
Demonstrates the meshcloud/meshstack provider's new json_schema (type = JSON) and condition attributes (v0.25.3, requires meshStack 2026.37.0+), and cleans up the tag_value output now that TAG output assignment works.
Adds hidden_conditional_text alongside conditional_text so the e2e tests exercise both sides of the condition attribute: a condition that holds (value sent) and one that never holds (input hidden, safely skipped, Terraform variable default flows through).
A raw == between a jsondecode()'d building block output and an HCL object/list literal can spuriously fail on OpenTofu's tuple/object type unification even when the values are identical (observed on real smoke-test runs). Compare canonical jsonencode() strings on both sides instead.
CI's pre-commit run had fixed the alignment/ordering locally but the changes were never committed, failing the lint job.
meshStack decodes a JSON-type input into the Terraform variable's declared type, same as a CODE input (see tag_value, static_code) — not as a raw JSON string. Retype deploy_settings accordingly and drop the now-unneeded jsondecode()/double jsonencode() around it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The meshStack API rejects a JSON input's value unless it's sent as JSON text (a string) — confirmed by a smoke-test run: "the value of a JSON input is JSON text, so send it as a string." That's independent of what type the Terraform variable decodes it into, so the previous commit's switch to a single jsonencode() was wrong; restore the double encode. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ff140a9 to
cd22f21
Compare



Summary
Extends the
meshstack/noopreference building block to demonstrate threemeshcloud/meshstackprovider features that are now available: tag inputs, JSON-schema-driven inputs, and conditional
inputs. Bumps the provider constraint to
>= 0.25.3(required forjson_schema/condition).tag_value(TAGassignment) now also has a workingNONEoutput — removed the stale"waiting for TF provider release" comment now that it's supported.
deploy_settingsinput (type = "JSON"+json_schema) — meshPanelrenders a form from the schema, and the result reaches Terraform as JSON text, like a
CODEinput.conditional_text(condition = "input.flag == true", shown andfilled in the e2e tests) and
hidden_conditional_text(condition = "input.flag == false", nevershown in this reference deployment) — together they exercise both sides of the
conditionattribute: a condition that holds, and one that doesn't, where the input is safely omitted and the
Terraform variable's own default takes over, exactly like
optional_text.Each feature is documented in
buildingblock/README.mdwith a "How it works" section and codesnippet, following the existing pattern used for optional inputs.
Testing
Added/extended e2e coverage in
e2e/main.tf,e2e/runner/main.tfand their.tftest.hclfiles forall new inputs/outputs, including the skip case for
hidden_conditional_text. Verified against themeshcloud/meshstack-smoke-testdev environment; along the way, fixed a pre-existing flaky assertionpattern (
==between ajsondecode()'d output and an HCL object/list literal, which can spuriouslyfail on OpenTofu's tuple/object type unification) by comparing canonical
jsonencode()stringsinstead, for both
tag_valueand the newdeploy_settingsoutput.Test plan
tofu validatepasses forbuildingblock/and the integration root (provider>= 0.25.3)terraform-docs/terraform fmt/ trailing-whitespace pre-commit hooks passmeshstack/noopremains 100%meshcloud/meshstack-smoke-testdev instance —conditional_textandhidden_conditional_textassertions pass