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)
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( bug.get('id', '---'), bug.get('summary').encode('ascii', 'ignore')) # see if there's a mingle card matching this bug
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)
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', 'params': json.dumps([bzSearchParams]) } # fetch matching bugs
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) # 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:
mingleProperties = createDictionaryFromPropertiesList( config.get('mingle', 'properties')) 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(