Skip to content

feat(homebrew): add support for Brewfile management, formula pinning,…#3

Merged
overag3 merged 4 commits into
masterfrom
feature/homebrew-pin-service-bundle
Jul 6, 2026
Merged

feat(homebrew): add support for Brewfile management, formula pinning,…#3
overag3 merged 4 commits into
masterfrom
feature/homebrew-pin-service-bundle

Conversation

@overag3

@overag3 overag3 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

… and service management

  • Introduced homebrew_bundle type for applying Brewfiles.
  • Added homebrew_pin type to pin/unpin Homebrew formulae.
  • Implemented homebrew_service type for managing Homebrew services.
  • Updated README with usage examples for new features.

… and service management

- Introduced `homebrew_bundle` type for applying Brewfiles.
- Added `homebrew_pin` type to pin/unpin Homebrew formulae.
- Implemented `homebrew_service` type for managing Homebrew services.
- Updated README with usage examples for new features.
Copilot AI review requested due to automatic review settings July 5, 2026 21:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the puppet-homebrew module with new native resource types to manage Brewfiles (brew bundle), formula pinning (brew pin/unpin), and Homebrew services (brew services), plus updates documentation and adds example manifests under tests/.

Changes:

  • Added homebrew_bundle, homebrew_pin, and homebrew_service Puppet types and their :brew providers (macOS-only).
  • Updated README.rst with usage examples for formula pinning, service management, and Brewfile application, and adjusted tap ordering guidance.
  • Added example manifests demonstrating the new resources.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/homebrew_service.pp Example manifest showing homebrew_service usage with a dependent package.
tests/homebrew_pin.pp Example manifest showing homebrew_pin usage with a dependent package.
tests/homebrew_bundle.pp Example manifest showing homebrew_bundle usage, including cleanup => true.
README.rst Added documentation for the new resource types and adjusted tap ordering guidance.
lib/puppet/type/homebrew_service.rb New type definition for managing brew services state (running/stopped).
lib/puppet/type/homebrew_pin.rb New type definition for pinning/unpinning formulae (present/absent).
lib/puppet/type/homebrew_bundle.rb New type definition for applying a Brewfile via brew bundle.
lib/puppet/provider/homebrew_service/brew.rb Provider implementing service listing/prefetch and start/stop operations.
lib/puppet/provider/homebrew_pin/brew.rb Provider implementing pin/unpin operations and pinned formula discovery.
lib/puppet/provider/homebrew_bundle/brew.rb Provider implementing Brewfile idempotence via brew bundle check/install (+ optional cleanup).
Comments suppressed due to low confidence (2)

README.rst:80

  • The ordering example uses Homebrew_tap <| |>, but this module doesn’t define a homebrew_tap resource type (taps are managed via package { ... provider => tap }). As written, this example won’t compile; the previous Package <| provider == tap |> collector matches how the tap provider actually works.

* ``force_auto_update`` — when ``true``, sets the tap's
  ``homebrew.forceautoupdate`` git config so Homebrew refreshes it on every
  ``brew update``; when ``false`` the setting is removed. (Homebrew dropped the

README.rst:54

  • The tap provider supports ensure => absent (it implements uninstall via brew untap), but this README section no longer mentions how to untap. Re-adding the sentence helps users discover the existing functionality.

You can untap a repository by setting ensure to ``absent``.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,48 @@
require 'puppet_x/homebrew/brew_command'
@@ -0,0 +1,72 @@
require 'json'
require 'puppet_x/homebrew/brew_command'
@@ -0,0 +1,86 @@
require 'puppet_x/homebrew/brew_command'
Comment on lines +43 to +46
def initialize(value = {})
super(value)
@property_flush = {}
end
Comment on lines +23 to +30
ensurable do
desc 'Whether the Brewfile should be applied (`present`).'
defaultto :present

newvalue(:present) do
provider.create
end
end
overag3 added 2 commits July 6, 2026 08:42
… and service management

- Introduced `homebrew_bundle` type for applying Brewfiles.
- Added `homebrew_pin` type to pin/unpin Homebrew formulae.
- Implemented `homebrew_service` type for managing Homebrew services.
- Updated README with usage examples for new features.
@overag3
overag3 merged commit 21a0674 into master Jul 6, 2026
1 of 2 checks passed
overag3 added a commit that referenced this pull request Jul 7, 2026
feat(homebrew): add support for Brewfile management, formula pinning,…
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.

2 participants