puppet-modulebuilder 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33cb3f5962a7e27303e5c09116d2352ab060f78b38bb4f0047d0dd76ec7d876a
4
- data.tar.gz: 49b490a39510243d4f85fceff8bc97a74fdd738185e274aea9138b684e35050e
3
+ metadata.gz: 1e3b99ce5da4071720566c77f44583561146cc8eb93f067b46df09b41a496f9a
4
+ data.tar.gz: 8d414dcd3940dc02f5fe0a6580a5b52be4a24e4249869488d7c64816d51e1c25
5
5
  SHA512:
6
- metadata.gz: 22a2c93fb8cfa5db2ca19f7ac3a7a13af606f57e45cf3b72279981e483e515c88da1d0b3a14d2790488143856f1bf03df435d2f21a72414461da8027c51e7d2f
7
- data.tar.gz: 8b2cb7d746ee3cd842d11b6eef82cac646f63aff78928765341ce4b2859e496e8c4f76d38c2c74cde103265cd7c6622d98575844c289a02505476b57ca140248
6
+ metadata.gz: 72f79579ecefd1fa236f084d811b670c62ba06468270fd88689d086d47868e23287e22634e3b0f1aec81463d9fc2c47a6b96b179b1b822305448dd2c45e603a2
7
+ data.tar.gz: 83e3c4375ae4f14be9a27b960042a377debee4479ace71ba697faddac636b1317df151652d087d30d77a8cdff339a73c868195a2831a143bc43468042be8744d
@@ -0,0 +1,17 @@
1
+ version: 2
2
+ updates:
3
+ # raise PRs for gem updates
4
+ - package-ecosystem: bundler
5
+ directory: "/"
6
+ schedule:
7
+ interval: daily
8
+ time: "13:00"
9
+ open-pull-requests-limit: 10
10
+
11
+ # Maintain dependencies for GitHub Actions
12
+ - package-ecosystem: github-actions
13
+ directory: "/"
14
+ schedule:
15
+ interval: daily
16
+ time: "13:00"
17
+ open-pull-requests-limit: 10
@@ -0,0 +1,15 @@
1
+ ## Summary
2
+ Provide a detailed description of all the changes present in this pull request.
3
+
4
+ ## Additional Context
5
+ Add any additional context about the problem here.
6
+ - [ ] Root cause and the steps to reproduce. (If applicable)
7
+ - [ ] Thought process behind the implementation.
8
+
9
+ ## Related Issues (if any)
10
+ Mention any related issues or pull requests.
11
+
12
+ ## Checklist
13
+ - [ ] 🟢 Spec tests.
14
+ - [ ] 🟢 Acceptance tests.
15
+ - [ ] Manually verified.
@@ -1,11 +1,17 @@
1
1
  name: "ci"
2
2
 
3
3
  on:
4
+ push:
5
+ branches:
6
+ - "main"
4
7
  pull_request:
5
8
  branches:
6
9
  - "main"
7
10
  workflow_dispatch:
8
11
 
12
+ env:
13
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
14
+
9
15
  jobs:
10
16
  spec:
11
17
  strategy:
@@ -18,7 +24,7 @@ jobs:
18
24
  - ruby-version: '2.7'
19
25
  puppet_gem_version: '~> 7.0'
20
26
  - ruby_version: '3.2'
21
- puppet_gem_version: 'https://github.com/puppetlabs/puppet' # puppet8'
27
+ puppet_gem_version: '~> 8.0' # puppet8'
22
28
  runs_on:
23
29
  - "ubuntu-latest"
24
30
  - "windows-latest"
@@ -26,6 +32,7 @@ jobs:
26
32
  uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main"
27
33
  secrets: "inherit"
28
34
  with:
35
+ rake_task: "spec:coverage"
29
36
  ruby_version: ${{ matrix.ruby_version }}
30
37
  puppet_gem_version: ${{ matrix.puppet_gem_version }}
31
38
  runs_on: ${{ matrix.runs_on }}
@@ -11,5 +11,5 @@ on:
11
11
  jobs:
12
12
 
13
13
  mend:
14
- uses: "puppetlabs/cat-github-actions/.github/workflows/mend_ruby.yml@main"
14
+ uses: "puppetlabs/cat-github-actions/.github/workflows/tooling_mend_ruby.yml@main"
15
15
  secrets: "inherit"
data/.rubocop.yml CHANGED
@@ -1,18 +1,8 @@
1
+ ---
1
2
  inherit_from: .rubocop_todo.yml
2
3
 
3
- require:
4
- - rubocop-performance
5
- - rubocop-rspec
6
-
7
- AllCops:
8
- Exclude:
9
- - Gemfile
10
- - Rakefile
11
- - spec/fixtures/**/*
12
- - vendor/bundle/**/*
13
- NewCops: enable
14
- SuggestExtensions: false
15
- TargetRubyVersion: '2.7'
4
+ inherit_gem:
5
+ voxpupuli-rubocop: rubocop.yml
16
6
 
17
7
  # Disabled
18
8
  Style/ClassAndModuleChildren:
data/.rubocop_todo.yml CHANGED
@@ -1,46 +1,15 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2023-04-18 09:21:48 UTC using RuboCop version 1.50.2.
3
+ # on 2024-06-28 12:03:58 UTC using RuboCop version 1.64.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
- # This cop supports safe autocorrection (--autocorrect).
11
- # Configuration parameters: Severity, Include.
12
- # Include: **/*.gemspec
13
- Gemspec/RequireMFA:
10
+ Lint/MixedRegexpCaptureTypes:
14
11
  Exclude:
15
- - 'puppet-modulebuilder.gemspec'
16
-
17
- # Offense count: 1
18
- # Configuration parameters: Severity, Include.
19
- # Include: **/*.gemspec
20
- Gemspec/RequiredRubyVersion:
21
- Exclude:
22
- - 'puppet-modulebuilder.gemspec'
23
-
24
- # Offense count: 5
25
- # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
26
- Metrics/AbcSize:
27
- Max: 31
28
-
29
- # Offense count: 1
30
- # Configuration parameters: CountComments, CountAsOne.
31
- Metrics/ClassLength:
32
- Max: 255
33
-
34
- # Offense count: 6
35
- # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
36
- Metrics/MethodLength:
37
- Max: 25
38
-
39
- # Offense count: 1
40
- # Configuration parameters: MinSize.
41
- Performance/CollectionLiteralInLoop:
42
- Exclude:
43
- - 'spec/acceptance/puppet/modulebuilder/builder_spec.rb'
12
+ - 'Gemfile'
44
13
 
45
14
  # Offense count: 4
46
15
  # Configuration parameters: Prefixes, AllowedPatterns.
@@ -82,11 +51,18 @@ RSpec/NamedSubject:
82
51
  RSpec/NestedGroups:
83
52
  Max: 5
84
53
 
85
- # Offense count: 33
54
+ # Offense count: 32
86
55
  RSpec/SubjectStub:
87
56
  Exclude:
88
57
  - 'spec/unit/puppet/modulebuilder/builder_spec.rb'
89
58
 
59
+ # Offense count: 1
60
+ # This cop supports safe autocorrection (--autocorrect).
61
+ # Configuration parameters: AllowedVars.
62
+ Style/FetchEnvVar:
63
+ Exclude:
64
+ - 'Gemfile'
65
+
90
66
  # Offense count: 9
91
67
  # This cop supports safe autocorrection (--autocorrect).
92
68
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
data/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
 
6
6
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
7
7
 
