refactor: one list of files the pipeline rewrites

diskcleanup kept its own regex of generated paths and missed derivable.json, retired.json and wiki/installer.md, so a worktree holding only a pipeline run's output was kept as uncommitted code. core.generated holds the globs, the cleanup and the nightly's commit rules match with them, and a test ties the regenerate rule to the list. The rule gains install/standalone/*.json and wiki/reading-reports.md, which the pipeline writes and no rule committed.
This commit is contained in:
Abdessamad Derraz committed 2026-11-23 23:07:45 +01:00
1 parent 2a3b55432b
commit f379df5e1e
6 files changed
+82 -28

No files matched your search

+2 -6
View File
@@ -4,19 +4,15 @@ from __future__ import annotations
import contextlib
import os
import re
import shutil
import subprocess
from collections.abc import Iterable
from dataclasses import dataclass
from pathlib import Path
from core.generated import is_generated
from core.paths import AUTORUN_WORKTREE
GENERATED = re.compile(
r"^(database\.json|install/.*\.json|exports/.*\.json|README\.md|CONTRIBUTING\.md"
r"|website/src/data/[^/]+\.json)$"
)
KEPT_TMP = ("acquire",)
ALERT_GB = 100
@@ -80,7 +76,7 @@ def real_changes(worktree: Path) -> list[str]:
if len(line) < 4 or line[:2].strip() == "D":
continue
path = line[3:].split(" -> ")[-1].strip('"')
if not GENERATED.match(path):
if not is_generated(path):
paths.append(path)
return paths