Skip to content

Commit 1da5696

Browse files
committed
PDK update
1 parent d2331bf commit 1da5696

File tree

4 files changed

+4
-85
lines changed

4 files changed

+4
-85
lines changed

.sync.yml

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ Gemfile:
1010
optional:
1111
":development":
1212
- gem: ruby-pwsh
13-
- gem: github_changelog_generator
14-
version: '= 1.15.2'
1513
- gem: mocha
1614
version: '< 1.2.0'
1715
":system_tests":

Gemfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +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", '~> 6.0', require: false
2627
gem "rspec-puppet-facts", '~> 2.0', require: false
2728
gem "codecov", '~> 0.2', require: false
2829
gem "dependency_checker", '~> 1.0.0', require: false
@@ -33,9 +34,9 @@ group :development do
3334
gem "rubocop", '= 1.48.1', require: false
3435
gem "rubocop-performance", '= 1.16.0', require: false
3536
gem "rubocop-rspec", '= 2.19.0', require: false
37+
gem "puppet-strings", '~> 4.0', require: false
3638
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
3739
gem "ruby-pwsh", require: false
38-
gem "github_changelog_generator", '= 1.15.2', require: false
3940
gem "mocha", '< 1.2.0', require: false
4041
end
4142
group :system_tests do
@@ -45,7 +46,7 @@ group :system_tests do
4546
end
4647
group :release_prep do
4748
gem "puppet-strings", '~> 4.0', require: false
48-
gem "puppetlabs_spec_helper", '~> 7.0', require: false
49+
gem "puppetlabs_spec_helper", '~> 6.0', require: false
4950
end
5051

5152
puppet_version = ENV['PUPPET_GEM_VERSION']

Rakefile

-80
Original file line numberDiff line numberDiff line change
@@ -4,86 +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 = nil || 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.since_tag = "3.5.0"
52-
config.future_release = "#{changelog_future_release}"
53-
config.exclude_labels = ['maintenance']
54-
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)."
55-
config.add_pr_wo_labels = true
56-
config.issues = false
57-
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
58-
config.configure_sections = {
59-
"Changed" => {
60-
"prefix" => "### Changed",
61-
"labels" => ["backwards-incompatible"],
62-
},
63-
"Added" => {
64-
"prefix" => "### Added",
65-
"labels" => ["enhancement", "feature"],
66-
},
67-
"Fixed" => {
68-
"prefix" => "### Fixed",
69-
"labels" => ["bug", "documentation", "bugfix"],
70-
},
71-
}
72-
end
73-
else
74-
desc 'Generate a Changelog from GitHub'
75-
task :changelog do
76-
raise <<EOM
77-
The changelog tasks depends on recent features of the github_changelog_generator gem.
78-
Please manually add it to your .sync.yml for now, and run `pdk update`:
79-
---
80-
Gemfile:
81-
optional:
82-
':development':
83-
- gem: 'github_changelog_generator'
84-
version: '~> 1.15'
85-
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
86-
EOM
87-
end
88-
end
89-

metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@
6565
],
6666
"pdk-version": "3.0.0",
6767
"template-url": "https://github.com/puppetlabs/pdk-templates.git#main",
68-
"template-ref": "heads/main-0-g01c6a19"
68+
"template-ref": "heads/main-0-g79a2f93"
6969
}

0 commit comments

Comments
 (0)