Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update git requirement from ~> 1.7 to >= 1.7, < 3.0 #280

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ jobs:
run: bundle exec rake spec
- name: Run behavior tests
run: bundle exec cucumber
env:
Copy link
Member

Choose a reason for hiding this comment

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

GIT_COMMITTER_NAME: 'Aruba'
GIT_COMMITTER_EMAIL: '[email protected]'
GIT_AUTHOR_NAME: 'Aruba'
GIT_AUTHOR_EMAIL: '[email protected]'
- name: Build gem
run: gem build --strict --verbose *.gemspec
tests:
Expand Down
2 changes: 1 addition & 1 deletion lib/modulesync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def self.update(cli_options)
# managed_modules is either an array or a hash
managed_modules.each do |puppet_module|
manage_module(puppet_module, module_files, defaults)
rescue ModuleSync::Error, Git::GitExecuteError => e
rescue ModuleSync::Error, Git::Error => e
message = e.message || 'Error during `update`'
warn "#{puppet_module.given_name}: #{message}"
exit 1 unless options[:skip_broken]
Expand Down
2 changes: 1 addition & 1 deletion lib/modulesync/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def submit_changes(files, options)
repo.push('origin', branch, opts_push)
puts "Changes have been pushed to: '#{branch}'"
end
rescue Git::GitExecuteError => e
rescue Git::Error => e
Copy link
Member

Choose a reason for hiding this comment

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

I thought I could solve this deprecation warning:

DEPRECATION WARNING: Git::GitExecuteError is deprecated! Use Git::Error instead. (called from rescue in submit_changes at /home/runner/work/modulesync/modulesync/lib/modulesync/repository.rb:161)

But now: uninitialized constant Git::Error.

raise unless e.message.match?(/working (directory|tree) clean/)

puts "There were no changes in '#{@directory}'. Not committing."
Expand Down
4 changes: 2 additions & 2 deletions lib/monkey_patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

module Git
module LibMonkeyPatch
# Monkey patch set_custom_git_env_variables due to our ::Git::GitExecuteError handling.
# Monkey patch set_custom_git_env_variables due to our ::Git::Error handling.
#
# We rescue on the GitExecuteError and proceed differently based on the output of git.
# We rescue on the Git::Error and proceed differently based on the output of git.
# This way makes code language-dependent, so here we ensure that Git gem throw git commands with the "C" language
def set_custom_git_env_variables
super
Expand Down
2 changes: 1 addition & 1 deletion modulesync.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'simplecov', '~> 0.22.0'
spec.add_development_dependency 'voxpupuli-rubocop', '~> 2.8.0'

spec.add_runtime_dependency 'git', '~>1.7'
spec.add_runtime_dependency 'git', '>=1.7', '<3.0'
spec.add_runtime_dependency 'gitlab', '>=4', '<6'
spec.add_runtime_dependency 'octokit', '>=4', '<9'
spec.add_runtime_dependency 'puppet-blacksmith', '>= 3.0', '< 8'
Expand Down
Loading