From ab2fa9f399115e2bc98a91199e093951b5ce23f5 Mon Sep 17 00:00:00 2001 From: aamanrebello Date: Sun, 20 Sep 2026 00:24:45 +0100 Subject: [PATCH] fix(calm-hub): stream nitrite seed payloads via stdin to avoid Windows arg limit init-nitrite.sh passed each document's JSON payload to curl as a command-line argument (-d "$payload"). Windows caps total process command-line length far below Linux/macOS ARG_MAX, so seeding large documents (e.g. a full architecture with many nodes and relationships) fails with "Argument list too long" before curl even runs. Switch the four affected curl calls to stream the payload over stdin instead (--data-binary @- <<< "$payload"). The HTTP request sent is unchanged; only the OS-level mechanism for handing curl the body differs, so behaviour on Linux/macOS/CI is unaffected. Co-Authored-By: Claude Sonnet 5 --- calm-hub/nitrite/init-nitrite.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/calm-hub/nitrite/init-nitrite.sh b/calm-hub/nitrite/init-nitrite.sh index 5e88e3868..cf3b9d98a 100755 --- a/calm-hub/nitrite/init-nitrite.sh +++ b/calm-hub/nitrite/init-nitrite.sh @@ -183,7 +183,7 @@ post_document() { local http_code http_code=$(curl -s -o /dev/null -w "%{http_code}" -X POST "$CALM_HUB_URL/api/calm/namespaces/$namespace/$resource" \ -H "$CONTENT_TYPE" \ - -d "$payload") + --data-binary @- <<< "$payload") if [[ "$http_code" == "200" || "$http_code" == "201" ]]; then print_status "Created $resource '$name' in namespace $namespace" @@ -217,7 +217,7 @@ post_named_document() { http_code=$(curl -s -o /dev/null -w "%{http_code}" -X POST \ "$CALM_HUB_URL/calm/namespaces/$namespace/$resource/$slug/versions/$version" \ -H "$CONTENT_TYPE" \ - -d "$payload") + --data-binary @- <<< "$payload") if [[ "$http_code" == "200" || "$http_code" == "201" ]]; then print_status "Created $resource '$slug' version $version in namespace $namespace" @@ -263,7 +263,7 @@ post_architecture_version() { http_code=$(curl -s -o /dev/null -w "%{http_code}" -X POST \ "$CALM_HUB_URL/api/calm/namespaces/$namespace/architectures/$architecture_id/versions/$version" \ -H "$CONTENT_TYPE" \ - -d "$payload") + --data-binary @- <<< "$payload") if [[ "$http_code" == "200" || "$http_code" == "201" ]]; then print_status "Created architecture '$name' version $version in namespace $namespace" @@ -297,7 +297,7 @@ post_pattern_version() { http_code=$(curl -s -o /dev/null -w "%{http_code}" -X POST \ "$CALM_HUB_URL/api/calm/namespaces/$namespace/patterns/$pattern_id/versions/$version" \ -H "$CONTENT_TYPE" \ - -d "$payload") + --data-binary @- <<< "$payload") if [[ "$http_code" == "200" || "$http_code" == "201" ]]; then print_status "Created pattern '$name' version $version in namespace $namespace"