Пример #1
0
 def test_url_args_not_modified(self):
     """
     Setting the proper arguments turns off automatic args addition.
     """
     url = BugzillaURL(url=self.bzurl)
     args = url._get_bz_args(open_only=False, scrum_only=False)
     ok_('bug_status' not in args)
     ok_('status_whiteboard' not in args)
Пример #2
0
 def test_url_args_not_modified(self):
     """
     Setting the proper arguments turns off automatic args addition.
     """
     url = BugzillaURL(url=self.bzurl)
     args = url._get_bz_args(open_only=False, scrum_only=False)
     ok_('bug_status' not in args)
     ok_('status_whiteboard' not in args)
Пример #3
0
 def test_url_args_override_defaults(self):
     """
     You should still be able to specify your own statuses and whiteboard.
     """
     url = BugzillaURL(url=self.bzurl + ';bug_status=CLOSED'
                                        ';status_whiteboard=u%3Dthedude')
     args = url._get_bz_args()
     eq_(args['bug_status'], 'CLOSED')
     eq_(args['status_whiteboard'], 'u=thedude')
Пример #4
0
 def test_url_args_override_defaults(self):
     """
     You should still be able to specify your own statuses and whiteboard.
     """
     url = BugzillaURL(url=self.bzurl + ';bug_status=CLOSED'
                       ';status_whiteboard=u%3Dthedude')
     args = url._get_bz_args()
     eq_(args['bug_status'], 'CLOSED')
     eq_(args['status_whiteboard'], 'u=thedude')
Пример #5
0
 def test_bz_args(self):
     """
     args should be added for bug status and whiteboard
     :return:
     """
     statuses = set(['UNCONFIRMED', 'ASSIGNED', 'REOPENED', 'NEW'])
     url = BugzillaURL(url=self.bzurl)
     args = url._get_bz_args()
     self.assertSetEqual(set(args.getlist('bug_status')), statuses)
     eq_(args['status_whiteboard'], 'u= c= p=')
Пример #6
0
 def test_bz_args(self):
     """
     args should be added for bug status and whiteboard
     :return:
     """
     statuses = set(['UNCONFIRMED', 'ASSIGNED', 'REOPENED', 'NEW'])
     url = BugzillaURL(url=self.bzurl)
     args = url._get_bz_args()
     self.assertSetEqual(set(args.getlist('bug_status')), statuses)
     eq_(args['status_whiteboard'], 'u= c= p=')
Пример #7
0
 def forwards(self, orm):
     print '   - Importing sprint data from Bugzilla.'
     print '   - ',
     for sprint in Sprint.objects.all():
         if sprint.bz_url:
             bzurl = BugzillaURL(url=sprint.bz_url)
             bugs = bzurl.get_bugs(scrum_only=False, open_only=False)
             for bug in bugs:
                 # at this point project and sprint ids are equal
                 bug.project_id = bug.backlog_id = sprint.team_id
                 bug.sprint = sprint
                 bug.save()
         sys.stdout.write('.')
         sys.stdout.flush()
     print '\n   - Done.'
 def forwards(self, orm):
     print '   - Importing sprint data from Bugzilla.'
     print '   - ',
     for sprint in Sprint.objects.all():
         if sprint.bz_url:
             bzurl = BugzillaURL(url=sprint.bz_url)
             bugs = bzurl.get_bugs(scrum_only=False, open_only=False)
             for bug in bugs:
                 # at this point project and sprint ids are equal
                 bug.project_id = bug.backlog_id = sprint.team_id
                 bug.sprint = sprint
                 bug.save()
         sys.stdout.write('.')
         sys.stdout.flush()
     print '\n   - Done.'
Пример #9
0
def sync_old_sprints():
    """
    Get the bugs from sprints with bugzilla urls and associate them properly.
    """
    for sprint in Sprint.objects.all():
        if sprint.bz_url:
            bzurl = BugzillaURL(url=sprint.bz_url)
            bugs = bzurl.get_bugs(scrum_only=False, open_only=False)
            for bug in bugs:
                # at this point project and sprint ids are equal
                bug.project_id = bug.backlog_id = sprint.team_id
                bug.sprint = sprint
                bug.save()
        sys.stdout.write('.')
        sys.stdout.flush()
    print '\nDone.'
Пример #10
0
def sync_old_sprints():
    """
    Get the bugs from sprints with bugzilla urls and associate them properly.
    """
    for sprint in Sprint.objects.all():
        if sprint.bz_url:
            bzurl = BugzillaURL(url=sprint.bz_url)
            bugs = bzurl.get_bugs(scrum_only=False, open_only=False)
            for bug in bugs:
                # at this point project and sprint ids are equal
                bug.project_id = bug.backlog_id = sprint.team_id
                bug.sprint = sprint
                bug.save()
        sys.stdout.write('.')
        sys.stdout.flush()
    print '\nDone.'
Пример #11
0
def sync_bugmail():
    """
    Check bugmail for updated bugs, and get their data from Bugzilla.
    """
    bugids = get_bugmails()
    if bugids:
        numbugs = len(bugids)
        url = BugzillaURL(url=get_bz_url_for_bug_ids(bugids))
        try:
            url.get_bugs(open_only=False)
        except BZError:
            # error logged in `get_bugs`
            log.error('Failed to update bugs from email: %s', bugids)
            return
        if NEW_RELIC:
            newrelic.agent.record_custom_metric('Custom/Bugmails', numbugs)
        log.info('Synced %d bug(s) from email', numbugs)
Пример #12
0
def sync_bugmail():
    """
    Check bugmail for updated bugs, and get their data from Bugzilla.
    """
    bugids = get_bugmails()
    if bugids:
        numbugs = len(bugids)
        url = BugzillaURL(url=get_bz_url_for_bug_ids(bugids))
        try:
            url.get_bugs(open_only=False)
        except BZError:
            # error logged in `get_bugs`
            log.error('Failed to update bugs from email: %s', bugids)
            return
        if NEW_RELIC:
            newrelic.agent.record_custom_metric('Custom/Bugmails', numbugs)
        log.info('Synced %d bug(s) from email', numbugs)
Пример #13
0
def sync_bugmail():
    """
    Check bugmail for updated bugs, and get their data from Bugzilla.
    """
    counter = 0
    bugids = get_bugmails()
    for slug, ids in bugids.items():
        counter += len(ids)
        url = BugzillaURL(url=get_bz_url_for_bug_ids(ids))
        proj = None
        if slug:
            try:
                proj = Project.objects.get(slug=slug)
            except Project.DoesNotExist:
                pass
        if proj:
            url.project = proj
        url.get_bugs()
        sys.stdout.write('.')
        sys.stdout.flush()
    if counter:
        print "\nSynced {0} bugs".format(counter)