Beispiel #1
0
    url = '%s%s/%s/comments.xml' % (apiBaseUrl, 'cards', mingle_id)
    # the first comment is already used in the summary of the mingle card.
    comments = comments.get('comments')[1:]
    for comment in comments:
        payload = {'comment[content]': '%s\n#%s' % (
            comment.get('text'), mingle_id)}
        response = requests.post(url,
                                 data=payload,
                                 auth=(auth.get(
                                       'username'), auth.get('password')),
                                 headers=headers)


if __name__ == "__main__":
    bingle = Bingle(debug=debug, picklePath=picklePath)
    bingle.info("Pretend mode: %s" % options.pretend)

    # prepare Mingle instance
    mingle = Mingle(auth, apiBaseUrl)

    fromTime = bingle.getTimeFromPickle()
    bugzillaPayload = {'method': 'Bug.search', 'params': json.dumps([{
        'product': product,
        'component': component,
        'status': ['UNCONFIRMED', 'NEW'],
        'last_change_time': fromTime,
    }])}
    for bug in bingle.getBugEntries(bugzillaPayload):
        bingle.info("Bug XML: %s" % bug)

        bugCardName = bingle.generateBugCardName(
Beispiel #2
0
    # the first comment is already used in the summary of the mingle card.
    comments = comments.get('comments')[1:]
    for comment in comments:
        payload = {
            'comment[content]': '%s\n#%s' % (comment.get('text'), mingle_id)
        }
        response = requests.post(url,
                                 data=payload,
                                 auth=(auth.get('username'),
                                       auth.get('password')),
                                 headers=headers)


if __name__ == "__main__":
    bingle = Bingle(debug=debug, picklePath=picklePath)
    bingle.info("Pretend mode: %s" % options.pretend)

    # prepare Mingle instance
    mingle = Mingle(auth, apiBaseUrl)

    fromTime = bingle.getTimeFromPickle()
    bugzillaPayload = {
        'method':
        'Bug.search',
        'params':
        json.dumps([{
            'product': product,
            'component': component,
            'status': ['UNCONFIRMED', 'NEW'],
            'last_change_time': fromTime,
        }])
Beispiel #3
0

if __name__ == "__main__":
    # config overrides
    config = ConfigParser.ConfigParser()
    config.read(options.config)
    picklePath = config.get('paths', 'picklePath') + '_resolved'
    statusResolved = config.get('bingle', 'statusResolved')
    mingleStatusField = config.get('bingle', 'mingleStatusField')
    mingleResolvedStatus = config.get('bingle', 'mingleResolvedStatus')
    mingleIterationPropertyName = config.get('bingle',
                                             'mingleIterationPropertyName')
    mingleResolvedIteration = config.get('bingle', 'mingleResolvedIteration')
    mingleIgnoreResolved = [
        item.strip()
        for item in config.get('bingle', 'mingleIgnoreResolved').split(',')
    ]

    bingle = Bingle(debug=debug, picklePath=picklePath)
    bingle.info("Pretend mode: %s" % options.pretend)
    bingle.info("Ignoring bugs in: %s" % mingleIgnoreResolved)

    # prepare Mingle instance
    mingle = Mingle(auth, apiBaseUrl)

    fromTime = bingle.getTimeFromPickle()
    execute(standalone=True,
            pretend=options.pretend,
            bingle=bingle,
            mingle=mingle)
Beispiel #4
0
    picklePath = config.get('paths', 'picklePath') + '_resolved'
    apiBaseUrl = config.get('urls', 'mingleApiBase')
    mingleUrlBase = config.get('urls', 'mingleUrlBase')
    bugCard = config.get('mingle', 'bugCard')
    bugIdFieldName = config.get('mingle', 'bugIdFieldName')
    product = config.get('bugzilla', 'product').split(',')
    component = config.get('bugzilla', 'component').split(',')
    bugzillaProperties = createDictionaryFromPropertiesList(
        config.get('bugzilla', 'properties'))
    mingleProperties = createDictionaryFromPropertiesList(
        config.get('mingle', 'properties'))
    mapping = createDictionaryFromPropertiesList(
        config.get('mapping', 'properties'))

    bingle = Bingle(debug=debug, picklePath=picklePath)
    bingle.info("Pretend mode: %s" % options.pretend)

    # prepare Mingle instance
    mingle = Mingle(auth, apiBaseUrl)

    fromTime = bingle.getTimeFromPickle()
    bzSearchParams = {
        'product': product,
        'component': component,
        'status': ['RESOLVED'],  # make configurable
    }
    if fromTime:
        bzSearchParams['last_change_time'] = fromTime
        bingle.info(bzSearchParams)
    bugzillaPayload = {
        'method': 'Bug.search',
Beispiel #5
0
        config.get('mapping', 'properties'))

    bingle = Bingle(debug=debug, picklePath=picklePath)

    # prepare Mingle instance
    mingle = Mingle(auth, apiBaseUrl)

    fromTime = bingle.getTimeFromPickle()
    bugzillaPayload = {'method': 'Bug.search', 'params': json.dumps([{
        'product': product,
        'component': component,
        'status': ['UNCONFIRMED', 'NEW'],
        'last_change_time': fromTime,
    }])}
    for bug in bingle.getBugEntries(bugzillaPayload):
        bingle.info("Bug XML: %s" % bug)
        # see if there's a mingle card matching this bug
        if len(bugIdFieldName) > 0:
            foundBug = mingle.findCardNumByBugId(
                bugCard, bug.get('id'), bugIdFieldName)
        else:
            foundBug = mingle.findCardNumByBugName(
                bugCard, bug.get('id'), bug.get('summary'))
        bingle.info(mingle.dumpRequest())
        if len(foundBug) > 0:
            bingle.info('Existing card(s) %s match bug %s, so skip it.' % (
                ','.join([str(m['Number']) for m in foundBug]),
                bug.get('id')))
            continue
        else:
            bingle.info('Did not find card matching bug %s, so add it.'
Beispiel #6
0
        config.get('mapping', 'properties'))
    payload = {'method': 'Bug.search', 'params': json.dumps([{
        'product': product,
        'component': component,
        'status': ['UNCONFIRMED', 'NEW'],
        'creation_time': '2012-08-01 00:00 UTC',
    }])}

    bingle = Bingle(payload, debug=debug, picklePath=picklePath, feedUrl=config.get(
        'urls', 'bugzillaFeed'))

    # prepare Mingle instance
    mingle = Mingle(auth, apiBaseUrl)

    for bug in bingle.getBugEntries():
        bingle.info("Bug XML: %s" % bug)
        # look for card
        foundBugs = mingle.findCardByName(
            bugCard, bug.get('summary'), bug.get('id'))
        bingle.info(mingle.dumpRequest())
        if len(foundBugs) > 0:
            continue

        # retrieve bug comments
        comment_payload = {'method': 'Bug.comments', 'params': json.dumps(
            [{'ids': ['%s' % bug.get('id')]}])}
        comments = bingle.getBugComments(comment_payload, bug.get('id'))
        link = '<br><p>Full bug report at https://bugzilla.wikimedia.org/%s</p>' % bug.get(
            'id')

        # set common mingle parameters
Beispiel #7
0
    reconcileMingle(bingle, mingle, bugs, options.pretend)
    if standalone and not pretend:
        # update pickle
        bingle.updatePickleTime()


if __name__ == "__main__":
    # config overrides
    config = ConfigParser.ConfigParser()
    config.read(options.config)
    picklePath = config.get('paths', 'picklePath') + '_resolved'
    statusResolved = config.get('bingle', 'statusResolved')
    mingleStatusField = config.get('bingle', 'mingleStatusField')
    mingleResolvedStatus = config.get('bingle', 'mingleResolvedStatus')
    mingleIterationPropertyName = config.get('bingle',
                                             'mingleIterationPropertyName')
    mingleResolvedIteration = config.get('bingle', 'mingleResolvedIteration')
    mingleIgnoreResolved = [item.strip() for item in config.get(
        'bingle', 'mingleIgnoreResolved').split(',')]

    bingle = Bingle(debug=debug, picklePath=picklePath)
    bingle.info("Pretend mode: %s" % options.pretend)
    bingle.info("Ignoring bugs in: %s" % mingleIgnoreResolved)

    # prepare Mingle instance
    mingle = Mingle(auth, apiBaseUrl)

    fromTime = bingle.getTimeFromPickle()
    execute(standalone=True, pretend=options.pretend, bingle=bingle,
            mingle=mingle)