[Git][security-tracker-team/security-tracker][fix_987283] Implement frontend and checkbox

Anton Gladky (@gladk) gladk at debian.org
Sat Jul 30 21:38:40 BST 2022



Anton Gladky pushed to branch fix_987283 at Debian Security Tracker / security-tracker


Commits:
7f8bdd41 by Anton Gladky at 2022-07-30T22:38:28+02:00
Implement frontend and checkbox

- - - - -


2 changed files:

- bin/tracker_service.py
- lib/python/security_db.py


Changes:

=====================================
bin/tracker_service.py
=====================================
@@ -1075,14 +1075,21 @@ checker to find out why they have not entered testing yet."""),
                         replacement="No ITP bugs are currently known.")])
 
     def page_status_unreported(self, path, params, url):
+        show_ignored = params.get('show_ignored', False)
+        if show_ignored:
+            flags = A(url.updateParamsDict({'show_ignored' : None}),
+                      'Hide ignored issues')
+        else:
+            flags = A(url.updateParamsDict({'show_ignored' : '1'}),
+                  'Show ignored issues')
         def gen():
-            for (bug, packages) in self.db.getUnreportedVulnerabilities():
+            for (bug, packages) in self.db.getUnreportedVulnerabilities(show_ignored=show_ignored):
                 pkgs = make_list([self.make_source_package_ref(url, pkg)
                                   for pkg in packages], ", ")
                 yield self.make_xref(url, bug), pkgs
         return self.create_page(
             url, "Unfixed vulnerabilities in unstable without a filed bug",
-            [P("""The list below contains vulnerabilities for which no matching
+            [P(flags), P("""The list below contains vulnerabilities for which no matching
 Debian bug has been filed, and there is still an unfixed package in sid."""),
              make_table(gen(), caption=("Bug", "Packages"))])
 


=====================================
lib/python/security_db.py
=====================================
@@ -2066,16 +2066,21 @@ class DB:
                 st.bug_name > 'TEMP-' AND st.bug_name LIKE 'TEMP-%'
                 ORDER BY st.bug_name""",(vulnerability,)))
 
-    def getUnreportedVulnerabilities(self, cursor=None):
+    def getUnreportedVulnerabilities(self, cursor=None, show_ignored=False):
         """Returns a list of pairs (BUG_NAME, DESCRIPTION)
         of vulnerabilities which are unfixed in unstable and lack a filed bug.
         """
         if cursor is None:
             cursor = self.cursor()
         last_bug = None
+
+        show_ignored_sql = ""
+        if (not show_ignored):
+            show_ignored_sql = "AND source_package_status.debian_bug_file = 1"
+
         result = []
         for bug, pkg in cursor.execute(
-"""SELECT DISTINCT source_package_status.bug_name, source_packages.name
+f"""SELECT DISTINCT source_package_status.bug_name, source_packages.name
   FROM source_packages
   JOIN source_package_status
     ON source_packages.rowid = source_package_status.package
@@ -2088,6 +2093,7 @@ class DB:
   AND package_notes.urgency <> 'unimportant'
   AND package_notes.rowid NOT IN (SELECT note FROM debian_bugs)
   AND source_package_status.vulnerable
+  {show_ignored_sql}
   ORDER BY source_package_status.bug_name, source_packages.name"""):
             if last_bug is None or last_bug != bug:
                 last_bug = bug



View it on GitLab: https://salsa.debian.org/security-tracker-team/security-tracker/-/commit/7f8bdd4125caebbab5a9438acc26d954a1238def

-- 
View it on GitLab: https://salsa.debian.org/security-tracker-team/security-tracker/-/commit/7f8bdd4125caebbab5a9438acc26d954a1238def
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-security-tracker-commits/attachments/20220730/6de1f87d/attachment-0001.htm>


More information about the debian-security-tracker-commits mailing list