modulesync 2.1.1 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +29 -9
  3. data/.github/workflows/release.yml +5 -6
  4. data/.gitignore +1 -0
  5. data/.rubocop.yml +17 -8
  6. data/.rubocop_todo.yml +25 -17
  7. data/.simplecov +46 -0
  8. data/CHANGELOG.md +60 -0
  9. data/Gemfile +5 -3
  10. data/LICENSE +173 -12
  11. data/README.md +30 -0
  12. data/bin/msync +17 -1
  13. data/features/cli.feature +12 -6
  14. data/features/execute.feature +51 -0
  15. data/features/hook.feature +5 -8
  16. data/features/push.feature +46 -0
  17. data/features/reset.feature +57 -0
  18. data/features/step_definitions/git_steps.rb +29 -1
  19. data/features/support/env.rb +9 -0
  20. data/features/update/bump_version.feature +8 -12
  21. data/features/update/dot_sync.feature +52 -0
  22. data/features/update/pull_request.feature +180 -0
  23. data/features/update.feature +74 -103
  24. data/lib/modulesync/cli/thor.rb +12 -0
  25. data/lib/modulesync/cli.rb +122 -28
  26. data/lib/modulesync/git_service/base.rb +63 -0
  27. data/lib/modulesync/git_service/factory.rb +28 -0
  28. data/lib/modulesync/{pr → git_service}/github.rb +23 -21
  29. data/lib/modulesync/git_service/gitlab.rb +62 -0
  30. data/lib/modulesync/git_service.rb +96 -0
  31. data/lib/modulesync/hook.rb +11 -13
  32. data/lib/modulesync/renderer.rb +9 -7
  33. data/lib/modulesync/repository.rb +78 -28
  34. data/lib/modulesync/settings.rb +0 -1
  35. data/lib/modulesync/source_code.rb +28 -2
  36. data/lib/modulesync/util.rb +4 -4
  37. data/lib/modulesync.rb +104 -66
  38. data/modulesync.gemspec +9 -5
  39. data/spec/helpers/faker/puppet_module_remote_repo.rb +16 -1
  40. data/spec/spec_helper.rb +2 -0
  41. data/spec/unit/modulesync/git_service/factory_spec.rb +16 -0
  42. data/spec/unit/modulesync/git_service/github_spec.rb +81 -0
  43. data/spec/unit/modulesync/git_service/gitlab_spec.rb +90 -0
  44. data/spec/unit/modulesync/git_service_spec.rb +201 -0
  45. data/spec/unit/modulesync/source_code_spec.rb +22 -0
  46. data/spec/unit/modulesync_spec.rb +0 -12
  47. metadata +96 -14
  48. data/lib/modulesync/pr/gitlab.rb +0 -54
  49. data/spec/unit/modulesync/pr/github_spec.rb +0 -49
  50. data/spec/unit/modulesync/pr/gitlab_spec.rb +0 -81
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8801f1e8404946dfdbaf9d01150dd1c5a0f1d339af7bcdc06fd9e27613487f14
4
- data.tar.gz: b7933278563de1d478e1f5c0bcda0d52dda43acbccb32a58a737a13ae97c05ed
3
+ metadata.gz: 592e73854b4792850a6696971ca1a28a441bd04c195f548933cc1ec01ba6b433
4
+ data.tar.gz: 8eb8d8b165bc87a633fe90feea07e713bdcf4b6ccaf3fd6ba8cce5d57053c7b7
5
5
  SHA512:
6
- metadata.gz: d265ff19bc634007ddbcac4755e0d163bdbdec2670f8b523a911c0a37bec71dcd0ada0cf1d51cba1a64b4cf709e4accc3055fbe3bbade1baba242719414443e6
7
- data.tar.gz: a780adc783ec07bb22093e2f10d834da004e097588c0dd0adc3164c61369d293f4d02e153b7cf60d8769cf74d783eb32a85928448b1dc2bcd61f55ab0ce90f78
6
+ metadata.gz: 9329c73bc685a734e5e1fe8387c4ad202a9468f502aed86cdbf32362d9e0079eb5385b2a1c3d0a155912f049945702a9e8eca6d465a79b5aa458dde735784a96
7
+ data.tar.gz: 506630e05453bcb84783d326bbb81d69f4bfe653d1b80f6d5416814c9d3d1b6f2802e0c560e5c8f80a4377f82d1e0403bda1933ad658c3915590d125af1d51f0
@@ -4,20 +4,36 @@ on:
4
4
  - pull_request
