Skip to content

Commit 79a2f93

Browse files
authored
Merge pull request #547 from puppetlabs/maint-remove-github-changelog-gem-footprint
(MAINT) - Remove github_changelog gem footprint
2 parents d13288a + e0fc78f commit 79a2f93

File tree

1 file changed

+0
-95
lines changed

1 file changed

+0
-95
lines changed

moduleroot/Rakefile.erb

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ require 'bundler'
1515
require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus'
1616
require 'puppetlabs_spec_helper/rake_tasks'
1717
require 'puppet-syntax/tasks/puppet-syntax'
18-
require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator'
1918
require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings'
2019
<% if ! @configs['requires'].nil? -%>
2120
<% @configs['requires'].each do |item| -%>
@@ -28,40 +27,6 @@ import '<%= item %>'
2827
<% end -%>
2928
<% end -%>
3029

31-
def changelog_user
32-
return unless Rake.application.top_level_tasks.include? "changelog"
33-
returnVal = <%= @configs['changelog_user'].inspect -%> || JSON.load(File.read('metadata.json'))['author']
34-
raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil?
35-
puts "GitHubChangelogGenerator user:#{returnVal}"
36-
returnVal
37-
end
38-
39-
def changelog_project
40-
return unless Rake.application.top_level_tasks.include? "changelog"
41-
42-
returnVal = <%= @configs['changelog_project'].inspect -%>
43-
44-
returnVal ||= begin
45-
metadata_source = JSON.load(File.read('metadata.json'))['source']
46-
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})
47-
48-
metadata_source_match && metadata_source_match[1]
49-
end
50-
51-
raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?
52-
53-
puts "GitHubChangelogGenerator project:#{returnVal}"
54-
returnVal
55-
end
56-
57-
def changelog_future_release
58-
return unless Rake.application.top_level_tasks.include? "changelog"
59-
returnVal = <%= @configs['changelog_version_tag_pattern'].inspect -%> % JSON.load(File.read('metadata.json'))['version']
60-
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
61-
puts "GitHubChangelogGenerator future_release:#{returnVal}"
62-
returnVal
63-
end
64-
6530
<% checks = @configs['default_disabled_lint_checks'] + ( @configs['extra_disabled_lint_checks'] || [] ) -%>
6631
<% checks.each do |check| -%>
6732
PuppetLint.configuration.send('disable_<%= check %>')
@@ -76,63 +41,3 @@ PuppetLint.configuration.send('<%= option %>')
7641
<% if @configs['linter_exclusions'] -%>
7742
PuppetLint.configuration.ignore_paths = <%= @configs['linter_exclusions']%>
7843
<% end -%>
79-
80-
81-
if Gem.loaded_specs.key? 'github_changelog_generator'
82-
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
83-
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?
84-
<% if @configs['github_site'] -%>
85-
config.github_site = <%= @configs['github_site'].inspect %>
86-
<% end -%>
87-
<% if @configs['github_endpoint'] -%>
88-
config.github_endpoint = <%= @configs['github_endpoint'].inspect %>
89-
<% end -%>
90-
config.user = "#{changelog_user}"
91-
config.project = "#{changelog_project}"
92-
<% if @configs['changelog_since_tag'] -%>
93-
config.since_tag = <%= @configs['changelog_since_tag'].inspect %>
94-
<% end -%>
95-
<% if @configs['changelog_max_issues'] -%>
96-
config.max_issues = <%= @configs['changelog_max_issues'].inspect %>
97-
<% end -%>
98-
config.future_release = "#{changelog_future_release}"
99-
config.exclude_labels = ['maintenance']
100-
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)."
101-
config.add_pr_wo_labels = true
102-
config.issues = false
103-
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
104-
config.configure_sections = {
105-
"Changed" => {
106-
"prefix" => "### Changed",
107-
"labels" => ["backwards-incompatible"],
108-
},
109-
"Added" => {
110-
"prefix" => "### Added",
111-
"labels" => ["enhancement", "feature"],
112-
},
113-
"Fixed" => {
114-
"prefix" => "### Fixed",
115-
"labels" => ["bug", "documentation", "bugfix"],
116-
},
117-
}
118-
end
119-
else
120-
desc 'Generate a Changelog from GitHub'
121-
task :changelog do
122-
raise <<EOM
123-
The changelog tasks depends on recent features of the github_changelog_generator gem.
124-
Please manually add it to your .sync.yml for now, and run `pdk update`:
125-
---
126-
Gemfile:
127-
optional:
128-
':development':
129-
- gem: 'github_changelog_generator'
130-
version: '~> 1.15'
131-
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
132-
EOM
133-
end
134-
end
135-
136-
<%- [@configs['extras']].flatten.compact.each do |line| -%>
137-
<%= line %>
138-
<%- end -%>

0 commit comments

Comments
 (0)