Skip to content

Commit

Permalink
Display more info. about unassigned issues
Browse files Browse the repository at this point in the history
This commit uses the issues.html general template
to display the activity of unassigned issues. It
displays some useful information about issues
which were not being provided earlier

Closes coala#289
  • Loading branch information
KVGarg committed Aug 2, 2019
1 parent 0c3f1b2 commit 6b806e5
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 63 deletions.
1 change: 0 additions & 1 deletion .moban.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ packages:
- ci_build
- meta_review
- twitter
- unassigned_issues

dependencies:
- getorg~=0.3.1
Expand Down
2 changes: 0 additions & 2 deletions .nocover.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ nocover_file_globs:
- meta_review/handler.py
- openhub/*.py
- twitter/*.py
# Optional coverage. Once off scripts.
- unassigned_issues/unassigned_issues_scraper.py
# The following rules can remain here
# django db
- '*/migrations/*.py'
Expand Down
12 changes: 5 additions & 7 deletions community/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

from community.views import (
HomePageView, JoinCommunityView,
OrganizationTeams, InactiveIssuesList
OrganizationTeams, InactiveIssuesList,
UnassignedIssuesActivityList
)
from gci.views import GCIStudentsList
from gci.feeds import LatestTasksFeed as gci_tasks_rss
Expand All @@ -18,9 +19,6 @@
from data.views import ContributorsListView
from gamification.views import GamificationResults
from meta_review.views import ContributorsMetaReview
from unassigned_issues.unassigned_issues_scraper import (
unassigned_issues_activity_json,
)


def get_index():
Expand Down Expand Up @@ -91,10 +89,10 @@ def get_index():
distill_file='inactive-issues/index.html',
),
distill_url(
r'static/unassigned-issues.json', unassigned_issues_activity_json,
name='unassigned_issues_activity_json',
r'unassigned-issues/', UnassignedIssuesActivityList.as_view(),
name='unassigned-issues',
distill_func=get_index,
distill_file='static/unassigned-issues.json',
distill_file='unassigned-issues/index.html',
),
distill_url(
r'gamification/$', GamificationResults.as_view(),
Expand Down
15 changes: 14 additions & 1 deletion community/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
NewcomerPromotion,
Feedback
)
from data.models import Team, InactiveIssue
from data.models import Team, InactiveIssue, UnassignedIssuesActivity
from gamification.models import Participant as GamificationParticipant
from meta_review.models import Participant as MetaReviewer

Expand Down Expand Up @@ -231,3 +231,16 @@ def get_context_data(self, **kwargs):
context = get_header_and_footer(context)
context['page_name'] = 'Inactive Issues List'
return context


class UnassignedIssuesActivityList(ListView):

template_name = 'issues.html'
model = UnassignedIssuesActivity
ordering = 'hoster'

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context = get_header_and_footer(context)
context['page_name'] = 'Unassigned Issues Activity List'
return context
24 changes: 24 additions & 0 deletions data/migrations/0010_unassignedissuesactivity.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated by Django 2.1.7 on 2019-08-02 12:07

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('data', '0009_inactiveissue'),
]

operations = [
migrations.CreateModel(
name='UnassignedIssuesActivity',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('hoster', models.CharField(max_length=30)),
('title', models.CharField(max_length=500)),
('repository', models.CharField(max_length=100)),
('number', models.SmallIntegerField()),
('url', models.URLField()),
],
),
]
8 changes: 8 additions & 0 deletions data/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,11 @@ class InactiveIssue(models.Model):
repository = models.CharField(max_length=100)
number = models.SmallIntegerField()
url = models.URLField()


class UnassignedIssuesActivity(models.Model):
hoster = models.CharField(max_length=30)
title = models.CharField(max_length=500)
repository = models.CharField(max_length=100)
number = models.SmallIntegerField()
url = models.URLField()
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ testpaths =
ci_build
meta_review
twitter
unassigned_issues

python_files = test_*.py
python_classes = *Test
Expand Down Expand Up @@ -70,7 +69,6 @@ source =
ci_build
meta_review
twitter
unassigned_issues

omit =
tests/*
Expand All @@ -82,7 +80,6 @@ omit =
meta_review/handler.py
openhub/*.py
twitter/*.py
unassigned_issues/unassigned_issues_scraper.py
*/migrations/*.py
*/management/commands/*.py
meta_review/load_from_db.py
Expand Down
2 changes: 1 addition & 1 deletion templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<li><a href="#!">Mentors</a></li>
<li><a href="{% url 'community-gci' %}">Google Code-in Students</a></li>
<li><a href="{% url 'inactive-issues' %}" title="List of all the issues on organization's main repository on which assignee has not shown any activity for more than 2 months.">Inactive issues</a></li>
<li><a href="{% url 'unassigned_issues_activity_json' %}" title="List of all the issues on organization main repository on which someone has opened a pull request without getting assigned to it.">Unassigned issues activity</a></li>
<li><a href="{% url 'unassigned-issues' %}" title="List of all the issues on organization main repository on which someone has opened a pull request without getting assigned to it.">Unassigned issues activity</a></li>
<li><a href="#!">Newcomer issues</a></li>
<li><a href="{% url 'ci_build' %}">Project CI Build</a></li>
{% if isTravis %}
Expand Down
48 changes: 0 additions & 48 deletions unassigned_issues/unassigned_issues_scraper.py

This file was deleted.

0 comments on commit 6b806e5

Please sign in to comment.