Skip to content

Commit 1b1c22f

Browse files
authored
Merge pull request #599 from puppetlabs/pdksync_maint-pdk-update
pdksync - (MAINT) PDK Update
2 parents d75537a + a1d473c commit 1b1c22f

File tree

5 files changed

+6
-92
lines changed

5 files changed

+6
-92
lines changed

.rubocop.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ require:
33
- rubocop-performance
44
- rubocop-rspec
55
AllCops:
6+
NewCops: enable
67
DisplayCopNames: true
78
TargetRubyVersion: '2.6'
89
Include:
@@ -18,6 +19,7 @@ AllCops:
1819
- "**/Puppetfile"
1920
- "**/Vagrantfile"
2021
- "**/Guardfile"
22+
inherit_from: ".rubocop_todo.yml"
2123
Layout/LineLength:
2224
Description: People have wide screens, use them.
2325
Max: 200
@@ -71,7 +73,6 @@ Style/TrailingCommaInArrayLiteral:
7173
Style/SymbolArray:
7274
Description: Using percent style obscures symbolic intent of array's contents.
7375
EnforcedStyle: brackets
74-
inherit_from: ".rubocop_todo.yml"
7576
RSpec/MessageSpies:
7677
EnforcedStyle: receive
7778
Style/Documentation:

.sync.yml

+1-8
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@
22
".gitlab-ci.yml":
33
delete: true
44
".rubocop.yml":
5-
default_configs:
6-
inherit_from: ".rubocop_todo.yml"
5+
include_todos: true
76
appveyor.yml:
87
delete: true
9-
10-
Gemfile:
11-
optional:
12-
":development":
13-
- gem: github_changelog_generator
14-
version: '= 1.15.2'
158
Rakefile:
169
changelog_user: puppetlabs
1710
spec/spec_helper.rb:

Gemfile

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ group :development do
2323
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
2424
gem "facterdb", '~> 1.18', require: false
2525
gem "metadata-json-lint", '~> 3.0', require: false
26-
gem "puppetlabs_spec_helper", '~> 7.0', require: false
26+
gem "puppetlabs_spec_helper", '~> 6.0', require: false
2727
gem "rspec-puppet-facts", '~> 2.0', require: false
2828
gem "codecov", '~> 0.2', require: false
2929
gem "dependency_checker", '~> 1.0.0', require: false
@@ -36,15 +36,14 @@ group :development do
3636
gem "rubocop-rspec", '= 2.19.0', require: false
3737
gem "puppet-strings", '~> 4.0', require: false
3838
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
39-
gem "github_changelog_generator", '= 1.15.2', require: false
4039
end
4140
group :system_tests do
4241
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
4342
gem "serverspec", '~> 2.41', require: false
4443
end
4544
group :release_prep do
4645
gem "puppet-strings", '~> 4.0', require: false
47-
gem "puppetlabs_spec_helper", '~> 7.0', require: false
46+
gem "puppetlabs_spec_helper", '~> 6.0', require: false
4847
end
4948

5049
puppet_version = ENV['PUPPET_GEM_VERSION']

Rakefile

-79
Original file line numberDiff line numberDiff line change
@@ -4,85 +4,6 @@ require 'bundler'
44
require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus'
55
require 'puppetlabs_spec_helper/rake_tasks'
66
require 'puppet-syntax/tasks/puppet-syntax'
7-
require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator'
87
require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
98

10-
def changelog_user
11-
return unless Rake.application.top_level_tasks.include? "changelog"
12-
returnVal = "puppetlabs" || JSON.load(File.read('metadata.json'))['author']
13-
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil?
14-
puts "GitHubChangelogGenerator user:#{returnVal}"
15-
returnVal
16-
end
17-
18-
def changelog_project
19-
return unless Rake.application.top_level_tasks.include? "changelog"
20-
21-
returnVal = nil
22-
returnVal ||= begin
23-
metadata_source = JSON.load(File.read('metadata.json'))['source']
24-
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})
25-
26-
metadata_source_match && metadata_source_match[1]
27-
end
28-
29-
raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?
30-
31-
puts "GitHubChangelogGenerator project:#{returnVal}"
32-
returnVal
33-
end
34-
35-
def changelog_future_release
36-
return unless Rake.application.top_level_tasks.include? "changelog"
37-
returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version']
38-
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
39-
puts "GitHubChangelogGenerator future_release:#{returnVal}"
40-
returnVal
41-
end
42-
439
PuppetLint.configuration.send('disable_relative')
44-
45-
46-
if Gem.loaded_specs.key? 'github_changelog_generator'
47-
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
48-
raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil?
49-
config.user = "#{changelog_user}"
50-
config.project = "#{changelog_project}"
51-
config.future_release = "#{changelog_future_release}"
52-
config.exclude_labels = ['maintenance']
53-
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. 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)."
54-
config.add_pr_wo_labels = true
55-
config.issues = false
56-
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
57-
config.configure_sections = {
58-
"Changed" => {
59-
"prefix" => "### Changed",
60-
"labels" => ["backwards-incompatible"],
61-
},
62-
"Added" => {
63-
"prefix" => "### Added",
64-
"labels" => ["enhancement", "feature"],
65-
},
66-
"Fixed" => {
67-
"prefix" => "### Fixed",
68-
"labels" => ["bug", "documentation", "bugfix"],
69-
},
70-
}
71-
end
72-
else
73-
desc 'Generate a Changelog from GitHub'
74-
task :changelog do
75-
raise <<EOM
76-
The changelog tasks depends on recent features of the github_changelog_generator gem.
77-
Please manually add it to your .sync.yml for now, and run `pdk update`:
78-
---
79-
Gemfile:
80-
optional:
81-
':development':
82-
- gem: 'github_changelog_generator'
83-
version: '~> 1.15'
84-
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
85-
EOM
86-
end
87-
end
88-

metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@
8080
}
8181
],
8282
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
83-
"template-ref": "heads/main-0-g6916572",
83+
"template-ref": "heads/main-0-g79a2f93",
8484
"pdk-version": "3.0.0"
8585
}

0 commit comments

Comments
 (0)