Repository navigation
Conversation
AI-assisted implementation and tests prepared with OpenAI Codex. Hardware and build qualification are recorded separately; no DCO sign-off is supplied.
[Medium impact] The PR appears safe to merge; no blocking issues remain. SummaryRestores the saved battery charge limit after installing or upgrading its udev rule.
Since the previous review, only the test assertions changed. No new actionable issues were found. The earlier README version mismatch is fixed. Reviews (3) · Last reviewed commit: "test: verify battery restoration hook tr..." · Reviewed by Greptile |
Show 0.2.4 in the package overview to match the version file. AI-assisted follow-up with OpenAI Codex.
scottjones
left a comment
There was a problem hiding this comment.
Thanks for this. The hook is the right fix: an already-present battery never gets a new add event, so without it a saved limit waits for the next boot. It copies the Touch ID hook's guard exactly (skip in a chroot or an unbooted root, never fail the transaction), and the restore helper already exits quietly with no saved limit, an unsupported value or a non-Apple platform. Running it on every omarchy-mac upgrade is fine too, since it only rewrites the value the owner saved.
Two things:
-
Heads-up on
omarchy-mac/version: #69 and your #76 also bump to 0.2.4, so whichever lands second needs a re-bump. If #30 lands first, which moves the bump into the release PR, please drop the bump and the README version line then. -
The new test runs the hook's
Execline but never checks its[Trigger]. We brokeTarget(omarchy-mac/share/libalpm/hooks/90-omarchy-mac-battery-charge-limit.hook:6) to a path nothing ships, and separately deletedOperation = Upgrade(line 5).battery-test.shpassed both times, so a hook that never fires would ship green.touchid-activate-test.sh:148-169already does this for the Touch ID hook: assert the trigger lines, then check thatTargetnames the staged rule. Can we do the same aroundomarchy-mac/test/battery-test.sh:167?
Minor: the validation numbers in the PR description and the migration claim don't match this PR. Please trim that section to what this PR changes.
|
Thanks, Scott. I added a test that checks the hook's |
|
To make the version collision concrete, I suggest #72 retain 0.2.4 if it lands first; after #64 and #72, #69 can take the resulting main and use 0.2.5; my draft #76 would use 0.2.6 only if accepted and landed after those. These numbers follow actual landing order, not reserved releases. The three identical 0.2.4 edits merge textually but should not ship different contents under the same package version. If #30 lands first, I will drop my feature-PR version bumps and duplicate README version lines and follow release-only versioning instead. #76 remains draft pending the scope decision. Does that order work for the maintainers and @audreyt? |
Installing or upgrading the battery-limit udev rule does not produce an add event for an already-present battery. Run the existing restore helper after that transaction so the owner's saved limit applies during the current boot.
The hook skips chroots and unbooted roots and never fails the package transaction. The restore helper retains its existing platform and saved-value checks.
Validation:
bash omarchy-mac/test/allpasses in an isolated environment with the real home and running services hidden.Merge order: this candidate bumps omarchy-mac from 0.2.3 to 0.2.4. #69 and #76 also propose 0.2.4, so whichever lands later must rebase and use the next version. If release-policy #30 lands first, remove this version bump and the README version line instead. No package release is made by this PR.
AI-assisted implementation and preparation with OpenAI Codex.