From ca8e3a62079197ec1b7bda8fba74041c1633fcdc Mon Sep 17 00:00:00 2001 From: Seungpyo1007 Date: Tue, 15 Sep 2026 09:55:19 +0900 Subject: [PATCH] fix(dump): skip unchanged pages and open the refresh PR on develop The 2026-09-11 dump-refresh finished generating after 5h02m, then was cancelled at the job timeout while create-pull-request staged the tree: every one of the ~1M pages had been rewritten, so git rehashed them all. Identical pages are now left untouched. The PR also targeted main, which only moves through release PRs. Refs #1 --- .github/workflows/dump-refresh.yml | 4 ++-- app/dump.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dump-refresh.yml b/.github/workflows/dump-refresh.yml index edc2a9d..a35019a 100644 --- a/.github/workflows/dump-refresh.yml +++ b/.github/workflows/dump-refresh.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-latest # Well under GitHub's 6h ceiling, which reports an over-run as # "cancelled" rather than failed and so hides the breakage. - timeout-minutes: 330 + timeout-minutes: 355 env: TECHAPI_WRITE_TOKEN: ${{ secrets.TECHENGINEBOT_TOKEN || secrets.TECHAPI_TOKEN }} # seed/validate/dump read the data tree from here. @@ -91,7 +91,7 @@ jobs: path: ./techapi token: ${{ env.TECHAPI_WRITE_TOKEN }} branch: dump-refresh/${{ steps.meta.outputs.date }} - base: main + base: develop add-paths: | site/public/v1 site/public/openapi.json diff --git a/app/dump.py b/app/dump.py index 01445c8..c20761c 100644 --- a/app/dump.py +++ b/app/dump.py @@ -57,8 +57,15 @@ def resolve_collections(exclude: list[str] | None = None) -> list[str]: def _write_json(path: Path, data: object) -> None: - path.parent.mkdir(parents=True, exist_ok=True) - path.write_text(json.dumps(data, indent=2, ensure_ascii=False) + "\n", encoding="utf-8") + text = json.dumps(data, indent=2, ensure_ascii=False) + "\n" + # Leave identical pages untouched: rewriting ~1M unchanged files resets + # their mtimes, and git then rehashes the whole tree when committing. + try: + if path.read_text(encoding="utf-8") == text: + return + except FileNotFoundError: + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(text, encoding="utf-8") def _fetch_all(client: TestClient, resource: str) -> tuple[int, list[dict[str, Any]]]: