Skip to content

Instantly share code, notes, and snippets.

@Iristyle
Forked from ferventcoder/Query_Git_Jira_Commands.sh
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Iristyle/004fd80784a7bb0aa6eb to your computer and use it in GitHub Desktop.
Save Iristyle/004fd80784a7bb0aa6eb to your computer and use it in GitHub Desktop.
3.6.0 FINAL (post RC) commits
git log 3.6.0-rc...HEAD --pretty=format:"%h %s [%an (%ae)]" --no-merges > git.commits.txt
#| grep -v -e "(maint)" -e "(Maint)"
cat git.commits.txt | pbcopy
curl --output "jira.issues.txt" --silent -H "Content-Type: application/json" https://tickets.puppetlabs.com/rest/api/2/search?jql=project=PUP+AND+fixVersion=%223.6.0%22+Order+by+key+ASC&maxResults=300&fields=key,summary
# brew install jq
cat jira.issues.txt | jq '.issues[].key' >jiraissues.txt
# https://gist.githubusercontent.com/hlindberg/9520023/raw/40389c4c20ef3aba939c52db8f280f2ae1c0759a/ticketmatch.rb
ruby ticketmatch.rb
# This script mangles the output from git log between two git references
# and matches this with a list of tickets from Jira.
#
# The List from Jira can be obtained by showing the list of issues for a release
# i.e. a query like this for the given release which gets all targeting the
# release in question:
#
# curl --output "jira.issues.txt" --silent -H "Content-Type: application/json" https://tickets.puppetlabs.com/rest/api/2/search?jql=project=PUP+AND+fixVersion=%223.6.0%22+Order+by+key+ASC&maxResults=300&fields=key,summary
# # brew install jq
# cat jira.issues.txt | jq '.issues[].key' >jiraissues.txt
#
# Then change the from and to in this script to the tags you want to
# compare
#
# You must cd to the puppet git repo for this to work, and place
# the extra files there as well.
#
from = "3.6.0-rc"
to = "HEAD"
# Get the log from git
# process and store in a hash per user entered ticket reference
#
result = Hash.new {|h, k| h[k] = [] }
a = %x{git log --no-merges --pretty=format:"%h %s [%an (%ae)]" --no-merges #{from}..#{to}}
a.each_line do |line|
m = line.match(/^([0-9a-fA-F]+)\s+(\([^\)]*\))?(.*)$/)
result[(m[2] || 'unmarked').upcase] << [m[1], m[3]]
end
# Process file with Jira issues
jiratext = File.read('jiraissues.txt')
known_issues = jiratext.each_line.reduce({}) {|memo, line| memo["(#{line.chomp.gsub(/\"/, '')})"] = true; memo }
# Print list of ssues sorted, for each show sha + comment after reference
#
result.keys.sort.each do |k|
if known_issues[k]
marker = '--'
known_issues[k] = :in_git
else
marker = '**'
end
puts "#{marker} #{k.upcase}"
v = result[k]
v.each do | data |
puts " #{data[0]} #{data[1]}"
end
end
puts "---"
puts "ISSUES NOT FOUND IN GIT"
puts known_issues.select {|k,v| v != :in_git }.keys.join("\n")
** (MAINT)
d72f9e8 Update beaker to 1.11.0 [Kylo Ginsberg (kylo@puppetlabs.com)]
c3b414c Include 'f' prefix for fedora paths in the builds repo [Josh Partlow (joshua.partlow@puppetlabs.com)]
b29e608 Whitespace fixup in ext/debian/puppetmaster-passenger.postinst [Matthaus Owens (matthaus@puppetlabs.com)]
64fc465 Fix two spec tests to be robust when running in a path with parens [Kylo Ginsberg (kylo@puppetlabs.com)]
** (PACKAGING)
fea22be Update PUPPETVERSION to 3.6.0 [Iristyle (Iristyle@github)]
** (PUP-2010)
d57c601 have test repos pushed to hosts during acceptance testing [Alice Nodelman (alice@puppetlabs.com)]
** (PUP-2339)
4ec61ee Modify $GEM_SOURCE for CI bootstrap [Roger Ignazio (roger@puppetlabs.com)]
** (PUP-2395)
af23bb3 Update puppetmaster-passenger postinst for passenger 4 [Matthaus Owens (matthaus@puppetlabs.com)]
f1e7f67 Refactor puppetmaster-postinst sed calls [Matthaus Owens (matthaus@puppetlabs.com)]
89c4e12 Update puppetmaster-passenger for httpd 2.4 [Matthaus Owens (matthaus@puppetlabs.com)]
d4551d4 Add apache2 dependency to puppetmaster-passenger [Matthaus Owens (matthaus@puppetlabs.com)]
** (PUP-2484)
af201c9 Ensure that Modulefile dependencies are properly serialized. [Pieter van de Bruggen (pvande@gmail.com)]
b56776c Revert to merging Modulefile and metadata.json in PMT build. [Pieter van de Bruggen (pvande@gmail.com)]
** (PUP-2561)
66c7ec9 Fix spec test on windows [Kylo Ginsberg (kylo@puppetlabs.com)]
be37df4 Remove the now obsolete ‘mode’ argument to ::execpipe. [Pieter van de Bruggen (pvande@gmail.com)]
02ba25f Revert to using UNIX pipes in PMT’s tar operations. [Pieter van de Bruggen (pvande@gmail.com)]
** (PUP-2562)
fdcf466 Remove uses of unsupported range syntax from Semantic. [Pieter van de Bruggen (pvande@gmail.com)]
c906676 Remove uses of unsupported range syntax in PMT. [Pieter van de Bruggen (pvande@gmail.com)]
---
ISSUES NOT FOUND IN GIT
(PUP-1060) - merged into master at https://github.com/puppetlabs/puppet/commit/8aaa17e609a4b2aa0865dbdc7f915544e622f868
prior to merge into stable
@Iristyle
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment