Repository navigation
Keep the macOS installation updated from main - #13
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The installed macOS copy now knows its commit, checks GitHub
mainabout once an hour, and updates itself only after the new version builds and serves its own commit on a spare port.bin/install-launch-agent): builds the checkout's commit into~/Library/Application Support/LocalWebMonitorex-versions/<sha>with aREVISIONfile, and points~/Library/Application Support/LocalWebMonitorexat it as a symlink. An older real directory there is kept as the previous version. It also installscom.localwebmonitorex.updater(StartInterval3600,RunAtLoad) and gives the main agent the status file path.bin/uninstall-launch-agentremoves both agents.bin/update-from-main, run from a private copy in~/Library/Application Support/LocalWebMonitorex-updater): fetchesmaininto a private bare repository, compares it with the installed commit, exports the new commit into its own version directory, and runs that version'sbin/build-installation. It then smoke-tests the build withMIX_ENV=prod mix phx.serveron a free loopback port, using throwaway settings and an empty watched range. Only then does it switch the symlink andkickstartthe main agent. If the dashboard does not serve the new commit on the saved port, it switches back and restarts the previous version. Fetch, build, smoke and restart failures leave the current version running and are written tostatusand to~/Library/Logs/LocalWebMonitorex-updater.log. Builds are capped at 30 min; the version before the current one is kept for rollback. An installed commit that is not onmainpauses updates.UpdateStatusPanel) so the parallel redesign can move it. The root layout adds alocalwebmonitorex-revisionmeta tag, which the updater uses to make sure the right version answered.CI follow-up: the push token lacks the
workflowscope, so.github/workflows/ci.ymlis unchanged. To run the shell suite in CI, add these lines after the existingbash -nstep in thetestjob:The loopback bind is unchanged. Nothing on the machine was installed or restarted.
Activation
After merging, from an up-to-date
maincheckout run./bin/install-launch-agentonce. It rebuilds into the versioned layout, restartscom.localwebmonitorex, and turns on the hourly updater.Validation
mix test(65 tests),mix format --check-formatted,mix compile --warnings-as-errorsshellcheckclean;test/shell/update_from_main_test.sh(local): up to date, two-step update with pruning, build failure, smoke failure, restart failure with rollback, diverged install, unreachable remote, and missing REVISION. It uses a local remote, a fake server and a fakelaunchctl.mix phx.server(fakelaunchctlonly, temp dirs and ports)🤖 Generated with Claude Code