Skip to content

Add skip_hooks property to vcsrepo #557

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 13 commits into from
Aug 8, 2022

Conversation

sp-ricard-valverde
Copy link

@sp-ricard-valverde sp-ricard-valverde commented Jul 17, 2022

Add new property skip_hooks to control wether the repository should actively ignore configured hooks(local, global or system)

Implemented for the git provider

Problematic

When using vcsrepo to manage a git repository, having global git hooks configured can mess with the functionality of the module. If checkout hooks are configured they may make any git checkout operation fail.

New property skip_hooks to manage if a repository should not respond to
hooks

It's tied to a new :hooks_allowed feature
Git provider implements skip_hooks by setting the local config
core.hooksPath parameter to /dev/null
@sp-ricard-valverde sp-ricard-valverde requested a review from a team as a code owner July 17, 2022 15:22
@puppet-community-rangefinder
Copy link

vcsrepo is a type

Breaking changes to this file WILL impact these 175 modules (exact match):
Breaking changes to this file MAY impact these 65 modules (near match):

This module is declared in 109 of 579 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

Use propper property skip_hooks magic methods, avoid boilerplate

Do not use a default property value. It should be unmanaged by default
Add tests for when skip_hooks is manage :either true or :false
Git versions under 1.7.4 did not have the --local flag config
specifyier

Add support for older versions which by default look for a local
.git/config file
@sp-ricard-valverde
Copy link
Author

I believe CI is failing due to provisioning

@petergmurphy petergmurphy merged commit 157d366 into puppetlabs:main Aug 8, 2022
@pmcmaw pmcmaw added the feature label Sep 13, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants