diff --git a/scripts/dossiers-ngi/README.md b/scripts/dossiers-ngi/README.md index d4f2efa..a288176 100644 --- a/scripts/dossiers-ngi/README.md +++ b/scripts/dossiers-ngi/README.md @@ -63,7 +63,7 @@ Per branch in JSON / sticky bar: | `vs_parent_plus` / `vs_parent_minus` | `git diff --numstat` tip vs **parent** tip (sticky bar +grün/−rot; omitted when `parent` is empty or not in the tree, e.g. `main` and `feature/nl-net-injestion-injestor-update`) | | `loc` | text-file line count of the tip vs the empty tree (gray `N LOC` in the plus/minus columns; only when there is no parent) | -Rebuild runs **only when** the current origin tip is not already a successful freeze (`freeze_ok`; timer never forces). Cookie alias `editions/flask` copies from `DEFAULT_BRANCH` unless that alias is already `freeze_ok` for the same tip **and** `.edition-built-at` matches the source freeze. +Rebuild runs **only when** the current origin tip is not already a successful freeze (`freeze_ok`; timer never forces). Each run also: `git fetch --prune`, `worktree prune`, drop stale `editions//` (gone remotes), purge leftover `tdpd-*` tmp dirs. diff --git a/scripts/dossiers-ngi/branch-status-hourly.py b/scripts/dossiers-ngi/branch-status-hourly.py index 8cf6433..7b32e78 100755 --- a/scripts/dossiers-ngi/branch-status-hourly.py +++ b/scripts/dossiers-ngi/branch-status-hourly.py @@ -534,26 +534,15 @@ def rebuild_edition(repo: Path, branch: str, tip: str, editions: Path) -> dict: shutil.rmtree(wt, ignore_errors=True) -def _edition_built_at(editions: Path, slug: str) -> str: - p = editions / slug / ".edition-built-at" - if not p.is_file(): - return "" - return p.read_text(encoding="utf-8").strip() - - def sync_flask_alias(editions: Path, tips: dict[str, str]) -> None: """Keep editions/flask in sync with DEFAULT_BRANCH freeze when present.""" src_branch = default_branch() if src_branch not in tips: return - src_slug = edition_slug(src_branch) - src = editions / src_slug + src = editions / edition_slug(src_branch) dst = editions / "flask" tip = tips[src_branch] - flask_ok, _ = freeze_ok_for(editions, "flask", tip) - src_built = _edition_built_at(editions, src_slug) - flask_built = _edition_built_at(editions, "flask") - if flask_ok and src_built and src_built == flask_built: + if tip_recorded(editions, "flask") == tip and (dst / "index.html").is_file(): return if not (src / "index.html").is_file(): ensure_placeholder(editions, "flask", tip) diff --git a/scripts/dossiers-ngi/smoke-branch-tree.sh b/scripts/dossiers-ngi/smoke-branch-tree.sh index e180854..7703693 100755 --- a/scripts/dossiers-ngi/smoke-branch-tree.sh +++ b/scripts/dossiers-ngi/smoke-branch-tree.sh @@ -100,24 +100,6 @@ PY printf '1\n' > "$EDITIONS/feat-a/.edition-freeze-ok" rm -f "$EDITIONS/feat-a/.edition-freeze-error" -# flask alias: matching tip + stale HTML must copy from DEFAULT_BRANCH -MAIN_TIP="$(tr -d '\n' < "$EDITIONS/main/.edition-tip")" -mkdir -p "$EDITIONS/flask" -printf '%s\n' "$MAIN_TIP" > "$EDITIONS/flask/.edition-tip" -printf '%s\n' 'stale-flask' > "$EDITIONS/flask/index.html" -printf '%s\n' '2026-09-30T17:35:26+02:00' > "$EDITIONS/flask/.edition-built-at" -FETCH=0 TDPD_ROOT="$CLONE" OUT="$OUT" EDITIONS_ROOT="$EDITIONS" \ - FREEZE_CMD="$FREEZE_CMD" REBUILD=1 DEFAULT_BRANCH=main \ - python3 "$SCRIPT" --rebuild --no-fetch -grep -q "main" "$EDITIONS/flask/index.html" -if grep -q "stale-flask" "$EDITIONS/flask/index.html"; then - echo "FAIL flask alias kept stale HTML" - exit 1 -fi -test "$(tr -d '\n' < "$EDITIONS/flask/.edition-freeze-ok")" = "1" -test "$(tr -d '\n' < "$EDITIONS/flask/.edition-built-at")" = "$(tr -d '\n' < "$EDITIONS/main/.edition-built-at")" -echo "OK flask alias copied after stale skip" - # delete smoke branch on origin; fetch --prune drops remote-tracking ref cd "$CLONE" git push origin --delete smoke/temp-sibling >/dev/null 2>&1