Ejemplo n.º 1
0
 def __call__(self, git_gecko, git_wpt):
     logger.info("Running retrigger")
     update_repositories(git_gecko, git_wpt)
     sync_point = landing.load_sync_point(git_gecko, git_wpt)
     prev_wpt_head = sync_point["upstream"]
     unlanded = landing.unlanded_with_type(git_gecko, git_gecko, None,
                                           prev_wpt_head)
     update.retrigger(git_gecko, git_wpt, unlanded)
Ejemplo n.º 2
0
 def __call__(self, git_gecko, git_wpt):
     newrelic.agent.set_transaction_name("RetriggerHandler")
     logger.info("Running retrigger")
     update_repositories(git_gecko, git_wpt)
     sync_point = landing.load_sync_point(git_gecko, git_wpt)
     prev_wpt_head = sync_point["upstream"]
     unlanded = landing.unlanded_with_type(git_gecko, git_gecko, None,
                                           prev_wpt_head)
     update.retrigger(git_gecko, git_wpt, unlanded)
Ejemplo n.º 3
0
def do_retrigger(git_gecko, git_wpt, **kwargs):
    import errors
    import update
    import upstream
    from landing import load_sync_point, unlanded_with_type

    update_repositories(git_gecko, git_wpt, True)

    print("Retriggering upstream syncs with errors")
    for sync in upstream.UpstreamSync.load_all(git_gecko,
                                               git_wpt,
                                               status="open"):
        if sync.error:
            try:
                upstream.update_sync(git_gecko, git_wpt, sync)
            except errors.AbortError as e:
                print("Update failed:\n%s" % e)
                pass

    print("Retriggering downstream syncs on master")
    sync_point = load_sync_point(git_gecko, git_wpt)
    prev_wpt_head = sync_point["upstream"]
    unlandable = unlanded_with_type(git_gecko, git_wpt, None, prev_wpt_head)

    errors = update.retrigger(git_gecko, git_wpt, unlandable)
    if errors:
        print("The following PRs have errors:\n%s" % "\n".join(errors))
Ejemplo n.º 4
0
def do_landable(git_gecko, git_wpt, *args, **kwargs):
    import update
    from base import LandableStatus
    from downstream import DownstreamAction, DownstreamSync
    from landing import load_sync_point, landable_commits, unlanded_with_type

    if kwargs["prev_wpt_head"] is None:
        sync_point = load_sync_point(git_gecko, git_wpt)
        prev_wpt_head = sync_point["upstream"]
        print("Last sync was to commit %s" % sync_point["upstream"])
    else:
        prev_wpt_head = kwargs["prev_wpt_head"]
    landable = landable_commits(
        git_gecko,
        git_wpt,
        prev_wpt_head,
        include_incomplete=kwargs["include_incomplete"])

    if landable is None:
        print("Landing will not add any new commits")
        wpt_head = None
    else:
        wpt_head, commits = landable
        print("Landing will update wpt head to %s, adding %i new PRs" %
              (wpt_head, len(commits)))

    if kwargs["all"] or kwargs["retrigger"]:
        unlandable = unlanded_with_type(git_gecko, git_wpt, wpt_head,
                                        prev_wpt_head)
        count = 0
        for pr, _, status in unlandable:
            count += 1
            msg = status.reason_str()
            if status == LandableStatus.missing_try_results:
                sync = DownstreamSync.for_pr(git_gecko, git_wpt, pr)
                next_action = sync.next_action
                reason = next_action.reason_str()
                if next_action == DownstreamAction.wait_try:
                    latest_try_push = sync.latest_try_push
                    reason = "%s %s" % (reason,
                                        latest_try_push.treeherder_url(
                                            latest_try_push.try_rev))
                msg = "%s (%s)" % (msg, reason)
            elif status == LandableStatus.error:
                sync = DownstreamSync.for_pr(git_gecko, git_wpt, pr)
                msg = "%s (%s)" % (msg, sync.error["message"].split("\n")[0])
            print("%s: %s" % (pr, msg))

        print("%i PRs are unlandable:" % count)

        if kwargs["retrigger"]:
            errors = update.retrigger(git_gecko, git_wpt, unlandable)
            if errors:
                print("The following PRs have errors:\n%s" % "\n".join(errors))
Ejemplo n.º 5
0
def do_retrigger(git_gecko, git_wpt, **kwargs):
    import errors
    import update
    import upstream
    from landing import current, load_sync_point, unlanded_with_type

    update_repositories(git_gecko, git_wpt)

    if kwargs["upstream"]:
        print("Retriggering upstream syncs with errors")
        for sync in upstream.UpstreamSync.load_by_status(
                git_gecko, git_wpt, "open"):
            if sync.error:
                with SyncLock.for_process(sync.process_name) as lock:
                    with sync.as_mut(lock):
                        try:
                            upstream.update_sync(git_gecko,
                                                 git_wpt,
                                                 sync,
                                                 repo_update=False)
                        except errors.AbortError as e:
                            print("Update failed:\n%s" % e)
                            pass

    if kwargs["downstream"]:
        print("Retriggering downstream syncs on master")
        current_landing = current(git_gecko, git_wpt)
        if current_landing is None:
            sync_point = load_sync_point(git_gecko, git_wpt)
            prev_wpt_head = sync_point["upstream"]
        else:
            prev_wpt_head = current_landing.wpt_commits.head.sha1
        unlandable = unlanded_with_type(git_gecko, git_wpt, None,
                                        prev_wpt_head)

        errors = update.retrigger(git_gecko, git_wpt, unlandable)
        if errors:
            print("The following PRs have errors:\n%s" % "\n".join(errors))