thrivekit 2.0.16 → 2.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/ralph/api.sh +6 -0
- package/ralph/loop.sh +13 -3
package/package.json
CHANGED
package/ralph/api.sh
CHANGED
|
@@ -78,6 +78,12 @@ run_api_validation() {
|
|
|
78
78
|
elif [[ "$response_code" == "000" ]]; then
|
|
79
79
|
print_error "connection failed"
|
|
80
80
|
failed=1
|
|
81
|
+
elif [[ "$response_code" == "422" || "$response_code" == "400" ]]; then
|
|
82
|
+
# 422/400 = endpoint exists but needs params - don't fail verification
|
|
83
|
+
print_warning "$response_code (needs params)"
|
|
84
|
+
elif [[ "$response_code" == "401" || "$response_code" == "403" ]]; then
|
|
85
|
+
# Auth required - endpoint exists
|
|
86
|
+
print_warning "$response_code (auth required)"
|
|
81
87
|
else
|
|
82
88
|
print_error "$response_code"
|
|
83
89
|
failed=1
|
package/ralph/loop.sh
CHANGED
|
@@ -44,13 +44,23 @@ preflight_checks() {
|
|
|
44
44
|
# Check for alembic migrations
|
|
45
45
|
if [[ -d "$backend_dir/alembic" ]] || [[ -d "$backend_dir/migrations" ]]; then
|
|
46
46
|
printf " Database migrations... "
|
|
47
|
-
#
|
|
47
|
+
# Detect Python runner
|
|
48
|
+
local py_runner="python"
|
|
49
|
+
if [[ -f "$backend_dir/uv.lock" ]]; then
|
|
50
|
+
py_runner="uv run"
|
|
51
|
+
elif [[ -f "$backend_dir/poetry.lock" ]]; then
|
|
52
|
+
py_runner="poetry run"
|
|
53
|
+
fi
|
|
54
|
+
# Try to verify DB connection via alembic
|
|
48
55
|
if [[ -f "$backend_dir/alembic.ini" ]]; then
|
|
49
|
-
if (cd "$backend_dir" && alembic current >/dev/null 2>&1); then
|
|
56
|
+
if (cd "$backend_dir" && $py_runner alembic current >/dev/null 2>&1); then
|
|
50
57
|
print_success "ok"
|
|
58
|
+
elif docker compose exec -T api alembic current >/dev/null 2>&1; then
|
|
59
|
+
# Try via Docker if local fails
|
|
60
|
+
print_success "ok (via docker)"
|
|
51
61
|
else
|
|
52
62
|
print_warning "check DB connection"
|
|
53
|
-
echo " Run: cd $backend_dir && alembic current"
|
|
63
|
+
echo " Run: cd $backend_dir && $py_runner alembic current"
|
|
54
64
|
((warnings++))
|
|
55
65
|
fi
|
|
56
66
|
fi
|