Add http-proxy update management to menubar app#180
Conversation
…acos Co-authored-by: paolomainardi <8747+paolomainardi@users.noreply.github.com>
…ration Co-authored-by: paolomainardi <8747+paolomainardi@users.noreply.github.com>
…plication Co-authored-by: paolomainardi <8747+paolomainardi@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive http-proxy update management to the Sparkdock menubar app, providing users with notifications and the ability to trigger updates for the http-proxy system directly from the menu bar interface.
- Implements http-proxy update checking via a new
sparkdock http-proxy-check-updatescommand - Adds menubar UI integration with status display and upgrade button functionality
- Refactors duplicate code by combining check functions into a generic command runner
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/menubar-app/Sources/SparkdockManager/main.swift | Core implementation with UI components, refactored command runner, and http-proxy integration |
| src/menubar-app/Tests/SparkdockManagerTests/SparkdockManagerTests.swift | Unit tests for new menu item tags and http-proxy commands |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
f23e864 to
3d2f3e7
Compare
…proach Replaces the previous completion that leaked JUST_JUSTFILE into global env with a self-contained _sjust() function that scopes JUST_JUSTFILE to a subprocess, following the pattern from archlinux-ansible-provisioner PR #180. Key improvements: - JUST_JUSTFILE scoped to subshell (no env leaking) - Uses clap completion protocol directly - Filters out just's --* flags from completions - No dependency on source-ing just's completion function Agent-Logs-Url: https://github.com/sparkfabrik/sparkdock/sessions/8e3ff904-e27a-4f67-a1d1-d51fe1acec22 Co-authored-by: Monska85 <62102073+Monska85@users.noreply.github.com>
Move the sjust zsh completion script from inline content (duplicated in Makefile and Ansible playbook) to a single source file at sjust/completions/_sjust, matching the pattern used in archlinux-ansible-provisioner PR #180. Both Makefile and Ansible now copy this file instead of generating it. Refs: #423 Assisted-by: opencode/github-copilot/claude-opus-4.6
* fix(sjust): sjust autocomplete working again with just 1.50+ * refactor(sjust): use self-contained clap completion like archlinux approach Replaces the previous completion that leaked JUST_JUSTFILE into global env with a self-contained _sjust() function that scopes JUST_JUSTFILE to a subprocess, following the pattern from archlinux-ansible-provisioner PR #180. Key improvements: - JUST_JUSTFILE scoped to subshell (no env leaking) - Uses clap completion protocol directly - Filters out just's --* flags from completions - No dependency on source-ing just's completion function Agent-Logs-Url: https://github.com/sparkfabrik/sparkdock/sessions/8e3ff904-e27a-4f67-a1d1-d51fe1acec22 Co-authored-by: Monska85 <62102073+Monska85@users.noreply.github.com> * refactor(sjust): extract completion to standalone file Move the sjust zsh completion script from inline content (duplicated in Makefile and Ansible playbook) to a single source file at sjust/completions/_sjust, matching the pattern used in archlinux-ansible-provisioner PR #180. Both Makefile and Ansible now copy this file instead of generating it. Refs: #423 Assisted-by: opencode/github-copilot/claude-opus-4.6 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Monska85 <62102073+Monska85@users.noreply.github.com> Co-authored-by: Paolo Mainardi <paolomainardi@gmail.com> Co-authored-by: Paolo Mainardi <paolo.mainardi@sparkfabrik.com>
User description
This PR implements comprehensive http-proxy update management in the Sparkdock menubar app, allowing users to receive notifications and trigger updates for the http-proxy system directly from the menu bar.
Current Status
runSparkdockCheckandrunHttpProxyCheckfunctionsProblem
Users had no way to check for or manage http-proxy updates through the menubar app. While
sjust http-proxy-install-updateexisted for updating, there was no mechanism to:Solution
Added complete http-proxy update support following the exact same patterns as existing Sparkdock and Brew update management:
Command Line Interface
sparkdock http-proxy-check-updatescommand/opt/sparkdock/http-proxygit repository for updatesMenubar App Integration
sjust http-proxy-install-updateCode Quality Improvements
runSparkdockCheck()andrunHttpProxyCheck()functions into a genericrunSparkdockCommand(_ command: String)functionVisual Changes
The menubar now displays:
Status colors follow existing conventions:
Implementation Details
Shell Script (
bin/sparkdock.macos)Swift App Integration (Refactored)
hasHttpProxyUpdatesstate variablehttpProxyStatusMenuItemandupgradeHttpProxyMenuItemrunSparkdockCheck()andrunHttpProxyCheck()into genericrunSparkdockCommand()functionupgradeHttpProxy()action that executessjust http-proxy-install-updatecheckForUpdates(), network monitoring, system wakePattern Consistency
The implementation follows the exact same patterns as existing Sparkdock and Brew updates:
Testing
Usage
sparkdock http-proxy-check-updatesThe http-proxy repository at
/opt/sparkdock/http-proxyis checked using the same git-based approach as the main Sparkdock repository, ensuring consistency and reliability.Fixes #179.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
PR Type
Enhancement
Description
Add http-proxy update management to menubar app
Implement http-proxy update checking command in sparkdock.macos
Refactor duplicated code by combining check functions
Add comprehensive testing for http-proxy functionality
Changes walkthrough 📝
main.swift
Add http-proxy update management to menubarsrc/menubar-app/Sources/SparkdockManager/main.swift
runHttpProxyCheck()function for update checkingrunSparkdockCheck()andrunHttpProxyCheck()into genericrunSparkdockCommand()Sparkdock and Brew updates
sparkdock.macos
Add http-proxy update checking commandbin/sparkdock.macos
check_http_proxy_updates()function to check git repositoryupdates
http-proxy-check-updatescommand line option/opt/sparkdock/http-proxydirectory for git updatesSparkdockManagerTests.swift
Add tests for http-proxy functionalitysrc/menubar-app/Tests/SparkdockManagerTests/SparkdockManagerTests.swift
upgradeHttpProxymenu item tag uniqueness