fix(release): recreate refs/remotes dropped by git on the Flatpak remote publish (#966)

* fix(release): recreate refs/remotes dropped by git on the Flatpak remote publish

The first real remote publish (v0.18.3) failed at
'flatpak build-update-repo --generate-static-deltas' with
'opendir(refs/remotes): No such file or directory'. ostree init creates
refs/remotes empty, git does not track empty dirs, and the site/repo
checked back out of gh-pages therefore lacks it — while delta generation
opens that dir unconditionally. mkdir -p it (and refs/mirrors) after the
copy. Also name the Snap Store review-queue blockage in its publish
error, so the fix (reject the stale upload on the dashboard, re-run)
surfaces on the job page.

* test(release): pin the refs/remotes mkdir before build-update-repo

---------

Co-authored-by: Jatin K Malik <jatinkrmalik@gmail.com>
This commit is contained in:
devin-ai-integration[bot]
2026-10-16 21:00:26 -07:00
committed by GitHub
co-authored by Jatin K Malik
parent 2da20f791a
commit 4799f06bd2
2 changed files with 23 additions and 0 deletions
+9
View File
@@ -684,6 +684,11 @@ jobs:
mkdir -p "$repo"
ostree --repo="$repo" init --mode=archive-z2
fi
# git drops empty directories: a checked-out site/repo lacks
# refs/remotes and refs/mirrors, and `build-update-repo
# --generate-static-deltas` aborts with
# "opendir(refs/remotes): No such file or directory" without them.
mkdir -p "$repo/refs/remotes" "$repo/refs/mirrors"
ls -la dist/*.flatpak
for bundle in dist/*.flatpak; do
flatpak build-import-bundle \
@@ -1092,6 +1097,10 @@ jobs:
echo "::warning::Snap Store queued a human review (allow-installation). The .snap is on the GitHub Release."
exit 0
fi
if grep -F -q "Waiting for previous upload(s)" "$log"; then
echo "::error::Snap Store publish failed: an older upload is still in the review queue. Reject and remove it at https://dashboard.snapcraft.io/ (the upload page lists it), then re-run this job."
exit "$status"
fi
echo "::error::Snap Store publish failed (exit $status) for a reason other than allow-installation review."
exit "$status"
+14
View File
@@ -292,3 +292,17 @@ def test_the_remote_publish_is_stable_gated_and_keeps_history():
"continue-on-error" not in block
), "a tolerated checkout failure falls through to the empty-repo path"
assert ".flatpakref" in block, "no app ref is written for one-command installs"
def test_the_remote_publish_recreates_dirs_git_drops() -> None:
"""git does not track empty directories, so a site/repo checked out from
gh-pages comes back without refs/remotes or refs/mirrors — and
`flatpak build-update-repo --generate-static-deltas` aborts on
`opendir(refs/remotes): No such file or directory` when it enumerates refs
for deltas. v0.18.3 hit exactly this on the first real remote publish."""
block = _jobs()["publish-flatpak-remote"]
mkdir = 'mkdir -p "$repo/refs/remotes" "$repo/refs/mirrors"'
assert mkdir in block, "the copied-back repo must re-create the ref dirs git dropped"
assert block.index(mkdir) < block.index(
"flatpak build-update-repo"
), "the dirs must exist before build-update-repo enumerates refs"