Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.96 KB | None | 0 0
  1. from jira import JIRA
  2. import git
  3.  
  4. username = 'almamgr'
  5. password = 'c0blmf!'
  6. host_bb = 'https://bitbucket.sco.alma.cl/'
  7. host_jira = 'https://ictjira.alma.cl/'
  8. local_repo_path = '~/workspace/alma/CURRENTLY_MOD/git/almasw'
  9.  
  10. integration_branch = 'remotes/origin/testing/2018JAN'
  11.  
  12. print "Checking if JIRA tickets were merged integration branch \"%s\"" % integration_branch
  13.  
  14. jira = JIRA(server=host_jira, basic_auth=(username, password))
  15.  
  16. issues = jira.search_issues('fixVersion = ONLINE-2018JAN AND component = "10 Telescope Calibration (TelCal)" AND status = Implemented')
  17.  
  18. branch_lists = [issue.fields.customfield_11300 for issue in issues]
  19.  
  20. unique_branches = set()
  21. for branch_list in branch_lists:
  22.     for branch in branch_list:
  23.         unique_branches.add(branch)
  24.  
  25. repo = git.Repo(local_repo_path).git
  26.  
  27. merged_branches = repo.branch('-a', '--merged', integration_branch)
  28.  
  29. for branch in unique_branches:
  30.     print "%s: %s" % (branch, branch in merged_branches)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement