def main():
    parser = ArgumentParser()
    parser.add_argument("--debug",
                        action="store_true",
                        dest="debug",
                        help="set debug for logging.")

    parser.add_argument("--dry-run",
                        action="store_true",
                        dest="dry_run",
                        help="Dry run. No real actions are taken.")

    parser.add_argument('task_ids',
                        metavar='task_id',
                        type=str,
                        nargs='+',
                        help='Task IDs to work with.')

    options = parser.parse_args()

    if options.debug:
        LOG = setup_logging(logging.DEBUG)
    else:
        LOG = setup_logging()

    sch = TaskclusterSchedulingClient()
    for t_id in options.task_ids:
        ret_code = sch.retrigger(uuid=t_id, dry_run=options.dry_run)
        if ret_code < 0:
            LOG.warning("We could not retrigger task %s" % t_id)
Пример #2
0
def main():
    options = parse_args()
    valid_credentials()

    if options.debug:
        LOG = setup_logging(logging.DEBUG)
    else:
        LOG = setup_logging(logging.INFO)

    if options.rev == 'tip':
        repo_url = query_repo_url(options.repo)
        options.rev = query_repo_tip(repo_url)
        LOG.info("The tip of %s is %s", options.repo, options.rev)

    filters_in = options.includes.split(',') + [options.repo]
    filters_out = []

    if options.exclude:
        filters_out = options.exclude.split(',')

    buildernames = filter_buildernames(filters_in, filters_out,
                                       query_builders())

    if len(buildernames) == 0:
        LOG.info("0 jobs match these filters, please try again.")
        return

    cont = raw_input(
        "%i jobs will be triggered, do you wish to continue? y/n/d (d=show details) "
        % len(buildernames))
    if cont.lower() == 'd':
        LOG.info("The following jobs will be triggered: \n %s" %
                 '\n'.join(buildernames))
        cont = raw_input("Do you wish to continue? y/n ")

    if cont.lower() != 'y':
        exit(1)

    # Setting the QUERY_SOURCE global variable in mozci.py
    set_query_source(options.query_source)

    for buildername in buildernames:
        trigger_range(
            buildername=buildername,
            revisions=[options.rev],
            times=options.times,
            dry_run=options.dry_run,
        )

        LOG.info('https://treeherder.mozilla.org/#/jobs?%s' % urllib.urlencode(
            {
                'repo': query_repo_name_from_buildername(buildername),
                'fromchange': options.rev,
                'tochange': options.rev,
                'filter-searchStr': buildername
            }))
def main():
    options = parse_args()
    valid_credentials()

    if options.debug:
        LOG = setup_logging(logging.DEBUG)
    else:
        LOG = setup_logging(logging.INFO)

    if options.rev == 'tip':
        repo_url = query_repo_url(options.repo)
        options.rev = query_repo_tip(repo_url)
        LOG.info("The tip of %s is %s", options.repo, options.rev)

    filters_in = options.includes.split(',') + [options.repo]
    filters_out = []

    if options.exclude:
        filters_out = options.exclude.split(',')

    buildernames = filter_buildernames(filters_in, filters_out, query_builders())

    if len(buildernames) == 0:
        LOG.info("0 jobs match these filters, please try again.")
        return

    cont = raw_input("%i jobs will be triggered, do you wish to continue? y/n/d (d=show details) "
                     % len(buildernames))
    if cont.lower() == 'd':
        LOG.info("The following jobs will be triggered: \n %s" % '\n'.join(buildernames))
        cont = raw_input("Do you wish to continue? y/n ")

    if cont.lower() != 'y':
        exit(1)

    # Setting the QUERY_SOURCE global variable in mozci.py
    set_query_source(options.query_source)

    for buildername in buildernames:
        trigger_range(
            buildername=buildername,
            revisions=[options.rev],
            times=options.times,
            dry_run=options.dry_run,
        )

        LOG.info('https://treeherder.mozilla.org/#/jobs?%s' %
                 urllib.urlencode({'repo': query_repo_name_from_buildername(buildername),
                                   'fromchange': options.rev,
                                   'tochange': options.rev,
                                   'filter-searchStr': buildername}))
Пример #4
0
def main():
    parser = ArgumentParser()
    parser.add_argument("--debug",
                        action="store_true",
                        dest="debug",
                        help="set debug for logging.")

    parser.add_argument("--dry-run",
                        action="store_true",
                        dest="dry_run",
                        help="Dry run. No real actions are taken.")

    parser.add_argument("--repo-name",
                        action="store",
                        dest="repo_name",
                        type=str,
                        help="Repository name, e.g. mozilla-inbound.")

    parser.add_argument("--revision",
                        action="store",
                        dest="revision",
                        type=str,
                        help="12-char representing a push.")

    parser.add_argument('builders_graph',
                        metavar='builders_graph',
                        help='Graph of builders in the form of: '
                             'dict(builder: [dep_builders].')

    options = parser.parse_args()

    if options.debug:
        setup_logging(logging.DEBUG)
    else:
        setup_logging()

    mgr = TaskClusterBuildbotManager()
    # XXX: test what happens when we have a bad graph
    mgr.schedule_graph(
        repo_name=options.repo_name,
        revision=options.revision,
        builders_graph=ast.literal_eval(options.builders_graph),
        #  dry_run=options.dry_run
    )
def main():
    global LOG

    options = parse_args()
    bugs = []
    assert options.bug_no or options.test_name, \
        "Either call this with --bug-no or with --test-name"

    if options.debug:
        LOG = setup_logging(logging.DEBUG)

    if options.bug_no:
        bugs.append(options.bug_no)

    if options.test_name:
        buglist = bugzilla.search_for.summary(
            options.test_name).keywords("intermittent-failure").search()
        for bug in buglist:
            bugs.append(bug.id)

    for bug_no in bugs:
        search_dict = search_bug(bug_no)
        generate_cli(search_dict, options.back_revisions, options.times)
