Skip to content

Commit 1ca6a05

Browse files
author
Michael Johns
committed
ci(package-geobrix-artifacts): fail-fast preflights for LFS + lockfile
Two operator-facing preflight steps that surface actionable errors instead of opaque failures, motivated by the two failed runs of this workflow against v0.3.0: 1. LFS preflight. actions/checkout@v6 with `lfs: true` errors out with a bare `Object does not exist on the server: [404]` when an LFS pointer is committed but the bytes were never uploaded to GitHub LFS storage. Split the LFS handling out of actions/checkout (now `lfs: false`) and run `git lfs pull` in a follow-up step that prints the exact `git lfs push origin <branch-or-tag> --all` recovery command on failure. Common when a repo is the first to use LFS at the org level and storage hasn't been primed. 2. Lockfile preflight. The hash-pinned wheel-build step `pip install --require-hashes -r python/geobrix/requirements-build.txt` previously errored with pip's generic `Could not open requirements file` when the lockfile was missing. New step checks for the file up front and prints the `uv pip compile --generate-hashes` command to regenerate it. Co-authored-by: Isaac
1 parent 96b12dd commit 1ca6a05

1 file changed

Lines changed: 59 additions & 3 deletions

File tree

.github/workflows/package-geobrix-artifacts.yml

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,44 @@ jobs:
7070
gdal: [ 3.11.4 ]
7171
spark: [ 4.0.0 ]
7272
steps:
73-
- name: checkout code (with LFS)
73+
# actions/checkout's lfs: true is hard to debug — when an LFS object
74+
# exists as a pointer in git but the bytes were never uploaded to
75+
# GitHub LFS storage, the action errors out with a bare
76+
# `Object does not exist on the server: [404]` and no actionable
77+
# next step. Check out without LFS first so we can run our own
78+
# `git lfs pull` with a clear error message that names the fix.
79+
- name: checkout code (no LFS yet)
7480
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7581
with:
7682
ref: ${{ inputs.ref || github.ref }}
7783
token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
78-
lfs: true
84+
lfs: false
85+
86+
- name: pull LFS objects (with actionable error on 404)
87+
shell: bash
88+
run: |
89+
if git lfs pull 2>&1; then
90+
echo "==> Git LFS objects pulled successfully."
91+
else
92+
echo
93+
echo "============================================================"
94+
echo "Git LFS pull FAILED."
95+
echo
96+
echo "Most common cause: an LFS pointer is committed but the"
97+
echo "actual bytes were never uploaded to GitHub LFS storage."
98+
echo "This can happen if 'git push' on the branch in question"
99+
echo "did not also push LFS objects (the regular git pack"
100+
echo "transfer succeeds while the LFS transfer silently no-ops"
101+
echo "or is rejected — e.g., the first time a repo uses LFS"
102+
echo "and org-level storage hasn't been provisioned yet)."
103+
echo
104+
echo "Fix: on a workstation that has the file:"
105+
echo " git lfs push origin <branch-or-tag> --all"
106+
echo
107+
echo "Then re-trigger this workflow."
108+
echo "============================================================"
109+
exit 1
110+
fi
79111
80112
- name: verify platform tarball is LFS-pulled
81113
shell: bash
@@ -86,11 +118,35 @@ jobs:
86118
exit 1
87119
fi
88120
if head -c 50 "$PLATFORM" | grep -q '^version https://git-lfs'; then
89-
echo "$PLATFORM is an LFS pointer, not the binary - checkout's lfs: true didn't resolve it." >&2
121+
echo "$PLATFORM is still an LFS pointer after `git lfs pull` — see the previous step's diagnostic." >&2
90122
exit 1
91123
fi
92124
( cd resources/static && sha256sum -c geobrix-gdal-platform-noble.tar.gz.sha256 )
93125
126+
- name: verify python/geobrix/requirements-build.txt is committed
127+
shell: bash
128+
run: |
129+
if [ ! -f python/geobrix/requirements-build.txt ]; then
130+
echo
131+
echo "============================================================"
132+
echo "python/geobrix/requirements-build.txt is missing."
133+
echo
134+
echo "It's the hash-pinned lockfile this workflow installs from"
135+
echo "via 'pip install --require-hashes'. It's generated from"
136+
echo "python/geobrix/requirements-build.in and must be committed"
137+
echo "alongside it on the branch being released."
138+
echo
139+
echo "Regenerate with:"
140+
echo " cd python/geobrix"
141+
echo " uv pip compile --generate-hashes --python-version 3.12 \\"
142+
echo " --output-file requirements-build.txt requirements-build.in"
143+
echo
144+
echo "Then commit to the branch being released and re-trigger"
145+
echo "this workflow."
146+
echo "============================================================"
147+
exit 1
148+
fi
149+
94150
- name: Configure JDK
95151
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
96152
with:

0 commit comments

Comments
 (0)