# TODO: make 'status' field configurable status = mingle.getCardById(cardId).getStatus('Status') # TODO: make this list of statuses configurable if status not in ['In Development', 'Awaiting Final Code Review', 'Ready for Signoff', 'Accepted']: counter += 1 cardToUpdate = (cardId, bug.get('id')) cardsToUpdate.append(cardToUpdate) if not options.pretend: # update the card to 'ready for signoff' # and make sure it's in this iteration cardParams = { 'card[properties][][name]': 'Status', 'card[properties][][value]': 'Ready for Signoff' } mingle.updateCard(cardId, cardParams) cardParams = { 'card[properties][][name]': 'Iteration', 'card[properties][][value]': '(Current iteration)' } mingle.updateCard(cardId, cardParams) if not options.pretend: # update pickle bingle.updatePickleTime() bingle.info('Number of bug cards updated: %s' % counter) bingle.info("Mingle cards/bugs updated updated:") for cardToUpdate in cardsToUpdate: bingle.info('%scards/%s, http://bugzilla.wikimedia.org/%s' % (mingleUrlBase, cardToUpdate[0], cardToUpdate[1]))
postComments(auth, apiBaseUrl, comments, cardLocation) # set custom mingle properties properties = {} for key, value in bugzillaProperties.iteritems(): properties[value] = bug.get(key, '') properties.update(mingleProperties) for prop, value in properties.iteritems(): cardParams = { 'card[properties][][name]': prop, 'card[properties][][value]': mapping.get(value, value) } mingle.updateCard(cardLocation, cardParams) bingle.info(mingle.dumpRequest()) # include bug ID if configured as a property bugIdFieldName = config.get('mingle', 'bugIdFieldName') if len(bugIdFieldName): bugId = bug.get('id') cardParams = { 'card[properties][][name]': bugIdFieldName, 'card[properties][][value]': bugId, } mingle.updateCard(cardLocation, cardParams) bingle.info(mingle.dumpRequest()) # post comment with mingle card it back to bugzilla bug