Compare commits
1 Commits
step35/443
...
fix/650
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44ec5811d7 |
42
docs/issue-650-verification.md
Normal file
42
docs/issue-650-verification.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# Issue #650 Verification
|
||||
|
||||
Status: already implemented on `main`
|
||||
|
||||
Issue: `[Pipeline] pipeline_state.json needs daily reset`
|
||||
|
||||
Summary:
|
||||
The repo already contains the full daily-reset implementation for `pipeline_state.json`.
|
||||
Yesterday's complete/failed states are reset by age, stuck running states older than 6 hours are cleared, the nightly scheduler calls the reset helper before each cycle, and a dedicated midnight cron entry runs the reset script against `~/.hermes/pipeline_state.json`.
|
||||
|
||||
Evidence on `main`:
|
||||
- `scripts/reset_pipeline_state.py`
|
||||
- removes stale `complete` and `failed` entries older than 24 hours
|
||||
- removes stale `running` entries older than 6 hours
|
||||
- supports direct execution against `~/.hermes/pipeline_state.json`
|
||||
- `scripts/test_reset_pipeline_state.py`
|
||||
- covers fresh vs stale complete entries
|
||||
- covers stale failed entries
|
||||
- covers stuck running entries
|
||||
- passes on a fresh clone
|
||||
- `scripts/nightly-pipeline-scheduler.sh`
|
||||
- calls `reset_pipeline_state.py` before pipeline scheduling
|
||||
- treats stale completion state as not reusable forever
|
||||
- `cron/pipeline-daily-reset.yml`
|
||||
- schedules a midnight daily reset using `python3 scripts/reset_pipeline_state.py --state-file ~/.hermes/pipeline_state.json`
|
||||
|
||||
Verification commands run:
|
||||
- `python3 scripts/test_reset_pipeline_state.py`
|
||||
- `bash -n scripts/nightly-pipeline-scheduler.sh`
|
||||
- `python3 -m py_compile scripts/reset_pipeline_state.py`
|
||||
|
||||
Result:
|
||||
- reset script tests passed
|
||||
- scheduler shell syntax check passed
|
||||
- reset script compiled cleanly
|
||||
|
||||
Additional trail:
|
||||
- issue comment references closed PR #676 describing timestamp-based staleness logic
|
||||
- current `main` already contains the reset helper, scheduler integration, tests, and cron wiring
|
||||
|
||||
Recommendation:
|
||||
Close issue #650 as already implemented on `main`.
|
||||
40
tests/test_issue_650_pipeline_daily_reset.py
Normal file
40
tests/test_issue_650_pipeline_daily_reset.py
Normal file
@@ -0,0 +1,40 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
||||
def test_issue_650_daily_reset_helper_exists() -> None:
|
||||
helper = REPO_ROOT / "scripts" / "reset_pipeline_state.py"
|
||||
text = helper.read_text()
|
||||
|
||||
assert helper.exists()
|
||||
assert "DEFAULT_COMPLETE_MAX_AGE_HOURS = 24" in text
|
||||
assert "DEFAULT_FAILED_MAX_AGE_HOURS = 24" in text
|
||||
assert "DEFAULT_RUNNING_MAX_AGE_HOURS = 6" in text
|
||||
assert "def reset_pipeline_state(" in text
|
||||
|
||||
|
||||
def test_issue_650_scheduler_invokes_reset_helper() -> None:
|
||||
scheduler = (REPO_ROOT / "scripts" / "nightly-pipeline-scheduler.sh").read_text()
|
||||
|
||||
assert 'python3 "$script_dir/reset_pipeline_state.py" --state-file "$STATE_FILE"' in scheduler
|
||||
assert "Reset stale pipeline states from previous days" in scheduler
|
||||
assert "Check staleness: complete from a previous day is stale" in scheduler
|
||||
|
||||
|
||||
def test_issue_650_midnight_cron_reset_exists() -> None:
|
||||
cron_def = (REPO_ROOT / "cron" / "pipeline-daily-reset.yml").read_text()
|
||||
|
||||
assert "Pipeline State Daily Reset" in cron_def
|
||||
assert "schedule: '0 0 * * *'" in cron_def
|
||||
assert "python3 scripts/reset_pipeline_state.py --state-file ~/.hermes/pipeline_state.json" in cron_def
|
||||
|
||||
|
||||
def test_issue_650_verification_doc_records_current_mainline_state() -> None:
|
||||
doc = (REPO_ROOT / "docs" / "issue-650-verification.md").read_text()
|
||||
|
||||
assert "already implemented on `main`" in doc
|
||||
assert "scripts/reset_pipeline_state.py" in doc
|
||||
assert "cron/pipeline-daily-reset.yml" in doc
|
||||
assert "Close issue #650 as already implemented on `main`." in doc
|
||||
Reference in New Issue
Block a user