5
5
  - push
6
6
 
7
+ env:
8
+ BUNDLE_WITHOUT: release
9
+
7
10
  jobs:
11
+ rubocop:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: Setup ruby
16
+ uses: ruby/setup-ruby@v1
17
+ with:
18
+ ruby-version: '3.1'
19
+ bundler-cache: true
20
+ - name: Run linter
21
+ run: bundle exec rubocop --format github
8
22
  test:
23
+ needs: rubocop
9
24
  runs-on: ubuntu-latest
10
25
  strategy:
11
26
  fail-fast: false
12
27
  matrix:
13
- ruby:
14
- - 2.5
15
- - 2.6
16
- - 2.7
17
- - 3.0
28
+ include:
29
+ - ruby: "2.5"
30
+ - ruby: "2.6"
31
+ - ruby: "2.7"
32
+ - ruby: "3.0"
33
+ - ruby: "3.1"
34
+ codecov: "yes"
18
35
  env:
19
- BUNDLE_WITHOUT: release
20
- name: Ruby ${{ matrix.ruby }}
36
+ CODECOV: ${{ matrix.codecov }}
21
37
  steps:
22
38
  - uses: actions/checkout@v2
23
39
  - name: Install Ruby ${{ matrix.ruby }}
@@ -25,5 +41,9 @@ jobs:
25
41
  with:
26
42
  ruby-version: ${{ matrix.ruby }}
27
43
  bundler-cache: true
28
- - name: Run tests
29
- run: bundle exec rake test
44
+ - name: Run unit tests
45
+ run: bundle exec rake spec
46
+ - name: Run behavior tests
47
+ run: bundle exec cucumber
48
+ - name: Build gem
49
+ run: gem build *.gemspec
@@ -1,21 +1,20 @@
1
1
  name: Release
2
2
 
3
3
  on:
4
- create:
5
- ref_type: tag
4
+ push:
5
+ tags:
6
+ - '*'
6
7
 
7
8
  jobs:
8
9
  release:
9
10
  runs-on: ubuntu-latest
10
11
  if: github.repository == 'voxpupuli/modulesync'
11
- env:
12
- BUNDLE_WITHOUT: release
13
12
  steps:
14
13
  - uses: actions/checkout@v2
15
- - name: Install Ruby 3.0
14
+ - name: Install Ruby 3.1
16
15
  uses: ruby/setup-ruby@v1
17
16
  with:
18
- ruby-version: '3.0'
17
+ ruby-version: '3.1'
19
18
  - name: Build gem
20
19
  run: gem build *.gemspec
21
20
  - name: Publish gem to rubygems.org
data/.gitignore CHANGED
@@ -5,6 +5,7 @@
5
5
  Gemfile.lock
6
6
  bin/bundle
7
7
  bin/rspec
8
+ coverage/
8
9
  modules/
9
10
  tmp/
10
11
  vendor/
data/.rubocop.yml CHANGED
@@ -1,7 +1,8 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.4
4
+ TargetRubyVersion: 2.5
5
+ NewCops: enable
5
6
  Exclude:
6
7
  - 'vendor/**/*'
7
8
  - 'tmp/**/*'
@@ -11,22 +12,30 @@ AllCops:
11
12
  - 'Gemfile'
12
13
  - 'Rakefile'
13
14
 
14
- Style/HashSyntax:
15
+ Style/FetchEnvVar:
15
16
  Enabled: false
16
17
 
17
- # dealbreaker:
18
- Style/TrailingCommaInLiteral:
18
+ Style/HashSyntax:
19
19
  Enabled: false
20
20
 
21
- # would require external library
22
- Layout/IndentHeredoc:
23
- Enabled: false
21
+ Style/TrailingCommaInArguments:
22
+ EnforcedStyleForMultiline: comma
23
+
24
+ Style/TrailingCommaInArrayLiteral:
25
+ EnforcedStyleForMultiline: comma
26
+
27
+ Style/TrailingCommaInHashLiteral:
28
+ EnforcedStyleForMultiline: comma
24
29
 
25
30
  # sane line length
26
- Metrics/LineLength:
31
+ Layout/LineLength:
27
32
  Max: 120
28
33
  Exclude:
29
34
  - 'features/**/*'
30
35
 
31
36
  Style/FrozenStringLiteralComment:
32
37
  Enabled: false
38
+
39
+ # We explicitly prefer $stderr.puts over #warn
40
+ Style/StderrPuts:
41
+ Enabled: false
data/.rubocop_todo.yml CHANGED
@@ -1,39 +1,46 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2021-04-22 16:30:35 +0200 using RuboCop version 0.50.0.
3
+ # on 2022-02-14 21:55:21 UTC using RuboCop version 1.24.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
9
  # Offense count: 1
10
- Lint/UselessAssignment:
10
+ # Cop supports --auto-correct.
11
+ # Configuration parameters: Include.
12
+ # Include: **/*.gemspec
13
+ Gemspec/RequireMFA:
11
14
  Exclude:
12
- - 'lib/modulesync.rb'
15
+ - 'modulesync.gemspec'
13
16
 
14
- # Offense count: 10
17
+ # Offense count: 9
18
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
15
19
  Metrics/AbcSize:
16
- Max: 67
20
+ Max: 60
17
21
 
18
22
  # Offense count: 2
19
- # Configuration parameters: CountComments.
23
+ # Configuration parameters: CountComments, CountAsOne.
20
24
  Metrics/ClassLength:
21
- Max: 128
25
+ Max: 186
22
26
 
23
- # Offense count: 3
27
+ # Offense count: 5
28
+ # Configuration parameters: IgnoredMethods.
24
29
  Metrics/CyclomaticComplexity:
25
- Max: 12
30
+ Max: 15
26
31
 
27
- # Offense count: 13
28
- # Configuration parameters: CountComments.
32
+ # Offense count: 17
33
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
29
34
  Metrics/MethodLength:
30
- Max: 36
35
+ Max: 34
31
36
 
32
- # Offense count: 3
37
+ # Offense count: 4
38
+ # Configuration parameters: IgnoredMethods.
33
39
  Metrics/PerceivedComplexity:
34
- Max: 13
40
+ Max: 16
35
41
 
36
42
  # Offense count: 8
43
+ # Configuration parameters: AllowedConstants.
37
44
  Style/Documentation:
38
45
  Exclude:
39
46
  - 'spec/**/*'
@@ -45,7 +52,8 @@ Style/Documentation:
45
52
  - 'lib/modulesync/util.rb'
46
53
 
47
54
  # Offense count: 1
48
- # Cop supports --auto-correct.
49
- Style/EachWithObject:
55
+ # Configuration parameters: AllowedMethods.
56
+ # AllowedMethods: respond_to_missing?
57
+ Style/OptionalBooleanParameter:
50
58
  Exclude:
51
- - 'lib/modulesync/util.rb'
59
+ - 'lib/modulesync/puppet_module.rb'
data/.simplecov ADDED
@@ -0,0 +1,46 @@
1
+ SimpleCov.start do
2
+ if ENV['SIMPLECOV_ROOT']
3
+ SimpleCov.root(ENV['SIMPLECOV_ROOT'])
4
+
5
+ filters.clear # This will remove the :root_filter and :bundler_filter that come via simplecov's defaults
6
+
7
+ # Because simplecov filters everything outside of the SimpleCov.root
8
+ # This should be added, cf.
9
+ # https://github.com/colszowka/simplecov#default-root-filter-and-coverage-for-things-outside-of-it
10
+ add_filter do |src|
11
+ src.filename !~ /^#{SimpleCov.root}/
12
+ end
13
+ end
14
+
15
+ add_group 'Source code', 'lib'
16
+
17
+ add_group 'Unit tests', 'spec'
18
+
19
+ add_group 'Behavior tests', 'features'
20
+ add_filter '/features/support/env.rb'
21
+
22
+ enable_coverage :branch
23
+
24
+ # do not track vendored files
25
+ add_filter '/vendor'
26
+ add_filter '/.vendor'
27
+
28
+ # exclude anything that is not in lib, spec or features directories
29
+ add_filter do |src|
30
+ src.filename !~ %r{^#{SimpleCov.root}/(lib|spec|features)}
31
+ end
32
+
33
+ track_files '**/*.rb'
34
+ end
35
+
36
+ if ENV['CODECOV'] == 'yes'
37
+ require 'simplecov-console'
38
+ require 'codecov'
39
+
40
+ SimpleCov.formatters = [
41
+ SimpleCov::Formatter::Console,
42
+ SimpleCov::Formatter::Codecov,
43
+ ]
44
+ end
45
+
46
+ # vim: filetype=ruby
data/CHANGELOG.md CHANGED
@@ -2,6 +2,65 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.3.1](https://github.com/voxpupuli/modulesync/tree/2.3.1) (2022-05-05)
6
+
7
+ [Full Changelog](https://github.com/voxpupuli/modulesync/compare/2.3.0...2.3.1)
8
+
9
+ **Fixed bugs:**
10
+
11
+ - Handle Ruby 3.1 ERB trim\_mode deprecation [\#252](https://github.com/voxpupuli/modulesync/pull/252) ([ekohl](https://github.com/ekohl))
12
+
13
+ ## [2.3.0](https://github.com/voxpupuli/modulesync/tree/2.3.0) (2022-03-07)
14
+
15
+ [Full Changelog](https://github.com/voxpupuli/modulesync/compare/2.2.0...2.3.0)
16
+
17
+ **Implemented enhancements:**
18
+
19
+ - CLI: Show relevant help when using --help option on a subcommand [\#248](https://github.com/voxpupuli/modulesync/pull/248) ([neomilium](https://github.com/neomilium))
20
+ - New CLI commands [\#244](https://github.com/voxpupuli/modulesync/pull/244) ([neomilium](https://github.com/neomilium))
21
+
22
+ **Fixed bugs:**
23
+
24
+ - Existing MR makes msync fail \(which leaves changes in target branch\) [\#195](https://github.com/voxpupuli/modulesync/issues/195)
25
+ - Target branch `.sync.yml` not taken into account on branch update \(--force\) [\#192](https://github.com/voxpupuli/modulesync/issues/192)
26
+ - Fix error when git upstream branch is deleted [\#240](https://github.com/voxpupuli/modulesync/pull/240) ([neomilium](https://github.com/neomilium))
27
+
28
+ **Closed issues:**
29
+
30
+ - Linter is missing in CI [\#237](https://github.com/voxpupuli/modulesync/issues/237)
31
+ - Behavior tests are missing in CI [\#236](https://github.com/voxpupuli/modulesync/issues/236)
32
+
33
+ **Merged pull requests:**
34
+
35
+ - Properly ensure the parent directory exists [\#247](https://github.com/voxpupuli/modulesync/pull/247) ([ekohl](https://github.com/ekohl))
36
+ - Add Ruby 3.1 to CI matrix [\#245](https://github.com/voxpupuli/modulesync/pull/245) ([bastelfreak](https://github.com/bastelfreak))
37
+ - Fix rubocop offences and add linter to CI [\#243](https://github.com/voxpupuli/modulesync/pull/243) ([neomilium](https://github.com/neomilium))
38
+ - Support `.sync.yml` changes between two runs [\#242](https://github.com/voxpupuli/modulesync/pull/242) ([neomilium](https://github.com/neomilium))
39
+ - Fix gitlab merge request submission [\#241](https://github.com/voxpupuli/modulesync/pull/241) ([neomilium](https://github.com/neomilium))
40
+ - Add behavior tests to CI [\#239](https://github.com/voxpupuli/modulesync/pull/239) ([neomilium](https://github.com/neomilium))
41
+ - Rework PR/MR feature [\#219](https://github.com/voxpupuli/modulesync/pull/219) ([neomilium](https://github.com/neomilium))
42
+ - Refactor code for maintainabilty [\#206](https://github.com/voxpupuli/modulesync/pull/206) ([neomilium](https://github.com/neomilium))
43
+
44
+ ## [2.2.0](https://github.com/voxpupuli/modulesync/tree/2.2.0) (2021-07-24)
45
+
46
+ [Full Changelog](https://github.com/voxpupuli/modulesync/compare/2.1.1...2.2.0)
47
+
48
+ **Implemented enhancements:**
49
+
50
+ - Implement codecov/update README.md [\#234](https://github.com/voxpupuli/modulesync/pull/234) ([bastelfreak](https://github.com/bastelfreak))
51
+ - Checkout default\_branch and not hardcoded `master` [\#233](https://github.com/voxpupuli/modulesync/pull/233) ([alexjfisher](https://github.com/alexjfisher))
52
+
53
+ **Fixed bugs:**
54
+
55
+ - Fix condition for triggering the release workflow [\#232](https://github.com/voxpupuli/modulesync/pull/232) ([smortex](https://github.com/smortex))
56
+
57
+ **Merged pull requests:**
58
+
59
+ - Move cucumber from Gemfile to gemspec [\#230](https://github.com/voxpupuli/modulesync/pull/230) ([bastelfreak](https://github.com/bastelfreak))
60
+ - switch to https link in gemspec [\#228](https://github.com/voxpupuli/modulesync/pull/228) ([bastelfreak](https://github.com/bastelfreak))
61
+ - dont install octokit via Gemfile [\#227](https://github.com/voxpupuli/modulesync/pull/227) ([bastelfreak](https://github.com/bastelfreak))
62
+ - Allow latest aruba dependency [\#226](https://github.com/voxpupuli/modulesync/pull/226) ([bastelfreak](https://github.com/bastelfreak))
63
+
5
64
  ## [2.1.1](https://github.com/voxpupuli/modulesync/tree/2.1.1) (2021-06-15)
6
65
 
7
66
  [Full Changelog](https://github.com/voxpupuli/modulesync/compare/2.1.0...2.1.1)
@@ -32,6 +91,7 @@ The 2.1.0 release didn't make it to github packages. 2.1.1 is a new release with
32
91
 
33
92
  **Closed issues:**
34
93
 
94
+ - PR/MR feature should honor the repository default branch name as target branch [\#207](https://github.com/voxpupuli/modulesync/issues/207)
35
95
  - Add linting \(rubocop\) to Travis CI configuration [\#153](https://github.com/voxpupuli/modulesync/issues/153)
36
96
  - Language sensitive GIT handling [\#85](https://github.com/voxpupuli/modulesync/issues/85)
37
97
 
data/Gemfile CHANGED
@@ -2,9 +2,11 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- gem 'cucumber'
6
- gem 'octokit', '~> 4.9'
7
-
8
5
  group :release do
9
6
  gem 'github_changelog_generator', :require => false
10
7
  end
8
+
9
+ group :coverage, optional: ENV['CODECOV']!='yes' do
10
+ gem 'simplecov-console', :require => false
11
+ gem 'codecov', :require => false
12
+ end
data/LICENSE CHANGED
@@ -1,17 +1,178 @@
1
- Puppet Module Sync
1
+ Copyright (C) 2014 Puppet Labs Inc
2
2
 
3
- Copyright (C) 2014 Puppet Labs Inc
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
4
6
 
5
- Puppet Labs can be contacted at: info@puppetlabs.com
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
8
 
7
- Licensed under the Apache License, Version 2.0 (the "License");
8
- you may not use this file except in compliance with the License.
9
- You may obtain a copy of the License at
9
+ 1. Definitions.
10
10
 
11
- http://www.apache.org/licenses/LICENSE-2.0
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
12
13
 
13
- Unless required by applicable law or agreed to in writing, software
14
- distributed under the License is distributed on an "AS IS" BASIS,
15
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- See the License for the specific language governing permissions and
17
- limitations under the License.
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS
data/README.md CHANGED
@@ -1,6 +1,14 @@
1
1
  ModuleSync
2
2
  ===========
3
3
 
4
+ [![License](https://img.shields.io/github/license/voxpupuli/modulesync.svg)](https://github.com/voxpupuli/modulesync/blob/master/LICENSE)
5
+ [![Test](https://github.com/voxpupuli/modulesync/actions/workflows/ci.yml/badge.svg)](https://github.com/voxpupuli/modulesync/actions/workflows/ci.yml)
6
+ [![codecov](https://codecov.io/gh/voxpupuli/modulesync/branch/master/graph/badge.svg?token=Mypkl78hvK)](https://codecov.io/gh/voxpupuli/modulesync)
7
+ [![Release](https://github.com/voxpupuli/modulesync/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/modulesync/actions/workflows/release.yml)
8
+ [![RubyGem Version](https://img.shields.io/gem/v/modulesync.svg)](https://rubygems.org/gems/modulesync)
9
+ [![RubyGem Downloads](https://img.shields.io/gem/dt/modulesync.svg)](https://rubygems.org/gems/modulesync)
10
+ [![Donated by Puppet Inc](https://img.shields.io/badge/donated%20by-Puppet%20Inc-fb7047.svg)](#transfer-notice)
11
+
4
12
  Table of Contents
5
13
  -----------------
6
14
 
@@ -436,3 +444,25 @@ The Templates
436
444
 
437
445
  See [Puppet's modulesync\_configs](https://github.com/puppetlabs/modulesync_configs) and [Vox Pupuli's modulesync\_config](https://github.com/voxpupuli/modulesync_config)
438
446
  repositories for different templates currently in use.
447
+
448
+ ## Transfer Notice
449
+
450
+ This plugin was originally authored by [Puppet Inc](http://puppet.com).
451
+ The maintainer preferred that Vox Pupuli take ownership of the module for future improvement and maintenance.
452
+ Existing pull requests and issues were transferred over, please fork and continue to contribute at https://github.com/voxpupuli/modulesync.
453
+
454
+ Previously: https://github.com/puppetlabs/modulesync
455
+
456
+ ## License
457
+
458
+ This gem is licensed under the Apache-2 license.
459
+
460
+ ## Release information
461
+
462
+ To make a new release, please do:
463
+ * update the version in the gemspec file
464
+ * Install gems with `bundle install --with release --path .vendor`
465
+ * generate the changelog with `bundle exec rake changelog`
466
+ * Check if the new version matches the closed issues/PRs in the changelog
467
+ * Create a PR with it
468
+ * After it got merged, push a tag. GitHub actions will do the actual release to rubygems and GitHub Packages
data/bin/msync CHANGED
@@ -1,6 +1,22 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- lib = File.expand_path('../../lib', __FILE__)
3
+ if ENV['COVERAGE']
4
+ # This block allow us to grab code coverage when running this script.
5
+ #
6
+ # Note: This environment variable (ie. COVERAGE) is set in Cucumber/Aruba configuration to collect reports
7
+ simplecov_root = File.expand_path File.join(File.dirname(__FILE__), '..')
8
+
9
+ # When running with aruba simplecov was using /tmp/aruba as the root folder.
10
+ # This is to force using the project folder
11
+ ENV['SIMPLECOV_ROOT'] = simplecov_root
12
+ require 'simplecov'
13
+
14
+ # https://github.com/simplecov-ruby/simplecov/issues/234
15
+ # As described in the issue, every process must have an unique name:
16
+ SimpleCov.command_name "#{File.basename $PROGRAM_NAME} (pid: #{Process.pid})"
17
+ end
18
+
19
+ lib = File.expand_path('../lib', __dir__)
4
20
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
21
 
6
22
  require 'modulesync/cli'
data/features/cli.feature CHANGED
@@ -17,9 +17,16 @@ Feature: CLI
17
17
  Then the exit status should be 1
18
18
 
19
19
  Scenario: When running the help command
20
- When I run `msync help`
21
- And the output should match /Commands:/
22
- Then the exit status should be 0
20
+ When I successfully run `msync help`
21
+ Then the output should match /Commands:/
22
+
23
+ Scenario: Use --help options on subcommand should show subcommand help
24
+ When I successfully run `msync clone --help`
25
+ Then the output should contain:
26
+ """
27
+ Usage:
28
+ msync clone
29
+ """
23
30
 
24
31
  Scenario: When overriding a setting from the config file on the command line
25
32
  Given a puppet module "puppet-test" from "fakenamespace"
@@ -35,9 +42,8 @@ Feature: CLI
35
42
  """
36
43
  And a git_base option appended to "modulesync.yml" for local tests
37
44
  And a directory named "moduleroot"
38
- When I run `msync update --noop --namespace fakenamespace --branch command-line-branch`
39
- Then the exit status should be 0
40
- And the output should contain:
45
+ When I successfully run `msync update --verbose --noop --namespace fakenamespace --branch command-line-branch`
46
+ Then the output should contain:
41
47
  """
42
48
  Creating new branch command-line-branch
43
49
  """