def main():
    global LOG

    options = parse_args()
    bugs = []
    assert options.bug_no or options.test_name, \
        "Either call this with --bug-no or with --test-name"

    if options.debug:
        LOG = setup_logging(logging.DEBUG)

    if options.bug_no:
        bugs.append(options.bug_no)

    if options.test_name:
        buglist = bugzilla.search_for.summary(
            options.test_name).keywords("intermittent-failure").search()
        for bug in buglist:
            bugs.append(bug.id)

    for bug_no in bugs:
        search_dict = search_bug(bug_no)
        generate_cli(search_dict, options.back_revisions, options.times)
Пример #7
0
# All the times here are in hours
# These are the times for non-pgo
import requests
import logging
from mozci.mozci import query_repo_url_from_buildername, query_repo_name_from_buildername, \
        trigger_all_talos_jobs, trigger_range, set_query_source
from mozci.query_jobs import TreeherderApi
from mozci.platforms import build_talos_buildernames_for_repo
from mozci.utils import transfer
from thclient import TreeherderClient
from store_alerts import getAlerts, updateAlert
from utils import fetch_json
from mozci.utils.misc import setup_logging
from managed_settings import TBPL_TESTS

LOG = setup_logging(logging.INFO)
# Use memory-saving mode
transfer.MEMORY_SAVING_MODE = True
TIME_TO_BUILD = 2
TIME_TO_TEST = 1
PENDING_TIME = 1
TIME_TO_WAIT = 2
CYCLE_TIME = 0.25
JSON_PUSHES = "%(repo_url)s/json-pushes"
WEEK = 604800
TWO_WEEKS = 1209600
SIXTY_DAYS = 5184000
SIGNATURE_URL = "https://treeherder.mozilla.org/api/project/%s/performance/signatures/?interval=%s"
PERFORMANCE_DATA = "https://treeherder.mozilla.org/api/project/%s/performance/data/?interval=%s&signatures=%s"
OPTION_COLLECTION_HASH = "https://treeherder.mozilla.org/api/optioncollectionhash/"
SUCCESS = 0
   Yes, --dry-run is there for testing the above cli output generated.

3) Remove the --dry-run parameter and actually trigger intermittents via trigger.py script.
"""
import logging
import os

from argparse import ArgumentParser

import bugsy

from mozci.mozci import query_repo_name_from_buildername
from mozci.utils.misc import setup_logging

bugzilla = bugsy.Bugsy()
LOG = setup_logging()


def main():
    global LOG

    options = parse_args()
    bugs = []
    assert options.bug_no or options.test_name, \
        "Either call this with --bug-no or with --test-name"

    if options.debug:
        LOG = setup_logging(logging.DEBUG)

    if options.bug_no:
        bugs.append(options.bug_no)
   Yes, --dry-run is there for testing the above cli output generated.

3) Remove the --dry-run parameter and actually trigger intermittents via trigger.py script.
"""
import logging
import os

from argparse import ArgumentParser

import bugsy

from mozci.mozci import query_repo_name_from_buildername
from mozci.utils.misc import setup_logging

bugzilla = bugsy.Bugsy()
LOG = setup_logging()


def main():
    global LOG

    options = parse_args()
    bugs = []
    assert options.bug_no or options.test_name, \
        "Either call this with --bug-no or with --test-name"

    if options.debug:
        LOG = setup_logging(logging.DEBUG)

    if options.bug_no:
        bugs.append(options.bug_no)
Пример #10
0
def main():
    options = parse_args()
    validate_options(options)
    valid_credentials()

    if options.debug:
        LOG = setup_logging(logging.DEBUG)
    else:
        LOG = setup_logging(logging.INFO)

    # Setting the QUERY_SOURCE global variable in mozci.py
    set_query_source(options.query_source)

    if options.buildernames:
        options.buildernames = sanitize_buildernames(options.buildernames)
        repo_url = query_repo_url_from_buildername(options.buildernames[0])

    if not options.repo_name:
        options.repo_name = query_repo_name_from_buildername(options.buildernames[0])

    if options.rev == 'tip':
        repo_url = query_repo_url(options.repo_name)
        options.rev = query_repo_tip(repo_url)
        LOG.info("The tip of %s is %s", options.repo_name, options.rev)

    if options.coalesced:
        query_api = BuildApi()
        request_ids = query_api.find_all_jobs_by_status(options.repo_name,
                                                        options.rev, COALESCED)
        if len(request_ids) == 0:
            LOG.info('We did not find any coalesced job')
        for request_id in request_ids:
            make_retrigger_request(repo_name=options.repo_name,
                                   request_id=request_id,
                                   dry_run=options.dry_run)

        return

    for buildername in options.buildernames:
        revlist = determine_revlist(
            repo_url=repo_url,
            buildername=buildername,
            rev=options.rev,
            back_revisions=options.back_revisions,
            delta=options.delta,
            from_rev=options.from_rev,
            backfill=options.backfill,
            skips=options.skips,
            max_revisions=options.max_revisions)

        try:
            trigger_range(
                buildername=buildername,
                revisions=revlist,
                times=options.times,
                dry_run=options.dry_run,
                files=options.files,
                trigger_build_if_missing=options.trigger_build_if_missing
            )
        except Exception, e:
            LOG.exception(e)
            exit(1)

        if revlist:
            LOG.info('https://treeherder.mozilla.org/#/jobs?%s' %
                     urllib.urlencode({'repo': options.repo_name,
                                       'fromchange': revlist[-1],
                                       'tochange': revlist[0],
                                       'filter-searchStr': buildername}))