Skip to content

Commit e99b8a3

Browse files
fix: serialise generatorParams as JSON string; increase health-check timeout to 10 min/120 attempts
Agent-Logs-Url: https://github.com/MaximumTrainer/OpenDataMask/sessions/3e315c55-1910-434c-9d38-de4411033c31 Co-authored-by: MaximumTrainer <1376575+MaximumTrainer@users.noreply.github.com>
1 parent 3df83e4 commit e99b8a3

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

.github/workflows/sandbox-verification.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,21 @@ jobs:
8080
8181
# ── Wait for backend to be healthy ────────────────────────────────────
8282
- name: Wait for backend health
83-
timeout-minutes: 5
83+
timeout-minutes: 10
8484
run: |
8585
echo "Waiting for backend to report UP..."
86-
for i in $(seq 1 60); do
86+
for i in $(seq 1 120); do
8787
STATUS=$(curl -s "${API_BASE}/actuator/health" \
8888
| python3 -c "import sys,json; d=json.load(sys.stdin); print(d.get('status',''))" \
8989
2>/dev/null || true)
9090
if [ "${STATUS}" = "UP" ]; then
9191
echo "✅ Backend is healthy."
9292
exit 0
9393
fi
94-
echo " Attempt ${i}/60: status='${STATUS}' — retrying in 5s..."
94+
echo " Attempt ${i}/120: status='${STATUS}' — retrying in 5s..."
9595
sleep 5
9696
done
97-
echo "::error::Backend did not become healthy within 5 minutes."
97+
echo "::error::Backend did not become healthy within 10 minutes."
9898
exit 1
9999
100100
# ── Register user ─────────────────────────────────────────────────────
@@ -175,10 +175,19 @@ jobs:
175175
run: |
176176
add_generator() {
177177
local col="$1" gtype="$2" params="${3:-}"
178+
# Build JSON via Python so generatorParams is a JSON *string* value
179+
# (the backend field is String?, not an embedded object).
180+
# sys.argv avoids shell-quoting issues with special characters.
178181
if [ -z "${params}" ]; then
179-
BODY="{\"columnName\":\"${col}\",\"generatorType\":\"${gtype}\"}"
182+
BODY=$(python3 -c "
183+
import json, sys
184+
print(json.dumps({'columnName': sys.argv[1], 'generatorType': sys.argv[2]}))
185+
" -- "${col}" "${gtype}")
180186
else
181-
BODY="{\"columnName\":\"${col}\",\"generatorType\":\"${gtype}\",\"generatorParams\":${params}}"
187+
BODY=$(python3 -c "
188+
import json, sys
189+
print(json.dumps({'columnName': sys.argv[1], 'generatorType': sys.argv[2], 'generatorParams': sys.argv[3]}))
190+
" -- "${col}" "${gtype}" "${params}")
182191
fi
183192
curl -sf -X POST "${API_BASE}/api/workspaces/${WS_ID}/tables/${TABLE_ID}/generators" \
184193
-H "Content-Type: application/json" \

verification/run_verification.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,20 @@ info "Table configuration created: id=${TABLE_ID}"
166166
# The 'id' column has no generator → it is passed through unchanged (PK preserved).
167167

168168
add_generator() {
169-
local col="$1" gtype="$2" params="${3:-null}"
170-
if [ "$params" = "null" ]; then
171-
BODY="{\"columnName\":\"${col}\",\"generatorType\":\"${gtype}\"}"
169+
local col="$1" gtype="$2" params="${3:-}"
170+
# Build JSON payload via Python so that generatorParams is properly serialised
171+
# as a JSON *string* value (the backend field is String?, not an embedded object).
172+
# sys.argv avoids any shell-quoting issues with special characters in params.
173+
if [ -z "$params" ]; then
174+
BODY=$(python3 -c "
175+
import json, sys
176+
print(json.dumps({'columnName': sys.argv[1], 'generatorType': sys.argv[2]}))
177+
" -- "$col" "$gtype")
172178
else
173-
BODY="{\"columnName\":\"${col}\",\"generatorType\":\"${gtype}\",\"generatorParams\":${params}}"
179+
BODY=$(python3 -c "
180+
import json, sys
181+
print(json.dumps({'columnName': sys.argv[1], 'generatorType': sys.argv[2], 'generatorParams': sys.argv[3]}))
182+
" -- "$col" "$gtype" "$params")
174183
fi
175184
api_post "/api/workspaces/${WS_ID}/tables/${TABLE_ID}/generators" "$BODY" > /dev/null
176185
info " Generator added: ${col}${gtype}"

0 commit comments

Comments
 (0)