Skip to content

Fail desktop installer uploads when no files match path#477

Merged
rainxchzed merged 2 commits intomainfrom
generate-installers
May 1, 2026
Merged

Fail desktop installer uploads when no files match path#477
rainxchzed merged 2 commits intomainfrom
generate-installers

Conversation

@rainxchzed
Copy link
Copy Markdown
Member

@rainxchzed rainxchzed commented May 1, 2026

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

    • Strengthened installer build validation to immediately fail when expected output files are missing, improving error detection.
  • Chores

    • Enhanced build diagnostics with improved file discovery and visibility into artifact staging, making troubleshooting more efficient.

rainxchzed added 2 commits May 1, 2026 06:45
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.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 1, 2026

Walkthrough

The 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 find-driven iteration for improved resilience to directory structure changes.

Changes

Cohort / File(s) Summary
Workflow Artifact Handling
.github/workflows/build-desktop-platforms.yml
Enhanced artifact upload steps with if-no-files-found: error to fail workflows on missing files; added diagnostic tree dump of artifacts/ directory during release staging; replaced wildcard glob loops with find command iteration for platform-specific artifact discovery while preserving existing naming conventions (macOS x64/arm64 disambiguation, debian12 suffixing).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Artifacts now fail with clarity and grace,
Find commands guide us through directory space,
No missing files shall slip through our care,
With diagnostic logs, the path is laid bare!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately reflects the main change: adding error guards to fail desktop installer uploads when no files match the configured paths, which is the primary objective of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch generate-installers

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.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/build-desktop-platforms.yml (1)

485-553: ⚡ Quick win

Tighten completeness checks by file type, not just per group.

The current guard only requires one file per group, so a partial failure (for example, .exe without .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

📥 Commits

Reviewing files that changed from the base of the PR and between df630a0 and caddb40.

📒 Files selected for processing (1)
  • .github/workflows/build-desktop-platforms.yml

@rainxchzed rainxchzed merged commit d12a5a6 into main May 1, 2026
7 checks passed
@rainxchzed rainxchzed deleted the generate-installers branch May 1, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant