Commit f05cc8e2 authored by Ivan Yelizariev's avatar Ivan Yelizariev
Browse files

Merge branch 'master' into 'master'

Master

See merge request !60
parents d6457437 ab44154b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ def process_message(msg_body, required_fields, github_token, git_author=None,
                os.chdir(repo_path)

                Popen(['python', '/home/ec2-user/odoo-devops/tools/porting-bot/scripts/merge.py',
                       base_branch, next_branch, '--auto_resolve' '--auto_push',
                       base_branch, next_branch, '--auto_resolve', '--auto_push',
                       '--author', git_author]).wait()
                write_in_log('merge in branch {} complete'.format(next_branch))

@@ -136,7 +136,7 @@ def process_message(msg_body, required_fields, github_token, git_author=None,
                pr_call_params = ['python', '/home/ec2-user/odoo-devops/tools/porting-bot/scripts/pull-request.py',
                       full_repo_name, next_branch, fork_user, merge_branch,
                       '--github_token', github_token,
                       '--original_pr_title', msg_body['pull_request']['title']]
                       '--original_pr_title', '"{}"'.format(msg_body['pull_request']['title'])]

                if hook_exists is not None:
                    pr_call_params.extend(['--webhook_when_porting_pr_exists', hook_exists])
+11 −11
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ def main():
    parser.add_argument("base_branch", help="Name of branch, in which PR will be made")
    parser.add_argument("forked_user", help="Name of the user who own a fork where branch is located")
    parser.add_argument("head_branch", help="Name of branch, from where PR will be made")
    parser.add_argument("original_pr_title", "name of initial title from which changes are taken. "
    parser.add_argument("--original_pr_title", help="name of initial title from which changes are taken. "
                                             "This param needed for webhook", default='')
    parser.add_argument(
        "--webhook_when_porting_pr_exists",
@@ -70,16 +70,16 @@ def pull_request(github_login, github_password, github_token, base_repo_name, ba
                         body="This is auto merge from {}:{} to {}".format(forked_user, head_branch, base_branch),
                         base=base_branch, head=forked_user + ':' + head_branch)
        write_in_log('pull created')
        # if hook_created is not '':
        #     call(['curl', '-X', 'POST', hook_exists, '-H',
        #           '"Content-Type: application/json"', '-d',
        #           '{"value1":"{}","value2":"{}","value3":"{}"}'.format(
        #               original_pr_title, "Auto merge {}:{}-{}".format(forked_user, head_branch, base_branch), github_login)])

    # elif hook_exists is not '':
    #     call([  'curl', '-X', 'POST', hook_exists, '-H',
    #           '"Content-Type: application/json"', '-d',
    #           '{"value1":"{}","value2":"{}","value3":"{}"}'.format(original_pr_title, existing_pr_title, github_login)])
        if hook_created is not '':
            call(['curl', '-X', 'POST', hook_exists, '-H',
                  '"Content-Type: application/json"', '-d',
                  '{"value1":"{}","value2":"{}","value3":"{}"}'.format(
                      original_pr_title, "Auto merge {}:{}-{}".format(forked_user, head_branch, base_branch), github_login)])

    elif hook_exists is not '':
        call(['curl', '-X', 'POST', hook_exists, '-H',
              '"Content-Type: application/json"', '-d',
              '{"value1":"{}","value2":"{}","value3":"{}"}'.format(original_pr_title, existing_pr_title, github_login)])


def write_in_log(log_message):