Skip to content

fix(ci): merge macOS auto-update manifests for multi-arch releases#2300

Merged
Kitenite merged 10 commits into
mainfrom
kitenite/wistful-print
Mar 10, 2026
Merged

fix(ci): merge macOS auto-update manifests for multi-arch releases#2300
Kitenite merged 10 commits into
mainfrom
kitenite/wistful-print

Conversation

@Kitenite
Copy link
Copy Markdown
Collaborator

@Kitenite Kitenite commented Mar 9, 2026

Summary

  • Fix release workflow crash when x64 macOS DMG omits arch suffix (Superset-1.1.4.dmgcp same-file error)
  • Merge arm64 + x64 latest-mac.yml manifests so auto-update works for both architectures (previously merge-multiple: true caused one to overwrite the other)
  • Revert version bump to 1.1.3 (will re-bump after workflow fix lands)

Details

electron-builder omits the arch suffix for x64 macOS builds (the historical "default" arch). The stable-copy script extracted the version number as the arch, producing cp 'Superset-1.1.4.dmg' 'Superset-1.1.4.dmg'.

For auto-update, each arch build generates its own latest-mac.yml. With merge-multiple: true, one overwrites the other nondeterministically. Now we download each manifest separately and merge with yq, using arm64 as the canonical base (path/sha512).

Test plan

  • Trigger canary release from this branch to validate the workflow
  • Verify latest-mac.yml contains entries for both arm64 and x64
  • Verify stable-named copies are created correctly (Superset-arm64.dmg, Superset-x64.dmg)

Summary by CodeRabbit

  • Chores
    • Consolidates macOS update manifests via a new merge step that combines arm64/x64 manifests into a single stable mac manifest.
    • Canary and stable release workflows now invoke the consolidated mac manifest step instead of ad-hoc mac manifest copying.
    • Installer artifact naming detects architecture for dmg, mac.zip, and AppImage files, defaulting to x64 when unspecified.
    • AppImage artifacts are copied to stable names alongside dmg and mac.zip handling.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 9, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a composite GitHub Action to download and merge arm64/x64 macOS update manifests, updates stable and canary release workflows to invoke it, improves arch extraction for dmg/mac.zip/AppImage artifacts, and centralizes mac manifest stabilization under the new action.

Changes

Cohort / File(s) Summary
Stable release workflow
​.github/workflows/release-desktop.yml
Adds "Merge macOS auto-update manifests" step invoking the new action; defaults missing dmg/mac.zip archs to x64; adds AppImage stable-copy behavior; removes prior ad-hoc mac.yml copy logic; preserves Linux latest-linux.yml handling.
Canary release workflow
​.github/workflows/release-desktop-canary.yml
Replaces inline mac manifest consolidation with the new merge action (artifact-prefix: desktop-canary, extra-manifest-names: canary-mac.yml); removes previous loop creating canary-mac.yml/latest-mac.yml; Linux manifest logic unchanged.
New composite action
​.github/actions/merge-mac-manifests/action.yml
New composite action that downloads arm64/x64 mac updater manifest artifacts, locates per-arch *-mac.yml, merges files arrays with arm64 as base when both exist, writes artifacts-path/latest-mac.yml, and optionally writes additional manifest copies from extra-manifest-names.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow as Release Workflow
    participant Action as merge-mac-manifests Action
    participant Artifacts as Artifact Storage

    Workflow->>Action: invoke (artifact-prefix, artifacts-path, extra-manifest-names)
    Action->>Artifacts: download <prefix>-mac-arm64-update-manifest
    Action->>Artifacts: download <prefix>-mac-x64-update-manifest
    Action->>Action: locate arm64 and x64 *-mac.yml
    alt both manifests exist
        Action->>Action: merge (arm64 base + x64 files)
    else only one exists
        Action->>Action: copy sole manifest as latest-mac.yml
    end
    Action->>Artifacts: write artifacts-path/latest-mac.yml
    alt extra-manifest-names provided
        Action->>Artifacts: copy latest-mac.yml -> artifacts-path/<extra-names>
    end
    Action->>Workflow: output final latest-mac.yml content
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped through manifests, two arches in sight,
I stitched them together by soft moonlight,
If one stood alone, I copied with care,
AppImages labeled, stable names to share,
Release paths tidy — nibble, bound, delight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description covers key sections but lacks alignment with the template structure; it includes Summary, Details, and Test plan, but omits Related Issues and Type of Change sections from the template. Add Related Issues section with relevant issue links and select appropriate Type of Change checkbox (likely 'Bug fix') to match the repository template.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing macOS auto-update manifest merging for multi-arch releases, which is the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch kitenite/wistful-print

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

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

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

