Skip to content

feat(homebrew): add Homebrew tap update management#4

Merged
overag3 merged 2 commits into
masterfrom
feature/homebrew-update-taps
Jul 7, 2026
Merged

feat(homebrew): add Homebrew tap update management#4
overag3 merged 2 commits into
masterfrom
feature/homebrew-update-taps

Conversation

@overag3

@overag3 overag3 commented Jul 7, 2026

Copy link
Copy Markdown
Owner
  • Introduced manage_update parameter to control Homebrew tap updates.
  • Added homebrew::update class to handle periodic updates with a configurable frequency.
  • Updated README with instructions on enabling and configuring tap updates.
  • Ensured transient failures during updates are retried without affecting the update interval.

- Introduced `manage_update` parameter to control Homebrew tap updates.
- Added `homebrew::update` class to handle periodic updates with a configurable frequency.
- Updated README with instructions on enabling and configuring tap updates.
- Ensured transient failures during updates are retried without affecting the update interval.
Copilot AI review requested due to automatic review settings July 7, 2026 13:17

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 adds opt-in management of brew update runs for Homebrew taps by introducing a manage_update toggle and an update interval, with accompanying documentation and an example manifest.

Changes:

  • Added manage_update and update_frequency parameters to the main homebrew class to control periodic updates.
  • Introduced homebrew::update to run brew update at most once per configured interval using a timestamp marker.
  • Documented the behavior and ordering guidance in README.rst, plus added a tests/update.pp example.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
manifests/init.pp Adds new parameters and conditionally declares/contains homebrew::update.
manifests/update.pp Implements the periodic brew update exec guarded by a timestamp marker.
README.rst Documents the new opt-in update mechanism, marker behavior, and ordering.
tests/update.pp Adds an example manifest showing how to enable and configure updates.

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

Comment thread manifests/init.pp
Comment on lines +8 to 10
Boolean $manage_update = false,
Integer $update_frequency = 86400,
Hash[String, String] $homebrew_environment = {},
Comment thread manifests/update.pp
Comment on lines +12 to +14
# $update_frequency is expressed in seconds; find -mmin works in minutes.
$frequency_minutes = $homebrew::update_frequency / 60

Comment thread manifests/update.pp
Comment on lines +19 to +24
exec { 'homebrew-update':
command => "/usr/bin/su ${homebrew::user} -c '${brew} update' && /usr/bin/touch ${marker}",
unless => "/usr/bin/find ${marker} -mmin -${frequency_minutes} | /usr/bin/grep -q .",
logoutput => on_failure,
timeout => 0,
}
…cution

- Changed the type of `update_frequency` to enforce a minimum value of 60 minutes.
- Simplified the architecture-dependent Homebrew prefix assignment in `homebrew::update` by reusing the value from `homebrew::install`.
- Updated the command execution logic in the `homebrew-update` exec resource to handle transient failures more gracefully and increased the timeout to 300 seconds.
@overag3
overag3 merged commit b798bee into master Jul 7, 2026
1 check passed
overag3 added a commit that referenced this pull request Jul 7, 2026
feat(homebrew): add Homebrew tap update management
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