Пример #1
0
    if reviewers:
        has_negative_review = any((x[1] < 0 for x in reviewers))
        # for r, vote in reviewers:
        #     for patch_num, vote in person_info[r][2]:
        #         if p == patch_num and vote <= 0:
        #             has_negative_review = True
        #             break
        #     if has_negative_review:
        #         break
        if has_negative_review:
            out.append(' - https://review.openstack.org/#/c/%d/ "%s"' % (p, subject))
if out:
    print "Owned patches that need follow-up:"
    print "\n".join(out)
out = []
for p, w in get_ordered_patches():
    p = int(p[0])
    if p not in patch_info:
        continue
    subject, owner, reviewers = patch_info[p]
    if owner == email or email in (x[0] for x in reviewers):
        continue
    negative_reviews = [True for x in reviewers if x[1] < 0]
    if not any(negative_reviews):
        out.append(' - https://review.openstack.org/#/c/%d/ "%s"' % (p, subject))
        if len(out) >= 5:
            break
if out:
    print "Community starred patches that need reviews:"
    print "\n".join(out)
Пример #2
0
        has_negative_review = any((x[1] < 0 for x in reviewers))
        # for r, vote in reviewers:
        #     for patch_num, vote in person_info[r][2]:
        #         if p == patch_num and vote <= 0:
        #             has_negative_review = True
        #             break
        #     if has_negative_review:
        #         break
        if has_negative_review:
            out.append(' - https://review.openstack.org/#/c/%d/ "%s"' %
                       (p, subject))
if out:
    print 'Owned patches that need follow-up:'
    print '\n'.join(out)
out = []
for p, w in get_ordered_patches():
    p = int(p[0])
    if p not in patch_info:
        continue
    subject, owner, reviewers = patch_info[p]
    if owner == email or email in (x[0] for x in reviewers):
        continue
    negative_reviews = [True for x in reviewers if x[1] < 0]
    if not any(negative_reviews):
        out.append(' - https://review.openstack.org/#/c/%d/ "%s"' %
                   (p, subject))
        if len(out) >= 5:
            break
if out:
    print 'Community starred patches that need reviews:'
    print '\n'.join(out)
Пример #3
0
    actives_windows, actives_avg = json.load(f)
for aw, rolling_avg_windows in actives_windows[-1:]:
    aw = str(aw)
    for r_a_w in rolling_avg_windows[:1]:
        r_a_w = str(r_a_w)
        active_contributors = int(
            int(actives_avg[aw][r_a_w][-1] * 10 + 5) / 10.)

template_vars['active_contributors'] = active_contributors

patch_tmpl = '<li><a title="relative score: {weight}%" href="https://review.openstack.org/#/c/{number}/">' \
             '<span class="subject">{subject}</span> - ' \
             '<span class="project">{project}</span> - ' \
             '<span class="owner">{owner}</span></a></li>'
out = []
community_starred_patches = get_stars.get_ordered_patches()
biggest_count = float(community_starred_patches[0][1])
for i, (patch, count) in enumerate(community_starred_patches):
    if i >= 15:
        break
    weight = int((count / biggest_count) * 100)
    number, subject, owner, status = patch
    subject = unicodedata.normalize('NFKD', subject).encode('ascii','ignore')
    owner = unicodedata.normalize('NFKD', owner).encode('ascii','ignore')
    out.append(patch_tmpl.format(number=number, subject=subject, owner=owner, project='', weight=weight))
template_vars['community_stars'] = '\n'.join(out)

out = []
for num, subject, owner, status in reversed(unreviewed_patchnums[:LIST_LIMIT]):
    out.append(patch_tmpl.format(number=num, subject=subject, owner=owner.encode('utf8'), project='swift', weight='100'))
# for num, subject, owner, status in reversed(client_unreviewed_patchnums):
Пример #4
0
    actives_windows, actives_avg = json.load(f)
for aw, rolling_avg_windows in actives_windows[-1:]:
    aw = str(aw)
    for r_a_w in rolling_avg_windows[:1]:
        r_a_w = str(r_a_w)
        active_contributors = int(
            int(actives_avg[aw][r_a_w][-1] * 10 + 5) / 10.)

template_vars['active_contributors'] = active_contributors

patch_tmpl = '<li><a title="relative score: {weight}%" href="https://review.openstack.org/#/c/{number}/">' \
             '<span class="subject">{subject}</span> - ' \
             '<span class="project">{project}</span> - ' \
             '<span class="owner">{owner}</span></a></li>'
out = []
community_starred_patches = get_stars.get_ordered_patches()
try:
    biggest_count = float(community_starred_patches[0][1])
except IndexError:
    pass
else:
    for i, (patch, count) in enumerate(community_starred_patches):
        if i >= 15:
            break
        weight = int((count / biggest_count) * 100)
        number, subject, owner, status = patch
        subject = unicodedata.normalize('NFKD',
                                        subject).encode('ascii', 'ignore')
        owner = unicodedata.normalize('NFKD', owner).encode('ascii', 'ignore')
        out.append(
            patch_tmpl.format(number=number,