Skip to content

Commit 93a2af1

Browse files
committed
fix(ci): stop reporting healthy dump runs as failed
refresh-data: upload-artifact crashed with "Maximum call stack size exceeded" on the ~1M-file dump; it now uploads one tar.gz. dump-refresh: create-pull-request could fail with GitHub's "diff is taking too long to generate" after the PR already existed (TechAPI #180). That step now continues, and a follow-up fails the job only when no open PR exists for the branch. Refs #1
1 parent 4bd1adc commit 93a2af1

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

.github/workflows/dump-refresh.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ jobs:
8585
if-no-files-found: ignore
8686

8787
- name: Create dump-refresh PR
88+
id: cpr
8889
if: env.TECHAPI_WRITE_TOKEN != ''
90+
# A dump PR touches so many pages that GitHub may answer "diff is taking
91+
# too long to generate" after the PR exists; the next step decides.
92+
continue-on-error: true
8993
uses: peter-evans/create-pull-request@v6
9094
with:
9195
path: ./techapi
@@ -101,3 +105,16 @@ jobs:
101105
committer: TechEngineBot <289859915+TechEngineBot@users.noreply.github.com>
102106
author: TechEngineBot <289859915+TechEngineBot@users.noreply.github.com>
103107
delete-branch: true
108+
109+
- name: Confirm dump-refresh PR exists
110+
if: steps.cpr.outcome == 'failure'
111+
env:
112+
GH_TOKEN: ${{ env.TECHAPI_WRITE_TOKEN }}
113+
BRANCH: dump-refresh/${{ steps.meta.outputs.date }}
114+
run: |
115+
n=$(gh api "repos/GetTechAPI/TechAPI/pulls?head=GetTechAPI:${BRANCH}&state=open" -q '.[0].number')
116+
if [ -z "$n" ]; then
117+
echo "::error::create-pull-request failed and no open PR exists for ${BRANCH}"
118+
exit 1
119+
fi
120+
echo "::warning::PR #${n} exists; the failure was GitHub's diff timeout on a large PR"

.github/workflows/refresh-data.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,16 @@ jobs:
4343
TECHAPI_DATA_DIR: ${{ github.workspace }}/TechAPI/data
4444
run: python -m app.dump
4545

46+
# ~1M small files crash upload-artifact ("Maximum call stack size
47+
# exceeded"); ship the dump as one archive instead.
48+
- name: Pack static dump
49+
run: tar -czf techapi-static-dump.tgz dump
50+
4651
- name: Upload static dump artifact
4752
uses: actions/upload-artifact@v4
4853
with:
4954
name: techapi-static-dump
50-
path: dump/
55+
path: techapi-static-dump.tgz
5156

5257
# To serve a public static API, enable Pages and swap the step above for:
5358
# - uses: actions/upload-pages-artifact@v3

0 commit comments

Comments
 (0)