mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 06:37:19 -04:00
clean up .tailor and tools/check_pull_changelog.rb files as not used anymore.
Fixes #5268
This commit is contained in:
parent
770b49b48f
commit
9021c7d1ba
2 changed files with 0 additions and 97 deletions
8
.tailor
8
.tailor
|
@ -1,8 +0,0 @@
|
|||
Tailor.config do |config|
|
||||
config.file_set '*.rb' do |style|
|
||||
style.indentation_spaces 2, :level => :off
|
||||
style.max_line_length 80, :level => :off
|
||||
style.allow_trailing_line_spaces true, :level => :off
|
||||
style.spaces_after_comma false, :level => :off
|
||||
end
|
||||
end
|
|
@ -1,89 +0,0 @@
|
|||
require "octokit"
|
||||
##
|
||||
# This script will validate that any pull request submitted against a github
|
||||
# repository will contains changes to CHANGELOG file.
|
||||
#
|
||||
# If not the case, an helpful text will be commented on the pull request
|
||||
# If ok, a thanksful message will be commented also containing a @mention to
|
||||
# acts as a trigger for review notification by a human.
|
||||
##
|
||||
|
||||
|
||||
@bot="" # Put here your bot github username
|
||||
@password="" # Put here your bot github password
|
||||
|
||||
@repository="logstash/logstash"
|
||||
@mention="@jordansissel"
|
||||
|
||||
@missing_changelog_message = <<MISSING_CHANGELOG
|
||||
Hello, I'm #{@bot}, I'm here to help you accomplish your pull request submission quest
|
||||
|
||||
You still need to accomplish these tasks:
|
||||
|
||||
* Please add a changelog information
|
||||
|
||||
Also note that your pull request name will appears in the details section
|
||||
of the release notes, so please make it clear
|
||||
MISSING_CHANGELOG
|
||||
|
||||
@ok_changelog_message = <<OK_CHANGELOG
|
||||
You successfully completed the pre-requisite quest (aka updating CHANGELOG)
|
||||
|
||||
Also note that your pull request name will appears in the details section
|
||||
of the release notes, so please make it clear, if not already done.
|
||||
|
||||
#{@mention} Dear master, would you please have a look to this humble request
|
||||
OK_CHANGELOG
|
||||
|
||||
#Connect to Github
|
||||
@client=Octokit::Client.new(:login => @bot, :password => @password)
|
||||
|
||||
|
||||
#For each open pull
|
||||
Octokit.pull_requests(@repository).each do |pull|
|
||||
#Get botComment
|
||||
botComment = nil
|
||||
@client.issue_comments(@repository, pull.number, {
|
||||
:sort => "created",
|
||||
:direction => "desc"
|
||||
}).each do |comment|
|
||||
if comment.user.login == @bot
|
||||
botComment = comment
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if !botComment.nil? and botComment.body.start_with?("[BOT-OK]")
|
||||
#Pull already validated by bot, nothing to do
|
||||
puts "Pull request #{pull.number}, already ok for bot"
|
||||
else
|
||||
#Firt encounter, or previous [BOT-WARN] status
|
||||
#Check for changelog
|
||||
warnOnMissingChangeLog = true
|
||||
@client.pull_request_files(@repository, pull.number).each do |changedFile|
|
||||
if changedFile.filename == "CHANGELOG"
|
||||
if changedFile.additions.to_i > 0
|
||||
#Changelog looks good
|
||||
warnOnMissingChangeLog = false
|
||||
else
|
||||
#No additions, means crazy deletion
|
||||
warnOnMissingChangeLog = true
|
||||
end
|
||||
end
|
||||
end
|
||||
if warnOnMissingChangeLog
|
||||
if botComment.nil?
|
||||
puts "Pull request #{pull.number}, adding bot warning"
|
||||
@client.add_comment(@repository, pull.number, "[BOT-WARN] #{@missing_changelog_message}")
|
||||
else
|
||||
puts "Pull request #{pull.number}, already warned, no changes yet"
|
||||
end
|
||||
else
|
||||
if !botComment.nil?
|
||||
@client.delete_comment(@repository,botComment.id)
|
||||
end
|
||||
puts "Pull request #{pull.number}, adding bot ok"
|
||||
@client.add_comment(@repository, pull.number, "[BOT-OK] #{@ok_changelog_message}")
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue