From f2230edae0e28da22e46f2af9edd7f3b5f05aa9f Mon Sep 17 00:00:00 2001 From: Jon Chery Date: Wed, 22 Jul 2026 21:05:12 +0000 Subject: [PATCH] fix(P26): generalize run_platform.sh check-only assertions for all contracts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The --check-only mode hardcoded static-assets-specific assertions (stack name == 'static-assets', 'aws_s3_bucket' in main.tf, 'acdl-spike-bucket' in main.tf). The platform-test.yml integration-test stage runs check-only for every contracts/*.yaml, so contracts/microservice.yaml would fail the AssertionError. Replace with generic structural checks valid for any contract. verify(P0): code review — correctness ---ci--- phase: 26 milestone: v1.7 status: verify lessons: - P0 fix applied: run_platform.sh check-only hardcoded static-assets assertions broke for non-static-assets contracts (microservice); generalized to structural checks ---/ci--- --- scripts/run_platform.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/scripts/run_platform.sh b/scripts/run_platform.sh index dde6749..f8c2b13 100755 --- a/scripts/run_platform.sh +++ b/scripts/run_platform.sh @@ -135,21 +135,19 @@ if [ "$CHECK_ONLY" = "1" ]; then python3 -c " import json, os d = json.load(open('$WORK/stack.json')) -assert d['stack']['name'] == 'static-assets', f\"expected static-assets, got {d['stack']['name']}\" -assert len(d['resources']) >= 1 +assert d['stack']['name'], 'stack name missing' +assert len(d['resources']) >= 1, 'expected at least 1 resource' tf_dir = 'terraform/spike' for f in ('main.tf', 'terraform.tf', 'providers.tf'): assert os.path.isfile(os.path.join(tf_dir, f)), f'{f} missing' main = open(os.path.join(tf_dir, 'main.tf')).read() -assert 'aws_s3_bucket' in main -assert 'acdl-spike-bucket' in main -assert 'versioning' in main +assert len(main) > 0, 'main.tf is empty' tf = open(os.path.join(tf_dir, 'terraform.tf')).read() assert 'backend' in tf assert 'required_version' in tf prov = open(os.path.join(tf_dir, 'providers.tf')).read() assert 'provider \"aws\"' in prov -print('adapter output: OK') +print(f\"adapter output: OK ({d['stack']['name']}, {len(d['resources'])} resource(s))\") " echo "" echo "=== PLATFORM CHECK OK ==="