コード例 #1
0
ファイル: bingle.py プロジェクト: wikimedia/bingle
    # 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(
            bug.get('id', '---'),
            bug.get('summary').encode('ascii', 'ignore'))

        # 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.findCardNumByName(bugCard, bugCardName)
        bingle.info(mingle.dumpRequest())
        if len(foundBug) > 0:
            bingle.info('Existing card(s) %s match bug %s, so skip it.' %
コード例 #2
0
ファイル: bugello.py プロジェクト: jdlrobson/bingle
    bingle = Bingle(debug=debug, picklePath=picklePath)
    fromTime = bingle.getTimeFromPickle()
    params = {
        'product': product,
        'status': ['UNCONFIRMED', 'NEW'],
        'last_change_time': fromTime
    }
    if len(component[0]) > 1:
        params['component'] = component

    bugzillaPayload = {
        'method': 'Bug.search',
        'params': json.dumps([params])
    }

    for entry in bingle.getBugEntries(bugzillaPayload):
        cardExists = False
        bugId = entry.get('id', '---')
        bugTitle = entry.get('summary').encode('UTF-8', 'ignore')
        if trello.prefixBugTitle:
            cardTitle = bingle.generateBugCardName(bugId, bugTitle)
            searchString = bingle.getBugCardPrefix(bugId)
            cards = trello.searchCardsByName(searchString)
            if len(cards):
                cardExists = True
        else:
            cardTitle = bugTitle
            # 1 look for existence of the card
            cards = trello.searchCardsByName(cardTitle)
            # check if we actually have a match
            # it looks like the API search query might do a fuzzy search, so we want to
コード例 #3
0
ファイル: bingle.py プロジェクト: jdlrobson/bingle
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(
            bug.get('id', '---'), bug.get('summary').encode('ascii', 'ignore'))

        # 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.findCardNumByName(
                bugCard, bugCardName)
        bingle.info(mingle.dumpRequest())
        if len(foundBug) > 0:
            bingle.info('Existing card(s) %s match bug %s, so skip it.' % (
コード例 #4
0
ファイル: bingleResolved.py プロジェクト: skierpage/bingle
    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',
        'params': json.dumps([bzSearchParams])
    }
    # fetch matching bugs
    bugs = bingle.getBugEntries(bugzillaPayload)
    bingle.info('Number of bugs: %s' % len(bugs))
    counter = 0
    cardsToUpdate = []
    for bug in bugs:
        # see if there's a mingle card matching this bug
        # TODO: refactor this; it's repeated below
        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) < 1:
            # eh... we probably want to do something else here
コード例 #5
0
ファイル: bingle.py プロジェクト: drdee/bingle
    mapping = createDictionaryFromPropertiesList(
        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')
コード例 #6
0
    trello = Trello(config=trelloConfig, debug=debug)
    tListId = trello.getBugListId()

    bingle = Bingle(debug=debug, picklePath=picklePath)
    fromTime = bingle.getTimeFromPickle()
    params = {
        'product': product,
        'status': ['UNCONFIRMED', 'NEW'],
        'last_change_time': fromTime
    }
    if len(component[0]) > 1:
        params['component'] = component

    bugzillaPayload = {'method': 'Bug.search', 'params': json.dumps([params])}

    for entry in bingle.getBugEntries(bugzillaPayload):
        cardExists = False
        bugId = entry.get('id', '---')
        bugTitle = entry.get('summary').encode('UTF-8', 'ignore')
        if trello.prefixBugTitle:
            cardTitle = bingle.generateBugCardName(bugId, bugTitle)
            searchString = bingle.getBugCardPrefix(bugId)
            cards = trello.searchCardsByName(searchString)
            if len(cards):
                cardExists = True
        else:
            cardTitle = bugTitle
            # 1 look for existence of the card
            cards = trello.searchCardsByName(cardTitle)
            # check if we actually have a match
            # it looks like the API search query might do a fuzzy search, so we want to