feat(homebrew): add support for Brewfile management, formula pinning,…#3
Merged
Merged
Conversation
… 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.
There was a problem hiding this comment.
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, andhomebrew_servicePuppet types and their:brewproviders (macOS-only). - Updated
README.rstwith 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 ahomebrew_tapresource type (taps are managed viapackage { ... provider => tap }). As written, this example won’t compile; the previousPackage <| 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 implementsuninstallviabrew 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 |
… 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.
…com/overag3/puppet-homebrew into feature/homebrew-pin-service-bundle
overag3
added a commit
that referenced
this pull request
Jul 7, 2026
feat(homebrew): add support for Brewfile management, formula pinning,…
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.
… and service management
homebrew_bundletype for applying Brewfiles.homebrew_pintype to pin/unpin Homebrew formulae.homebrew_servicetype for managing Homebrew services.