fix: reset_stale_states delegates to standalone script (closes #650)
Some checks failed
Validate Config / Playbook Schema Validation (pull_request) Successful in 14s
Architecture Lint / Linter Tests (pull_request) Successful in 26s
PR Checklist / pr-checklist (pull_request) Failing after 25m6s
Smoke Test / smoke (pull_request) Failing after 12s
Validate Config / YAML Lint (pull_request) Failing after 8s
Validate Config / Python Syntax & Import Check (pull_request) Failing after 35s
Validate Config / JSON Validate (pull_request) Successful in 13s
Validate Config / Cron Syntax Check (pull_request) Successful in 8s
Validate Config / Deploy Script Dry Run (pull_request) Successful in 6s
Validate Config / Shell Script Lint (pull_request) Failing after 34s
Architecture Lint / Lint Repository (pull_request) Has been cancelled
Validate Config / Python Test Suite (pull_request) Has been cancelled

This commit is contained in:
2026-04-17 05:26:06 +00:00
parent 164643577a
commit acba760731

View File

@@ -169,10 +169,16 @@ else:
reset_stale_states() {
python3 -c "
# Delegate to standalone script (fixes #650: inline Python $STATE_FILE escaping bug)
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ -f "$script_dir/reset_pipeline_state.py" ]]; then
python3 "$script_dir/reset_pipeline_state.py" --state-file "$STATE_FILE"
else
# Fallback: inline reset with proper variable expansion
python3 -c "
import json, os
from datetime import datetime, timezone, timedelta
path = '\$STATE_FILE'
path = '$STATE_FILE'
if not os.path.exists(path):
exit(0)
with open(path) as f:
@@ -200,6 +206,7 @@ if stale:
json.dump(d, f, indent=2)
print('Reset stale pipelines: ' + ', '.join(stale))
" 2>/dev/null
fi
}
check_dependency() {