Ejemplo n.º 1
0
    def process(self, assigner, assignee, build_number, issue, title, apk_path, squashed_branch):
        hipchat_assigner = user_db.get_user_for_service(assigner, 'hipchat')
        hipchat_assignee = user_db.get_user_for_service(assignee, 'hipchat')
        jenkins_job_url = builder_tool.get_build_path(build_number)
        jira_issue_url = issue_tracker_tool.get_issue_url(issue.key)
        issue_tracker_tool.comment_issue(issue.key, "Build {0}, [Download Link|{1}]".format(build_number, apk_path))
        im_tool.send_message(hipchat_assigner, "Build {0} ({1}) is successful, listing MRs... [{2}, {3}]".format(build_number, issue, jenkins_job_url, jira_issue_url))
        im_tool.send_message(hipchat_assignee, "Build {0} ({1}) is successful, MRs are coming your way... [{2}, {3}]".format(build_number, issue, jenkins_job_url, jira_issue_url))

        def open_mr():
            git_tool.fetch(['master'])
            if git_tool.is_branch_diverged('origin/master'):
                mr = cr_tool.create_mr(git_tool.get_repo(), squashed_branch, assignee, "WIP: "+title)
                cr_tool.approve_build(git_tool.get_repo(), squashed_branch, build_number)


                im_tool.send_message(hipchat_assigner, "MR {0} has been assigned to @{1}".format(mr, hipchat_assignee))
                im_tool.send_message(hipchat_assignee, "Hey, @{0} sent you a MR to review: {1}".format(hipchat_assigner, mr))
                return mr, None
            return None, None


        resolve_errors(git_tool.recurse_submodules(open_mr), title="Opening MRs...")
        update_jira(partial(issue_tracker_tool.send_to_cr, issue.key, user_db.get_user_for_service(assignee, 'jira')),
                    'Requested code review')
Ejemplo n.º 2
0
 def process(self, assigner, assignee, build_number, issue, title, apk_path, squashed_branch):
     print "Sending notification to initiator"
     jenkins_job_url = builder_tool.get_build_path(build_number)
     jira_issue_url = issue_tracker_tool.get_issue_url(issue.key)
     issue_tracker_tool.comment_issue(issue.key, "Build {0}, [Download Link|{1}]".format(build_number, apk_path))
     hipchat_assigner = user_db.get_user_for_service(assigner, 'hipchat')
     im_tool.send_message(hipchat_assigner, "Build {0} ({1}) is successful, you can either wait for tests to finish, or be hasty and land it now! [{2}, {3}]"
                               .format(build_number, issue, jenkins_job_url, jira_issue_url))