← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:expire-archive-files-inclusive-naming into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:expire-archive-files-inclusive-naming into launchpad:master.

Commit message:
Use clearer terminology in expire-archive-files

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/404137

"Blacklist" and "whitelist" don't meet inclusive naming guidelines, and in any case are rather unclear here.  Call these lists "never_expire" and "always_expire" instead.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:expire-archive-files-inclusive-naming into launchpad:master.
diff --git a/lib/lp/soyuz/scripts/expire_archive_files.py b/lib/lp/soyuz/scripts/expire_archive_files.py
index 0f9ff03..e510139 100755
--- a/lib/lp/soyuz/scripts/expire_archive_files.py
+++ b/lib/lp/soyuz/scripts/expire_archive_files.py
@@ -35,7 +35,7 @@ from lp.soyuz.model.publishing import (
     )
 
 # PPA owners or particular PPAs that we never want to expire.
-BLACKLISTED_PPAS = """
+NEVER_EXPIRE_PPAS = """
 bzr
 bzr-beta-ppa
 bzr-nightly-ppa
@@ -61,9 +61,9 @@ ubuntu-mobile
 wheelbarrow
 """.split()
 
-# Particular PPAs (not owners, unlike the whitelist) that should be
+# Particular PPAs (not owners, unlike the never-expire list) that should be
 # expired even if they're private.
-WHITELISTED_PPAS = """
+ALWAYS_EXPIRE_PPAS = """
 adobe-isv/flash64
 adobe-isv/ppa
 kubuntu-ninjas/ppa
@@ -78,8 +78,8 @@ class ArchiveExpirer(LaunchpadCronScript):
     Any PPA binary older than 30 days that is superseded or deleted
     will be marked for immediate expiry.
     """
-    blacklist = BLACKLISTED_PPAS
-    whitelist = WHITELISTED_PPAS
+    never_expire = NEVER_EXPIRE_PPAS
+    always_expire = ALWAYS_EXPIRE_PPAS
 
     def add_my_options(self):
         """Add script command line options."""
@@ -109,9 +109,9 @@ class ArchiveExpirer(LaunchpadCronScript):
         full_archive_name = Concatenate(
             Person.name, Concatenate('/', Archive.name))
 
-        # The subquery here has to repeat the checks for privacy and
-        # blacklisting on *other* publications that are also done in
-        # the main loop for the archive being considered.
+        # The subquery here has to repeat the checks for privacy and expiry
+        # control on *other* publications that are also done in the main
+        # loop for the archive being considered.
         eligible = Select(
             LFA.id,
             where=And(
@@ -130,12 +130,12 @@ class ArchiveExpirer(LaunchpadCronScript):
                 Or(
                     And(
                         Or(
-                            Person.name.is_in(self.blacklist),
-                            full_archive_name.is_in(self.blacklist)),
+                            Person.name.is_in(self.never_expire),
+                            full_archive_name.is_in(self.never_expire)),
                         Archive.purpose == ArchivePurpose.PPA),
                     And(
                         IsTrue(Archive.private),
-                        Not(full_archive_name.is_in(self.whitelist))),
+                        Not(full_archive_name.is_in(self.always_expire))),
                     Not(Archive.purpose.is_in(archive_types)),
                     xPPH.dateremoved > UTC_NOW - stay_of_execution,
                     xPPH.dateremoved == None)))
diff --git a/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py b/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py
index 5d2c006..fefef02 100644
--- a/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py
+++ b/lib/lp/soyuz/scripts/tests/test_expire_archive_files.py
@@ -228,7 +228,7 @@ class TestPPAExpiry(ArchiveExpiryTestBase, ArchiveExpiryCommonTests):
 
     Here we make use of the common test cases defined in the base class but
     also add tests specific to PPAs (excluding particular PPAs from expiry
-    based on a "black list" or on the fact that PPA is private).
+    based on lists or on the fact that the PPA is private).
     """
 
     def setUp(self):
@@ -239,35 +239,35 @@ class TestPPAExpiry(ArchiveExpiryTestBase, ArchiveExpiryCommonTests):
             distribution=getUtility(IDistributionSet)['ubuntutest'])
         self.archive2 = self.factory.makeArchive()
 
-    def testBlacklistingWorks(self):
-        """Test that blacklisted PPA owners are not expired."""
+    def testNeverExpireWorks(self):
+        """Test that never-expiring PPA owners are not expired."""
         source, binary = self._setUpExpirablePublications(
             archive=self.archive)
         script = self.getScript()
-        script.blacklist = [self.archive.owner.name, ]
+        script.never_expire = [self.archive.owner.name, ]
         switch_dbuser(self.dbuser)
         script.main()
         self.assertSourceNotExpired(source)
         self.assertBinaryNotExpired(binary)
 
-    def testBlacklistingArchivesWorks(self):
-        """Test that blacklisted individual PPAs are not expired."""
+    def testNeverExpireArchivesWorks(self):
+        """Test that never-expiring individual PPAs are not expired."""
         source, binary = self._setUpExpirablePublications(
             archive=self.archive)
         script = self.getScript()
-        script.blacklist = [
+        script.never_expire = [
             '%s/%s' % (self.archive.owner.name, self.archive.name)]
         switch_dbuser(self.dbuser)
         script.main()
         self.assertSourceNotExpired(source)
         self.assertBinaryNotExpired(binary)
 
-    def testWhitelistingWorks(self):
-        """Test that whitelisted private PPAs are expired anyway."""
+    def testAlwaysExpireWorks(self):
+        """Test that always-expiring private PPAs are expired anyway."""
         p3a = self.factory.makeArchive(private=True)
         source, binary = self._setUpExpirablePublications(archive=p3a)
         script = self.getScript()
-        script.whitelist = ['%s/%s' % (p3a.owner.name, p3a.name)]
+        script.always_expire = ['%s/%s' % (p3a.owner.name, p3a.name)]
         switch_dbuser(self.dbuser)
         script.main()
         self.assertSourceExpired(source)