Skip to content

Commit e14f21d

Browse files
committed
fix(ci): give the dump its own schedule instead of the scrape's leftovers
#59 got the scrape to finish, and the run then died in the dump instead: Enrich 06:13 -> 10:33 260 min (on a 200-minute budget) Dump 10:39 -> 11:36 57 min, cut by the job timeout total 330 min Two things were wrong. The budget is only consulted *between* sources, so one long source overran it by an hour; each source is now capped at 40 minutes by `timeout`, and the budget drops to 150 so the rest of the pipeline keeps real room. But the dump does not belong behind a multi-hour live scrape at all. Whenever the scrape runs long the dump is what gets dropped, which is how the published pages drifted away from the records for six weeks. dump-refresh.yml already regenerates the dump from current data with no scraping — and when it last ran, the dump step succeeded; only the PR creation failed on a transient server error. Give it a weekly schedule (Tuesdays, a day after the Monday jobs) so the published dump is reconciled with data/ every week regardless of how the scrape goes, and a job timeout so it can never be silently truncated either. Refs #1
1 parent 791950b commit e14f21d

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

.github/workflows/dump-refresh.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ name: dump-refresh
55
# after an engine-side change that affects serialized output (e.g. a scoring
66
# version bump) — weekly-refresh.yml also does this but behind a slow live scrape.
77
on:
8+
# The dump has to be reconciled with data/ on a schedule of its own.
9+
# weekly-refresh also regenerates it, but only after a multi-hour live
10+
# scrape, and when that scrape runs long the dump is the step that gets
11+
# dropped — which is how the published pages drifted away from the
12+
# records for six weeks. Run a day after the Monday jobs so this picks
13+
# up whatever they merged.
14+
schedule:
15+
- cron: "0 3 * * 2" # Tuesdays 03:00 UTC
816
workflow_dispatch:
917

1018
permissions:
@@ -17,6 +25,9 @@ concurrency:
1725
jobs:
1826
dump:
1927
runs-on: ubuntu-latest
28+
# Well under GitHub's 6h ceiling, which reports an over-run as
29+
# "cancelled" rather than failed and so hides the breakage.
30+
timeout-minutes: 330
2031
env:
2132
TECHAPI_WRITE_TOKEN: ${{ secrets.TECHENGINEBOT_TOKEN || secrets.TECHAPI_TOKEN }}
2233
# seed/validate/dump read the data tree from here.

.github/workflows/weekly-refresh.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ jobs:
7373
run_enrich() {
7474
comp="$1"; src="$2"
7575
echo "::group::enrich ${comp}/${src}"
76-
if python -m app.ingest.enrich \
76+
# Cap each source: the budget below is only consulted between
77+
# sources, so without this one slow source overruns it — the last
78+
# run spent 260 minutes against a 200-minute budget that way.
79+
if timeout "${PER_SOURCE_S}s" python -m app.ingest.enrich \
7780
--source "$src" --component "$comp" \
7881
--data-root ./techapi/data --sleep "$SLEEP" \
7982
--summary "enrich-${comp}-${src}.md"; then
@@ -88,7 +91,8 @@ jobs:
8891
# broken while validate, the static dump and the refresh PR were being
8992
# skipped every week. Give collection a budget it cannot exceed and
9093
# leave the remainder to the rest of the pipeline.
91-
BUDGET_S=$(( 200 * 60 ))
94+
BUDGET_S=$(( 150 * 60 ))
95+
PER_SOURCE_S=$(( 40 * 60 ))
9296
DEADLINE=$(( $(date +%s) + BUDGET_S ))
9397
budget_left() {
9498
if [ "$(date +%s)" -ge "$DEADLINE" ]; then

0 commit comments

Comments
 (0)