Skip to content

Commit

Permalink
Make release note from JIRA and Github
Browse files Browse the repository at this point in the history
  • Loading branch information
wiibaa committed Mar 11, 2013
1 parent 908e0fd commit 524bd90
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,27 @@ sync-jira-components: $(addprefix create/jiracomponent/,$(subst lib/logstash/,,$
$(QUIET)rm tmp_jira_action_list

create/jiracomponent/%:
$(QUIET)echo "--action addComponent --project LOGSTASH --name $(subst create/jiracomponent/,,$@)" >> tmp_jira_action_list
$(QUIET)echo "--action addComponent --project LOGSTASH --name $(subst create/jiracomponent/,,$@)" >> tmp_jira_action_list

## Release note section (up to you if/how/when to integrate in docs)
# Collect the details of:
# - merged pull request from GitHub since last release
# - issues for FixVersion from JIRA

# Note on used Github logic
# We parse the commit between the last tag (should be the last release) and HEAD
# to extract all the notice about merged pull requests.

# Note on used JIRA release note URL
# The JIRA Release note list all issues (even open ones)
# with Fix Version assigned to target version
# So one must verify manually that there is no open issue left (TODO use JIRACLI)

# This is the ID for a version item in jira, can be obtained by CLI
# or through the Version URL https://logstash.jira.com/browse/LOGSTASH/fixforversion/xxx
JIRA_VERSION_ID=10820

releaseNote:
-$(QUIET)rm releaseNote.html
$(QUIET)curl -si "https://logstash.jira.com/secure/ReleaseNote.jspa?version=$(JIRA_VERSION_ID)&projectId=10020" | sed -n '/<textarea.*>/,/<\/textarea>/p' | grep textarea -v >> releaseNote.html
$(QUIET)ruby pull_release_note.rb
25 changes: 25 additions & 0 deletions pull_release_note.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
require "octokit"


@repository= "logstash/logstash"
@releaseNote= "releaseNote.html"

#Last release == last tag
lastReleaseSha = Octokit.tags(@repository).first.commit.sha

currentReleaseSha ="HEAD"

#Collect PR Merge in a file
File.open(@releaseNote, "a") do |f|
f.puts "<h2>Merged pull request</h2>"
f.puts "<ul>"
Octokit.compare(@repository, lastReleaseSha, currentReleaseSha).commits.each do |commit|
if commit.commit.message.start_with?("Merge pull")
scan_re = Regexp.new(/^Merge pull request #(\d+) from ([^\/]+)\/.*\n\n(.*)/)
commit.commit.message.scan(scan_re) do |pullNumber, user, summary|
f.puts "<li><a href='https://github.com/logstash/logstash/pull/#{pullNumber}'>Pull ##{pullNumber}<a> by #{user}: #{summary}</li>"
end
end
end
f.puts "</ul>"
end

0 comments on commit 524bd90

Please sign in to comment.