modulesync 2.1.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +29 -9
  3. data/.github/workflows/release.yml +7 -7
  4. data/.gitignore +1 -0
  5. data/.rubocop.yml +14 -8
  6. data/.rubocop_todo.yml +25 -17
  7. data/.simplecov +46 -0
  8. data/CHANGELOG.md +58 -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 +3 -6
  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: e8c67abecba12a55e8bf400dbdce4899d7ae3588ec7e297c4fe3ed46b7c9ce62
4
- data.tar.gz: 0dfcfc208e51892329bab49da6dea0b33a04a5b90dd1769a898e9f82fd8d83eb
3
+ metadata.gz: e4914cfca898fe7b7183b87a1feaa7b4edbeb2a1d5b97d2d32f53ca7cde6adf1
4
+ data.tar.gz: 7b02e4e2a1a4b1d7108702f3c9108ef250b13ddace34f4946f11d11338de6f90
5
5
  SHA512:
6
- metadata.gz: c113f5bb72bc8f77c0e07383f4ad13975915023ac865a68257eea3990fc888e193d5177d38003cf851d9ca1946ab13234c5642e75889f04cf9e52a3e3ef5f1fa
7
- data.tar.gz: f12d610d26f07fc2ec75905a8d9637d88b063ff48f6367dbd04fdeab424052f551d28802300206b5f6ee73bda8ceeac9cf0f7bdb17b5d57f58203eaa6b6003d0
6
+ metadata.gz: 93c282023d9f20729b4c8ed253e8a6b7c312433291fede9db35ee4b1250e00933b8bd751225521b6613709d41bef216f6a366115569710576253fb3473f5a408
7
+ data.tar.gz: 8019fac3cd951a7001986fbca62d50b4404e8c4008357a4724652a177a49d61ff4826d52767c67c074e0236f67723fea1df38fb583a1292d2f1ae5db8be39ccb
@@ -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
@@ -24,7 +23,8 @@ jobs:
24
23
  GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
25
24
  - name: Setup GitHub packages access
26
25
  run: |
26
+ mkdir -p ~/.gem
27
27
  echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
28
- chmod 0600 /home/runner/.gem/credentials
28
+ chmod 0600 ~/.gem/credentials
29
29
  - name: Publish gem to GitHub packages
30
30
  run: gem push --key github --host https://rubygems.pkg.github.com/voxpupuli *.gem
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/**/*'
@@ -14,19 +15,24 @@ AllCops:
14
15
  Style/HashSyntax:
15
16
  Enabled: false
16
17
 
17
- # dealbreaker:
18
- Style/TrailingCommaInLiteral:
19
- Enabled: false
18
+ Style/TrailingCommaInArguments:
19
+ EnforcedStyleForMultiline: comma
20
20
 
21
- # would require external library
22
- Layout/IndentHeredoc:
23
- Enabled: false
21
+ Style/TrailingCommaInArrayLiteral:
22
+ EnforcedStyleForMultiline: comma
23
+
24
+ Style/TrailingCommaInHashLiteral:
25
+ EnforcedStyleForMultiline: comma
24
26
 
25
27
  # sane line length
26
- Metrics/LineLength:
28
+ Layout/LineLength:
27
29
  Max: 120
28
30
  Exclude:
29
31
  - 'features/**/*'
30
32
 
31
33
  Style/FrozenStringLiteralComment:
32
34
  Enabled: false
35
+
36
+ # We explicitly prefer $stderr.puts over #warn
37
+ Style/StderrPuts:
38
+ 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,63 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [2.3.0](https://github.com/voxpupuli/modulesync/tree/2.3.0) (2022-03-07)
6
+
7
+ [Full Changelog](https://github.com/voxpupuli/modulesync/compare/2.2.0...2.3.0)
8
+
9
+ **Implemented enhancements:**
10
+
11
+ - CLI: Show relevant help when using --help option on a subcommand [\#248](https://github.com/voxpupuli/modulesync/pull/248) ([neomilium](https://github.com/neomilium))
12
+ - New CLI commands [\#244](https://github.com/voxpupuli/modulesync/pull/244) ([neomilium](https://github.com/neomilium))
13
+
14
+ **Fixed bugs:**
15
+
16
+ - Existing MR makes msync fail \(which leaves changes in target branch\) [\#195](https://github.com/voxpupuli/modulesync/issues/195)
17
+ - Target branch `.sync.yml` not taken into account on branch update \(--force\) [\#192](https://github.com/voxpupuli/modulesync/issues/192)
18
+ - Fix error when git upstream branch is deleted [\#240](https://github.com/voxpupuli/modulesync/pull/240) ([neomilium](https://github.com/neomilium))
19
+
20
+ **Closed issues:**
21
+
22
+ - Linter is missing in CI [\#237](https://github.com/voxpupuli/modulesync/issues/237)
23
+ - Behavior tests are missing in CI [\#236](https://github.com/voxpupuli/modulesync/issues/236)
24
+
25
+ **Merged pull requests:**
26
+
27
+ - Properly ensure the parent directory exists [\#247](https://github.com/voxpupuli/modulesync/pull/247) ([ekohl](https://github.com/ekohl))
28
+ - Add Ruby 3.1 to CI matrix [\#245](https://github.com/voxpupuli/modulesync/pull/245) ([bastelfreak](https://github.com/bastelfreak))
29
+ - Fix rubocop offences and add linter to CI [\#243](https://github.com/voxpupuli/modulesync/pull/243) ([neomilium](https://github.com/neomilium))
30
+ - Support `.sync.yml` changes between two runs [\#242](https://github.com/voxpupuli/modulesync/pull/242) ([neomilium](https://github.com/neomilium))
31
+ - Fix gitlab merge request submission [\#241](https://github.com/voxpupuli/modulesync/pull/241) ([neomilium](https://github.com/neomilium))
32
+ - Add behavior tests to CI [\#239](https://github.com/voxpupuli/modulesync/pull/239) ([neomilium](https://github.com/neomilium))
33
+ - Rework PR/MR feature [\#219](https://github.com/voxpupuli/modulesync/pull/219) ([neomilium](https://github.com/neomilium))
34
+ - Refactor code for maintainabilty [\#206](https://github.com/voxpupuli/modulesync/pull/206) ([neomilium](https://github.com/neomilium))
35
+
36
+ ## [2.2.0](https://github.com/voxpupuli/modulesync/tree/2.2.0) (2021-07-24)
37
+
38
+ [Full Changelog](https://github.com/voxpupuli/modulesync/compare/2.1.1...2.2.0)
39
+
40
+ **Implemented enhancements:**
41
+
42
+ - Implement codecov/update README.md [\#234](https://github.com/voxpupuli/modulesync/pull/234) ([bastelfreak](https://github.com/bastelfreak))
43
+ - Checkout default\_branch and not hardcoded `master` [\#233](https://github.com/voxpupuli/modulesync/pull/233) ([alexjfisher](https://github.com/alexjfisher))
44
+
45
+ **Fixed bugs:**
46
+
47
+ - Fix condition for triggering the release workflow [\#232](https://github.com/voxpupuli/modulesync/pull/232) ([smortex](https://github.com/smortex))
48
+
49
+ **Merged pull requests:**
50
+
51
+ - Move cucumber from Gemfile to gemspec [\#230](https://github.com/voxpupuli/modulesync/pull/230) ([bastelfreak](https://github.com/bastelfreak))
52
+ - switch to https link in gemspec [\#228](https://github.com/voxpupuli/modulesync/pull/228) ([bastelfreak](https://github.com/bastelfreak))
53
+ - dont install octokit via Gemfile [\#227](https://github.com/voxpupuli/modulesync/pull/227) ([bastelfreak](https://github.com/bastelfreak))
54
+ - Allow latest aruba dependency [\#226](https://github.com/voxpupuli/modulesync/pull/226) ([bastelfreak](https://github.com/bastelfreak))
55
+
56
+ ## [2.1.1](https://github.com/voxpupuli/modulesync/tree/2.1.1) (2021-06-15)
57
+
58
+ [Full Changelog](https://github.com/voxpupuli/modulesync/compare/2.1.0...2.1.1)
59
+
60
+ The 2.1.0 release didn't make it to github packages. 2.1.1 is a new release with identical code.
61
+
5
62
  ## [2.1.0](https://github.com/voxpupuli/modulesync/tree/2.1.0) (2021-06-15)
6
63
 
7
64
  [Full Changelog](https://github.com/voxpupuli/modulesync/compare/2.0.2...2.1.0)
@@ -26,6 +83,7 @@ All notable changes to this project will be documented in this file.
26
83
 
27
84
  **Closed issues:**
28
85
 
86
+ - PR/MR feature should honor the repository default branch name as target branch [\#207](https://github.com/voxpupuli/modulesync/issues/207)
29
87
  - Add linting \(rubocop\) to Travis CI configuration [\#153](https://github.com/voxpupuli/modulesync/issues/153)
30
88
  - Language sensitive GIT handling [\#85](https://github.com/voxpupuli/modulesync/issues/85)
31
89
 
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
  """