Skip to content

fix: resolve formula aliases before tracking installed packages#20

Open
jerryjrxie wants to merge 2 commits intoopenbootdotdev:mainfrom
jerryjrxie:fix/formula-aliases
Open

fix: resolve formula aliases before tracking installed packages#20
jerryjrxie wants to merge 2 commits intoopenbootdotdev:mainfrom
jerryjrxie:fix/formula-aliases

Conversation

@jerryjrxie
Copy link
Copy Markdown

Summary

Fixes an issue where packages with formula aliases (like postgresqlpostgresql@18) were being reinstalled on every run because the state tracking didn't match the actual installed names.

Problem

Homebrew has formula aliases where the requested name differs from the actual installed name:

  • postgresql → installs as postgresql@18
  • kubectl → installs as kubernetes-cli

The state file tracked the alias name ("postgresql") but brew list returns the actual name ("postgresql@18"), so they never matched during state reconciliation. This caused packages to be reinstalled every time openboot ran.

Solution

  • Added ResolveFormulaName() function that uses brew info --json to resolve aliases to canonical names
  • Updated all package tracking in InstallWithProgress() to use resolved names:
    • When checking if already installed
    • When tracking newly installed packages
    • When tracking failed packages for retry
  • Handles both CLI formulae and casks

Testing

  • Fix verified: postgresql and kubectl now resolve to their canonical names before tracking
  • go vet passes
  • Changes are minimal and focused on the tracking issue

Related

This complements PR #18 which fixed GUI apps being skipped. Both issues affected package tracking but for different reasons.

Homebrew has formula aliases where the requested name differs from the
actual installed name. Examples:
- postgresql → installs as postgresql@18
- kubectl → installs as kubernetes-cli

This caused packages to be reinstalled on every run because the state
file tracked the alias name (e.g., postgresql) but brew list returns
the actual name (e.g., postgresql@18), so they never matched during
reconciliation.

Fix:
- Added ResolveFormulaName() function to resolve aliases using brew info --json
- Updated all package tracking to use resolved names
- Handles both CLI packages and casks

Closes openbootdotdev#17 (formula alias tracking issue)
@github-actions
Copy link
Copy Markdown

👋 Thanks for opening this pull request!

🎉 This is your first PR to OpenBoot — welcome!

Before merging:

  • Code follows existing patterns in the codebase
  • go build ./... and go vet ./... pass
  • Commit message is clear and descriptive

@fullstackjam will review this soon. Thanks for contributing! 🚀

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.

1 participant