Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 17, 2025

The Sparkdock menubar app was incorrectly displaying green "up to date" status for all managed stacks when brew outdated commands failed due to Xcode license not being accepted. This gave users the false impression that no updates were available when in reality the license issue was preventing proper update detection.

Problem

When the Xcode license has not been accepted, brew commands fail with:

Error: You have not agreed to the Xcode license. Please resolve this by running:
  sudo xcodebuild -license accept

The menubar app treated this as a generic failure and returned 0 (no updates), causing the UI to show:

  • ✅ Green "Brew packages: up to date" status (incorrect)
  • ✅ Gray template menu bar icon (indicating no updates needed)
  • ✅ Hidden "Upgrade Brew Packages" menu item

Meanwhile, actual updates like http-proxy were available but users had no indication of system issues preventing proper detection.

Solution

Enhanced error handling to distinguish between genuine "no updates" states and license-related failures:

  1. License Error Detection: Captures stderr output and checks for specific Xcode license error patterns
  2. Separate Error State: Added hasBrewLicenseError property to track license issues independently
  3. Improved UI Feedback: Shows red error status with actionable guidance instead of misleading green status
  4. Better User Experience: Menu items provide clear instructions for resolving the license issue

Changes

  • Status Display: Red "Brew packages: License error - run 'sudo xcodebuild -license accept'"
  • Menu Bar Icon: Orange/red warning state instead of gray "no updates" state
  • Tooltip: Includes "Brew license error" information
  • Menu Item: "Fix Xcode License (run 'sudo xcodebuild -license accept')" - visible but disabled
  • Logging: License errors logged at ERROR level with full error details

Example

Before this fix, when brew outdated failed due to license issues:

  • User sees: "✅ All systems up to date"
  • Reality: Updates available but license blocking detection

After this fix:

  • User sees: "⚠️ Brew license error - run 'sudo xcodebuild -license accept'"
  • User can take immediate action to resolve the underlying issue

Fixes #214.


💡 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.

@Copilot Copilot AI changed the title [WIP] Menubar issues when brew needs xcodebuild license accept Fix menubar showing "all green" when brew fails due to Xcode license error Sep 17, 2025
@Copilot Copilot AI requested a review from paolomainardi September 17, 2025 22:29
Copilot finished work on behalf of paolomainardi September 17, 2025 22:29
@paolomainardi
Copy link
Member

@claude can you analyze this changes ?

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.

Menubar issues when brew needs xcodebuild license accept
2 participants