Skip to content

Drop a returned [asahi-alarm] even after its key is gone - #223

Merged
maralcbr merged 1 commit into
mainfrom
fix-219-drop-retry
Nov 30, 2026
Merged

maralcbr merged 1 commit into
mainfrom
fix-219-drop-retry

Conversation

@maralcbr

Copy link
Copy Markdown
Member

Summary

Fixes omarchy-mac-pkgs#219. Once the helper has deleted the asahi-alarm key, an older template that writes [asahi-alarm] back makes pacman refuse every sync query. The import guards then never passed, the helper stayed pending, and pacman stayed unusable. Reported from the field by NeoCode914 on an M2 Air (comment).

 if [asahi-alarm] is configured
-  inventory = pacman -Slq asahi-alarm            # empty if the DB is untrusted
+  if pacman -Slq asahi-alarm succeeds
+    inventory = that list
-  for each installed import
-    pacman -Si omarchy/<import> || pending       # always fails without the key
+  if key 12CE6799… is still in pacman's keyring
+    for each installed import
+      pacman -Si omarchy/<import> || pending
   keyring still required / listed → pending      # unchanged
   drop the section, remove keyring, delete key   # unchanged

Without its key the repository delivers nothing, so waiting on [omarchy] could never end. That includes a switch to a channel that lacks an import the Mac has. Example: edge carries fex-emu-rootfs-arch and rc doesn't. A first run, where the key is still present, behaves exactly as before.

Evidence

The pacman test stub now fails every -S* query while [asahi-alarm] is configured and its key is absent, the way real pacman does.

  • Before: not ok - the returned repository is dropped again and the machine marked again omarchy asahi-alarm core extra alarm custom
    After: drop-asahi-alarm-test.sh: 15/15 ok in an Arch Linux ARM container, including the new cases:
    • a returned repository is dropped with no error: output
    • after a switch to a channel without an installed import (fex-emu-rootfs-arch on rc), the repository is still dropped and the Mac marked done
    • [asahi-alarm] written onto a Mac that never trusted it is dropped, with no inventory recorded

shellcheck -S warning is clean.

Merge Danger

Door: two-way

A release through release/omarchy-mac-* is still needed to reach Macs, and then promotion to rc, which still ships the old templates.

Blast Radius: cleaned-Macs

The change only affects Apple Silicon Macs that already lost the key, where [asahi-alarm] was unusable anyway. While the key is present, all guards hold as before.

Once the helper has deleted the key, an older template that writes the
section back makes pacman refuse every sync query, so the import guards
could never pass and the helper stayed pending with pacman unusable. The
guards now apply only while the key is still trusted, and the inventory is
recorded only when the repository can still be listed.

Fixes #219
@maralcbr
maralcbr requested a review from scottjones as a code owner November 30, 2026 22:07
Copilot AI balanced review requested due to automatic review settings November 30, 2026 22:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the keyless repository cleanup and inventory-handling changes.

No open issues 🎉

What changed in this PR

Fixes #219 by allowing the Mac cleanup helper to remove a restored [asahi-alarm] repository after its signing key is gone, recovering from a state that blocks pacman sync queries.

Changes:

  • Skip import-availability checks when the repository key is absent, while preserving keyring guards.
  • Record inventory only when the repository query succeeds.
  • Add regression coverage for keyless recovery and document the updated behavior.
File Description
omarchy-mac/​test/​drop-asahi-alarm-test.sh Simulates untrusted-database failures and covers keyless cleanup scenarios.
omarchy-mac/​README.md Documents conditional import checks and inventory recording.
omarchy-mac/​bin/​omarchy-mac-drop-asahi-alarm Allows keyless repository removal and avoids saving inventory from failed queries.

Review effort: Balanced

@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

The helper now removes a returned [asahi-alarm] without waiting for unavailable sync queries when its signing key is gone.

  • The helper drops a returned [asahi-alarm] section when its signing key is gone.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["asahi-alarm is configured"] --> B["Save inventory if listing succeeds"]
  B --> C{"Signing key exists?"}
  C -->|Yes| D["Check installed imports in omarchy"]
  D -->|Missing build| P["Stay pending"]
  D -->|Builds available| E["Check whether keyring is still needed"]
  C -->|No| E
  E -->|Required or listed| P
  E -->|Not needed| F["Remove repository, keyring and key"]
  F --> G["Verify cleanup and mark done"]
Loading

Reviews (1) · Last reviewed commit: "Drop a returned [asahi-alarm] even after..." · Reviewed by Greptile

@maralcbr
maralcbr merged commit 13d259d into main Nov 30, 2026
6 checks passed
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.

omarchy-mac-drop-asahi-alarm can't recover once [asahi-alarm] is written back: its pacman -Si check fails on the untrusted asahi-alarm db

2 participants