8
+ ## [v1.1.0](https://github.com/puppetlabs/puppet-modulebuilder/tree/v1.1.0) - 2024-09-17
9
+
10
+ [Full Changelog](https://github.com/puppetlabs/puppet-modulebuilder/compare/v1.0.0...v1.1.0)
11
+
12
+ ### Added
13
+
14
+ - Use Dir.glob with base parameter in acceptance tests [#93](https://github.com/puppetlabs/puppet-modulebuilder/pull/93) ([ekohl](https://github.com/ekohl))
15
+
16
+ ### Fixed
17
+
18
+ - (CAT-1688) Upgrade rubocop to `~> 1.50.0` [#70](https://github.com/puppetlabs/puppet-modulebuilder/pull/70) ([LukasAud](https://github.com/LukasAud))
19
+
8
20
  ## [v1.0.0](https://github.com/puppetlabs/puppet-modulebuilder/tree/v1.0.0) - 2023-04-25
9
21
 
10
22
  [Full Changelog](https://github.com/puppetlabs/puppet-modulebuilder/compare/v1.0.0.rc.1...v1.0.0)
@@ -14,6 +26,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
14
26
  [Full Changelog](https://github.com/puppetlabs/puppet-modulebuilder/compare/v0.3.0...v1.0.0.rc.1)
15
27
 
16
28
  ### Changed
29
+
17
30
  - (CONT-881) Ruby 3 / Puppet 8 Support [#50](https://github.com/puppetlabs/puppet-modulebuilder/pull/50) ([chelnak](https://github.com/chelnak))
18
31
 
19
32
  ## [v0.3.0](https://github.com/puppetlabs/puppet-modulebuilder/tree/v0.3.0) - 2021-05-17
data/CODEOWNERS CHANGED
@@ -1 +1,2 @@
1
- * @puppetlabs/modules
1
+ # Setting ownership to the tooling team
2
+ * @puppetlabs/devx
data/Gemfile CHANGED
@@ -6,8 +6,8 @@ source 'https://rubygems.org'
6
6
  gemspec
7
7
 
8
8
  def location_for(place_or_version, fake_version = nil)
9
- git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
10
- file_url_regex = %r{\Afile:\/\/(?<path>.*)}
9
+ git_url_regex = /\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?/
10
+ file_url_regex = %r{\Afile://(?<path>.*)}
11
11
 
12
12
  if place_or_version && (git_url = place_or_version.match(git_url_regex))
13
13
  [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
@@ -24,15 +24,9 @@ group :development do
24
24
  gem 'rake'
25
25
  gem 'rspec', '~> 3.1'
26
26
 
27
- gem 'rubocop', '~> 1.48', require: false
28
- gem 'rubocop-performance', '~> 1.16', require: false
29
- gem 'rubocop-rspec', '~> 2.19', require: false
30
-
31
- gem 'codecov'
32
27
  gem 'simplecov'
33
28
  gem 'simplecov-console'
34
29
 
35
-
36
30
  # Required for testing on Windows
37
- gem 'ffi', :platforms => [:x64_mingw]
31
+ gem 'ffi', platforms: [:x64_mingw]
38
32
  end
data/README.md CHANGED
@@ -1,18 +1,65 @@
1
1
  # Puppet::Modulebuilder
2
2
 
3
+ [![Code Owners](https://img.shields.io/badge/owners-DevX--team-blue)](https://github.com/puppetlabs/puppet-modulebuilder/blob/main/CODEOWNERS)
4
+ ![ci](https://github.com/puppetlabs/puppet-modulebuilder/actions/workflows/ci.yml/badge.svg)
5
+ ![GitHub release (latest by date)](https://img.shields.io/github/v/release/puppetlabs/puppet-modulebuilder)
6
+
7
+ ## Table of Contents
8
+
9
+ 1. [Overview - What is Puppet::Modulebuilder?](#overview)
10
+ 2. [Description - What does the gem do?](#description)
11
+ 3. [Usage - How can the gem be used?](#usage)
12
+ 4. [Testing - How to test changes to the gem?](#contributing)
13
+ 5. [Contributing - How to contribute to the gem?](#contributing)
14
+ 6. [Development - How to release changes to the gem?](#development)
15
+
16
+ ## Overview
17
+
3
18
  The `puppet-modulebuilder` gem contains the reference implementation for building Puppet modules from source.
4
19
 
20
+ ## Description
21
+
22
+ The purpose of this tool is to take a given local module directory and compile it into a `.tar` file, known as the `tarball`, that can then be installed directly by Puppet on a target machine or uploaded onto the [Puppet Forge](https://forge.puppet.com/) so that it can be accessed publicly.
23
+
24
+ As part of this process any non-deliverable aspects of the module, parts of it related to the modules development or testing for example, are stripped away leaving only the documentation and the puppet/ruby code that is needed for the module to function.
25
+
26
+ The parts of the module to be excluded are defined in a `.pdkignore`, `.pmtignore` or `.gitignore` file with the first one to be found in this given order being used. Any directories or files that are listed in the ignore file are then excluded, allowing the user to customize what is and what is not excluded.
27
+
5
28
  ## Usage
6
29
 
30
+ This gem can be used in one of two ways, the first being to call on it directly as shown in the example below:
31
+
7
32
  ```ruby
8
33
  builder = Puppet::Modulebuilder::Builder.new('./puppetlabs-motd', './pkg', nil)
9
34
  builder.build
10
35
  ```
11
36
 
12
- ## Development
37
+ For conveniances sake the `puppet-modulebuilder` gem has been included within the `PDK` and as such can be called on to run against a module from within it using the build command as shown below:
13
38
 
14
- To release a new version, update the version number in `version.rb`, run `bundle exec rake changelog` and create a mergeback PR with the results. If that passes, run `bundle exec rake 'release[upstream]'`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
39
+ ```bash
40
+ pdk build
41
+ ```
42
+
43
+ ### Testing
44
+
45
+ Acceptance tests for this module leverage [puppet_litmus](https://github.com/puppetlabs/puppet_litmus)
46
+
47
+ ```bash
48
+ bundle exec rake 'litmus:provision[docker, litmusimage/ubuntu:22.04]'
49
+ bundle exec rake 'litmus:install_agent[puppet8-nightly]'
50
+ bundle exec rake 'litmus:install_module'
51
+ ```
15
52
 
16
53
  ## Contributing
17
54
 
18
55
  Bug reports and pull requests are welcome on GitHub at https://github.com/puppetlabs/puppet-modulebuilder.
56
+
57
+ ## License
58
+
59
+ This codebase is licensed under Apache 2.0. However, the open source dependencies included in this codebase might be subject to other software licenses such as AGPL, GPL2.0, and MIT.
60
+
61
+ ## Development
62
+
63
+ To release a new version, simply run the `Release Prep` github action workflow, passing it the desired version, in order to generate a PR containing the necesary changes.
64
+
65
+ Once this PR is merged you can then run the `Release` action in order to build the gem and push it to [rubygems.org](https://rubygems.org).
data/Rakefile CHANGED
@@ -7,8 +7,22 @@ RSpec::Core::RakeTask.new(:spec) do |t|
7
7
  t.pattern = 'spec/unit/**/*_spec.rb'
8
8
  end
9
9
 
10
+ namespace :spec do
11
+ desc 'Run RSpec code examples with coverage collection'
12
+ task :coverage do
13
+ ENV['COVERAGE'] = 'yes'
14
+ Rake::Task['spec'].execute
15
+ end
16
+ end
17
+
10
18
  RSpec::Core::RakeTask.new(:acceptance) do |t|
11
19
  t.pattern = 'spec/acceptance/**/*_spec.rb'
12
20
  end
13
21
 
14
- task default: [:spec, :acceptance]
22
+ task default: %i[spec acceptance]
23
+
24
+ begin
25
+ require 'voxpupuli/rubocop/rake'
26
+ rescue LoadError
27
+ # the voxpupuli-rubocop gem is optional
28
+ end
@@ -13,7 +13,7 @@ module Puppet::Modulebuilder
13
13
  '/checksums.json',
14
14
  '/REVISION',
15
15
  '/spec/fixtures/modules/',
16
- '/vendor/'
16
+ '/vendor/',
17
17
  ].freeze
18
18
 
19
19
  attr_reader :destination, :logger
@@ -65,7 +65,7 @@ module Puppet::Modulebuilder
65
65
  def build_context
66
66
  {
67
67
  parent_dir: destination,
68
- build_dir_name: release_name
68
+ build_dir_name: release_name,
69
69
  }.freeze
70
70
  end
71
71
 
@@ -179,7 +179,7 @@ module Puppet::Modulebuilder
179
179
  @ignore_file ||= [
180
180
  File.join(source, '.pdkignore'),
181
181
  File.join(source, '.pmtignore'),
182
- File.join(source, '.gitignore')
182
+ File.join(source, '.gitignore'),
183
183
  ].find { |file| file_exists?(file) && file_readable?(file) }
184
184
  end
185
185
 
@@ -223,7 +223,7 @@ module Puppet::Modulebuilder
223
223
  tar = Minitar::Output.new(gz)
224
224
  Find.find(build_context[:build_dir_name]) do |entry|
225
225
  entry_meta = {
226
- name: entry
226
+ name: entry,
227
227
  }
228
228
 
229
229
  orig_mode = File.stat(entry).mode
@@ -336,7 +336,7 @@ module Puppet::Modulebuilder
336
336
  def release_name
337
337
  @release_name ||= [
338
338
  metadata['name'],
339
- metadata['version']
339
+ metadata['version'],
340
340
  ].join('-')
341
341
  end
342
342
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Puppet
4
4
  module Modulebuilder
5
- VERSION = '1.0.0'
5
+ VERSION = '1.1.0'
6
6
  end
7
7
  end
@@ -25,7 +25,9 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ['lib']
26
26
  # minitar and pathspec is required for building Puppet modules
27
27
  spec.add_runtime_dependency 'minitar', '~> 0.9'
28
- spec.add_runtime_dependency 'pathspec', '>= 0.2.1', '< 2.0.0'
28
+ spec.add_runtime_dependency 'pathspec', '>= 0.2.1', '< 3.0.0'
29
+
30
+ spec.add_development_dependency 'voxpupuli-rubocop', '~> 2.8.0'
29
31
 
30
32
  spec.required_ruby_version = Gem::Requirement.new('>= 2.7.0')
31
33
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-modulebuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sheena
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-04-25 00:00:00.000000000 Z
12
+ date: 2024-09-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitar
@@ -34,7 +34,7 @@ dependencies:
34
34
  version: 0.2.1
35
35
  - - "<"
36
36
  - !ruby/object:Gem::Version
37
- version: 2.0.0
37
+ version: 3.0.0
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,7 +44,21 @@ dependencies:
44
44
  version: 0.2.1
45
45
  - - "<"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.0.0
47
+ version: 3.0.0
48
+ - !ruby/object:Gem::Dependency
49
+ name: voxpupuli-rubocop
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 2.8.0
55
+ type: :development
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.8.0
48
62
  description:
49
63
  email:
50
64
  - sheena@puppet.com
@@ -53,8 +67,9 @@ executables: []
53
67
  extensions: []
54
68
  extra_rdoc_files: []
55
69
  files:
70
+ - ".github/dependabot.yml"
71
+ - ".github/pull_request_template.md"
56
72
  - ".github/workflows/ci.yml"
57
- - ".github/workflows/labeller.yml"
58
73
  - ".github/workflows/mend.yml"
59
74
  - ".github/workflows/nightly.yml"
60
75
  - ".github/workflows/release.yml"
@@ -1,22 +0,0 @@
1
- name: community-labeller
2
-
3
- on:
4
- issues:
5
- types:
6
- - opened
7
- pull_request_target:
8
- types:
9
- - opened
10
-
11
- jobs:
12
- label:
13
- runs-on: ubuntu-latest
14
- steps:
15
-
16
- - uses: puppetlabs/community-labeller@v0
17
- name: Label issues or pull requests
18
- with:
19
- label_name: community
20
- label_color: '5319e7'
21
- org_membership: puppetlabs
22
- token: ${{ secrets.IAC_COMMUNITY_LABELER }}