The x64 macOS build omits the arch suffix from filenames (e.g.,
Superset-1.1.4.dmg instead of Superset-1.1.4-x64.dmg), which caused
the stable-copy script to cp a file onto itself, crashing the release.

Additionally, both arch builds produce their own latest-mac.yml but
merge-multiple: true caused one to overwrite the other, breaking
auto-update for whichever arch lost.

Changes:
- Download each arch's manifest separately and merge them with yq,
  using arm64 as the canonical base
- Detect version-number-as-arch in stable copy naming, default to x64
- Remove redundant mac manifest copy step (merge handles it)
- Revert desktop version bump (release will be re-triggered after fix)
@Kitenite Kitenite changed the title chore(desktop): bump version to 1.1.4 fix(ci): merge macOS auto-update manifests for multi-arch releases Mar 9, 2026
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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release-desktop.yml:
- Around line 73-96: The script assumes one of ARM64 or X64 manifests exists but
doesn’t handle the case when neither does; add a guard after the existing
if/elif chain (or before the final cat "$OUTPUT") that checks whether "$OUTPUT"
exists (or that at least one of "$ARM64" or "$X64" exists), and if not echo a
clear error message (include the variable names ARM64 and X64 in the message)
and exit with a non‑zero status so the workflow fails fast instead of hitting
cat "$OUTPUT" with a confusing error.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f68e0a68-6dbf-4cb0-8d16-b86937314bb7

📥 Commits

Reviewing files that changed from the base of the PR and between 5bced89 and 3f33a10.

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

Comment on lines +73 to +96
- name: Merge macOS auto-update manifests
run: |
ARM64="manifests/arm64/latest-mac.yml"
X64="manifests/x64/latest-mac.yml"
OUTPUT="release-artifacts/latest-mac.yml"

if [[ -f "$ARM64" && -f "$X64" ]]; then
# Merge both arch manifests — arm64 is canonical (base path/sha512)
yq eval-all '
select(fileIndex == 0) *
{"files": [select(fileIndex == 0).files[], select(fileIndex == 1).files[]]}
' "$ARM64" "$X64" > "$OUTPUT"
echo "Merged arm64 + x64 manifests into latest-mac.yml"
elif [[ -f "$ARM64" ]]; then
cp "$ARM64" "$OUTPUT"
echo "Using arm64-only manifest"
elif [[ -f "$X64" ]]; then
cp "$X64" "$OUTPUT"
echo "Using x64-only manifest"
fi

echo "Final latest-mac.yml:"
cat "$OUTPUT"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add error handling when neither manifest exists.

If both download steps fail (or with continue-on-error: true), neither manifest file will exist. The script silently proceeds and then fails at cat "$OUTPUT" with a confusing error.

Suggested change
           elif [[ -f "$X64" ]]; then
             cp "$X64" "$OUTPUT"
             echo "Using x64-only manifest"
+          else
+            echo "::error::No macOS update manifest found for either architecture"
+            exit 1
           fi

           echo "Final latest-mac.yml:"
           cat "$OUTPUT"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Merge macOS auto-update manifests
