Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dump-refresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions app/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]]:
Expand Down
Loading