Fail desktop installer uploads when no files match path#477
Conversation
Mirrors the existing if-no-files-found: error guard from the AppImage and Arch upload steps onto the Windows, macOS, and Linux deb/rpm uploads, so an empty gradle output now fails the matrix entry instead of silently warn-and-succeeding into an empty artifact that makes the release job's completeness guard fire much later.
upload-artifact@v4 strips the longest common path prefix from matched files. For uploads spanning two sibling directories (Windows exe/msi, macOS dmg/pkg, Linux deb/rpm) the per-extension subdirectory survives inside the artifact, so files land under artifacts/windows-installers/ exe/<file>.exe rather than artifacts/windows-installers/<file>.exe. The previous shallow glob missed those nested files entirely and the completeness guard fired on every run despite all builds succeeding. Switching to find makes staging robust regardless of the artifact's internal layout. Also prints the downloaded artifact tree once at the top of the step so future layout drift is diagnosable from the run log.
WalkthroughThe GitHub Actions workflow for building desktop platforms is enhanced with stricter artifact upload validation, adding diagnostic visibility into artifact directory contents, and refactoring artifact discovery from shallow wildcard globs to Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/build-desktop-platforms.yml (1)
485-553: ⚡ Quick winTighten completeness checks by file type, not just per group.
The current guard only requires one file per group, so a partial failure (for example,
.exewithout.msi) can still publish an incomplete release.Suggested direction
- windows_count=0 + windows_exe_count=0 + windows_msi_count=0 ... - while IFS= read -r f; do + while IFS= read -r f; do [ -n "$f" ] || continue - stage "$f" "$(basename "$f")" && windows_count=$((windows_count + 1)) || true + if stage "$f" "$(basename "$f")"; then + case "$f" in + *.exe) windows_exe_count=$((windows_exe_count + 1)) ;; + *.msi) windows_msi_count=$((windows_msi_count + 1)) ;; + esac + fi done < <(find artifacts/windows-installers -type f \( -name '*.exe' -o -name '*.msi' \) 2>/dev/null) ... - [ "$windows_count" -eq 0 ] && missing+=("Windows installers (.exe/.msi)") + [ "$windows_exe_count" -eq 0 ] && missing+=("Windows EXE (.exe)") + [ "$windows_msi_count" -eq 0 ] && missing+=("Windows MSI (.msi)")Apply the same pattern for macOS (
.dmg+.pkg) and Linux installer groups (.deb+.rpm).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/build-desktop-platforms.yml around lines 485 - 553, The completeness check currently only verifies per-group counters (windows_count, macos_x64_count, macos_arm64_count, linux_modern_count, linux_debian12_count, linux_appimage_count, linux_arch_count), which allows missing file types inside a group (e.g. .exe missing .msi); fix by tracking counts per file extension in the existing staging loops (e.g. windows_exe_count and windows_msi_count; macos_x64_dmg_count and macos_x64_pkg_count; macos_arm64_dmg_count and macos_arm64_pkg_count; linux_modern_deb_count and linux_modern_rpm_count; linux_debian12_deb_count and linux_debian12_rpm_count) by incrementing the correct counter alongside stage(), and replace the current missing checks to assert each required extension counter > 0 (adding entries to missing[] if any required extension counter is zero) while keeping the existing group counters/logging for overall totals.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/build-desktop-platforms.yml:
- Around line 485-553: The completeness check currently only verifies per-group
counters (windows_count, macos_x64_count, macos_arm64_count, linux_modern_count,
linux_debian12_count, linux_appimage_count, linux_arch_count), which allows
missing file types inside a group (e.g. .exe missing .msi); fix by tracking
counts per file extension in the existing staging loops (e.g. windows_exe_count
and windows_msi_count; macos_x64_dmg_count and macos_x64_pkg_count;
macos_arm64_dmg_count and macos_arm64_pkg_count; linux_modern_deb_count and
linux_modern_rpm_count; linux_debian12_deb_count and linux_debian12_rpm_count)
by incrementing the correct counter alongside stage(), and replace the current
missing checks to assert each required extension counter > 0 (adding entries to
missing[] if any required extension counter is zero) while keeping the existing
group counters/logging for overall totals.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 1b42faa2-02bb-4ec5-9ed3-bb989efd0ada
📒 Files selected for processing (1)
.github/workflows/build-desktop-platforms.yml
Mirrors the existing if-no-files-found: error guard from the AppImage
and Arch upload steps onto the Windows, macOS, and Linux deb/rpm
uploads, so an empty gradle output now fails the matrix entry instead
of silently warn-and-succeeding into an empty artifact that makes the
release job's completeness guard fire much later.
Summary by CodeRabbit
Bug Fixes
Chores