run: |
ARM64="manifests/arm64/latest-mac.yml"
X64="manifests/x64/latest-mac.yml"
OUTPUT="release-artifacts/latest-mac.yml"
if [[ -f "$ARM64" && -f "$X64" ]]; then
# Merge both arch manifests — arm64 is canonical (base path/sha512)
yq eval-all '
select(fileIndex == 0) *
{"files": [select(fileIndex == 0).files[], select(fileIndex == 1).files[]]}
' "$ARM64" "$X64" > "$OUTPUT"
echo "Merged arm64 + x64 manifests into latest-mac.yml"
elif [[ -f "$ARM64" ]]; then
cp "$ARM64" "$OUTPUT"
echo "Using arm64-only manifest"
elif [[ -f "$X64" ]]; then
cp "$X64" "$OUTPUT"
echo "Using x64-only manifest"
fi
echo "Final latest-mac.yml:"
cat "$OUTPUT"
- name: Merge macOS auto-update manifests
run: |
ARM64="manifests/arm64/latest-mac.yml"
X64="manifests/x64/latest-mac.yml"
OUTPUT="release-artifacts/latest-mac.yml"
if [[ -f "$ARM64" && -f "$X64" ]]; then
# Merge both arch manifests — arm64 is canonical (base path/sha512)
yq eval-all '
select(fileIndex == 0) *
{"files": [select(fileIndex == 0).files[], select(fileIndex == 1).files[]]}
' "$ARM64" "$X64" > "$OUTPUT"
echo "Merged arm64 + x64 manifests into latest-mac.yml"
elif [[ -f "$ARM64" ]]; then
cp "$ARM64" "$OUTPUT"
echo "Using arm64-only manifest"
elif [[ -f "$X64" ]]; then
cp "$X64" "$OUTPUT"
echo "Using x64-only manifest"
else
echo "::error::No macOS update manifest found for either architecture"
exit 1
fi
echo "Final latest-mac.yml:"
cat "$OUTPUT"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release-desktop.yml around lines 73 - 96, The script
assumes one of ARM64 or X64 manifests exists but doesn’t handle the case when
neither does; add a guard after the existing if/elif chain (or before the final
cat "$OUTPUT") that checks whether "$OUTPUT" exists (or that at least one of
"$ARM64" or "$X64" exists), and if not echo a clear error message (include the
variable names ARM64 and X64 in the message) and exit with a non‑zero status so
the workflow fails fast instead of hitting cat "$OUTPUT" with a confusing error.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 9, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch
  • ✅ Electric Fly.io app

Thank you for your contribution! 🎉

Same manifest merge fix as the stable workflow — download each arch's
manifest separately and merge with yq so canary auto-update works for
both arm64 and x64. Also removes the mac manifest copy step since the
merge step now produces both canary-mac.yml and latest-mac.yml.
Both stable and canary release workflows now use the same
.github/actions/merge-mac-manifests composite action instead of
duplicating the download + yq merge logic inline.
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/actions/merge-mac-manifests/merge-mac-manifests.mjs">

<violation number="1" location=".github/actions/merge-mac-manifests/merge-mac-manifests.mjs:205">
P1: Dynamically serialize all `files` properties to avoid dropping critical update metadata.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

for (const [key, value] of Object.entries(manifest)) {
if (key === "files") {
lines.push("files:");
for (const file of value) {
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot Mar 9, 2026

Choose a reason for hiding this comment

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

P1: Dynamically serialize all files properties to avoid dropping critical update metadata.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/actions/merge-mac-manifests/merge-mac-manifests.mjs, line 205:

<comment>Dynamically serialize all `files` properties to avoid dropping critical update metadata.</comment>

<file context>
@@ -0,0 +1,274 @@
+  for (const [key, value] of Object.entries(manifest)) {
+    if (key === "files") {
+      lines.push("files:");
+      for (const file of value) {
+        lines.push(`  - url: ${yamlQuote(file.url)}`);
+        lines.push(`    sha512: ${yamlQuote(file.sha512)}`);
</file context>
Fix with Cubic

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