Merge pull request #1772 from chef/adamleff/changelog-updater

Update changelog generator to work from PRs only
This commit is contained in:
Dominik Richter 2017-05-09 13:17:39 +02:00 committed by GitHub
commit d3baf0a96d
4 changed files with 2429 additions and 2439 deletions

File diff suppressed because it is too large Load diff

2371
HISTORICAL_CHANGELOG.md Normal file

File diff suppressed because it is too large Load diff

View file

@ -4,6 +4,7 @@
require 'bundler' require 'bundler'
require 'bundler/gem_tasks' require 'bundler/gem_tasks'
require 'rake/testtask' require 'rake/testtask'
require_relative 'tasks/changelog'
require_relative 'tasks/maintainers' require_relative 'tasks/maintainers'
# The docs tasks rely on ruby-progressbar. If we can't load it, then don't # The docs tasks rely on ruby-progressbar. If we can't load it, then don't
@ -128,14 +129,6 @@ end
# Check the requirements for running an update of this repository. # Check the requirements for running an update of this repository.
def check_update_requirements def check_update_requirements
require_command 'git' require_command 'git'
require_command 'github_changelog_generator', "\n"\
"For more information on how to install it see:\n"\
" https://github.com/skywinder/github-changelog-generator\n"
require_env 'CHANGELOG_GITHUB_TOKEN', "\n"\
"Please configure this token to make sure you can run all commands\n"\
"against GitHub.\n\n"\
"See github_changelog_generator homepage for more information:\n"\
" https://github.com/skywinder/github-changelog-generator\n"
end end
# Show the current version of this gem. # Show the current version of this gem.
@ -144,12 +137,6 @@ task :version do
inspec_version inspec_version
end end
desc 'Generate the changelog'
task :changelog do
require_relative 'lib/inspec/version'
system "github_changelog_generator -u chef -p inspec --future-release v#{Inspec::VERSION} --since-tag 0.7.0"
end
# Update the version of this gem and create an updated # Update the version of this gem and create an updated
# changelog. It covers everything short of actually releasing # changelog. It covers everything short of actually releasing
# the gem. # the gem.

48
tasks/changelog.rb Normal file
View file

@ -0,0 +1,48 @@
# encoding: utf-8
# Copyright:: Copyright (c) 2015 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
begin
require 'github_changelog_generator/task'
require 'mixlib/install'
namespace :changelog do
GitHubChangelogGenerator::RakeTask.new :update do |config|
# Get the version from the "to" environment variable first (as used in the
# bump_version Rake task). If it doesn't exist, use Inspec::VERSION. We can't rely
# on Inspec::VERSION because we may have already "require'd" Inspec by the time
# we've gotten here and the version has been bumped with bump_version.
config.future_release = ENV.fetch('to', "v#{Inspec::VERSION}")
# only generate changelog records for pull requests merged since v1.20.0
# which is the version we started tagging PRs for.
config.since_tag = 'v1.20.0'
# do not include any issues
config.max_issues = 0
config.add_issues_wo_labels = false
# Group PRs by section accordingly
config.enhancement_labels = ['enhancement', 'feature request', 'new feature']
config.bug_labels = ['bug']
config.exclude_labels = ['docs', 'duplicate', 'invalid', 'question', 'wontfix', 'www', 'Exclude From Changelog']
end
end
task changelog: 'changelog:update'
rescue LoadError
puts 'github_changelog_generator is not available.'
end