[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#779406: replace gift usertag with newcomer



> You forgot to attach the patch. :)

haha, here it is.
>From b44210cbad4376239ad26a2a5d3a6e54489aec48 Mon Sep 17 00:00:00 2001
From: Christophe Siraut <tobald@debian.org>
Date: Thu, 13 Aug 2015 14:04:49 +0200
Subject: [PATCH] vendor/debian: replace gift usertag with newcomer. closes:
 #779406

---
 distro_tracker/vendor/debian/rules.py                   | 16 ++++++++++------
 distro_tracker/vendor/debian/templates/debian/bugs.html |  6 +++---
 distro_tracker/vendor/debian/tests.py                   | 10 +++++-----
 distro_tracker/vendor/debian/tracker_tasks.py           |  9 ++++-----
 4 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/distro_tracker/vendor/debian/rules.py b/distro_tracker/vendor/debian/rules.py
index 96ad6d7..015bbec 100644
--- a/distro_tracker/vendor/debian/rules.py
+++ b/distro_tracker/vendor/debian/rules.py
@@ -385,9 +385,11 @@ def get_bug_tracker_url(package_name, package_type, category_name):
             ('pend-exc', 'fixed'),
             ('pend-exc', 'done'),
         ),
-        'gift': (
-            ('users', 'debian-qa@lists.debian.org'),
-            ('tag', 'gift'),
+        'newcomer': (
+            ('tag', 'newcomer'),
+            ('pend-exc', 'pending-fixed'),
+            ('pend-exc', 'fixed'),
+            ('pend-exc', 'done'),
         ),
         'all-merged': (
             ('repeatmerged', 'yes'),
@@ -496,12 +498,14 @@ def get_bug_panel_stats(package_name):
             'display_name': 'F&P',
             'description': 'Fixed and Pending',
         },
-        'gift': {
-            'display_name': 'gift',
+        'newcomer': {
+            'display_name': 'newcomer',
+            'description': 'newcomer',
+            'link': 'https://wiki.debian.org/qa.debian.org/GiftTag',
         }
     }
     # Some bug categories should not be included in the count.
-    exclude_from_count = ('gift',)
+    exclude_from_count = ('newcomer',)
 
     stats = bug_stats.stats
     categories = []
diff --git a/distro_tracker/vendor/debian/templates/debian/bugs.html b/distro_tracker/vendor/debian/templates/debian/bugs.html
index 69ad7f0..30aa41d 100644
--- a/distro_tracker/vendor/debian/templates/debian/bugs.html
+++ b/distro_tracker/vendor/debian/templates/debian/bugs.html
@@ -10,11 +10,11 @@
     {% for category in panel.context.categories %}
     <li class="list-group-item">
         <div class="list-item-key">
-            {% if category.display_name == "gift" %}
-            <a href="https://wiki.debian.org/qa.debian.org/GiftTag";>
+            {% if category.display_name == "newcomer" %}
+            <a href="{{ category.link }}">
             {% endif %}
             <b><span class="has-tooltip" data-title="{{ category.description }}" data-toggle="tooltip">{{ category.display_name }}:</span></b>
-            {% if category.display_name == "gift" %}
+            {% if category.display_name == "newcomer" %}
             </a>
             {% endif %}
         </div>
diff --git a/distro_tracker/vendor/debian/tests.py b/distro_tracker/vendor/debian/tests.py
index 5bd6601..03ff454 100644
--- a/distro_tracker/vendor/debian/tests.py
+++ b/distro_tracker/vendor/debian/tests.py
@@ -1324,11 +1324,11 @@ class DebianBugActionItemsTests(TestCase):
     based on Debian bug stats.
     """
     @staticmethod
-    def stub_tagged_bugs(tag, user=None, help_bugs=None, gift_bugs=None):
+    def stub_tagged_bugs(tag, user=None, help_bugs=None, newcomer_bugs=None):
         if tag == 'help':
             return help_bugs
-        elif tag == 'gift':
-            return gift_bugs
+        elif tag == 'newcomer':
+            return newcomer_bugs
 
     def setUp(self):
         self.package_name = SourcePackageName.objects.create(
@@ -1339,7 +1339,7 @@ class DebianBugActionItemsTests(TestCase):
         self.task = UpdatePackageBugStats()
         self.udd_bugs = {}
         self.help_bugs = {}
-        self.gift_bugs = {}
+        self.newcomer_bugs = {}
         # Stub the data providing methods
         self.task._get_udd_bug_stats = mock.MagicMock(
             return_value=self.udd_bugs)
@@ -1347,7 +1347,7 @@ class DebianBugActionItemsTests(TestCase):
             side_effect=curry(
                 DebianBugActionItemsTests.stub_tagged_bugs,
                 help_bugs=self.help_bugs,
-                gift_bugs=self.gift_bugs))
+                newcomer_bugs=self.newcomer_bugs))
         # Ignore binary package bugs for action item tests.
         self.task.update_binary_bugs = mock.MagicMock()
 
diff --git a/distro_tracker/vendor/debian/tracker_tasks.py b/distro_tracker/vendor/debian/tracker_tasks.py
index 59b3878..41bd879 100644
--- a/distro_tracker/vendor/debian/tracker_tasks.py
+++ b/distro_tracker/vendor/debian/tracker_tasks.py
@@ -470,13 +470,12 @@ class UpdatePackageBugStats(BaseTask):
         except:
             logger.exception("Could not get bugs tagged help")
 
-        # Add in gift bugs from the BTS SOAP interface
+        # Add in newcomer bugs from the BTS SOAP interface
         try:
-            gift_bugs = self._get_tagged_bug_stats('gift',
-                                                   'debian-qa@lists.debian.org')
-            self._extend_bug_stats(bug_stats, gift_bugs, 'gift')
+            newcomer_bugs = self._get_tagged_bug_stats('newcomer')
+            self._extend_bug_stats(bug_stats, newcomer_bugs, 'newcomer')
         except:
-            logger.exception("Could not get bugs tagged gift")
+            logger.exception("Could not get bugs tagged newcomer")
 
         with transaction.atomic():
             # Clear previous stats
-- 
2.1.4


Reply to: