aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Galenson <jgalenson@google.com>2021-07-26 10:31:54 -0700
committerJoel Galenson <jgalenson@google.com>2021-07-26 10:54:04 -0700
commit6592d49c1f30686d6ce20b358ce20c6e1b9e0118 (patch)
tree251a11df62efed7023d1b025a939538743591a24
parent58f0ddf4277bee982a83022d85b443114e439083 (diff)
downloadexternal_updater-6592d49c1f30686d6ce20b358ce20c6e1b9e0118.tar.gz
Remove unused variable.
This variable was not being used and caused some confusion when updating the list of reviewers, so we remove it and try to update a comment to explain its purpose. Test: atest external_updater_reviewers_test Change-Id: Ieab960b9b7bbdef678b3c3c05f2bdc33c76fa407
-rw-r--r--external_updater_reviewers_test.py7
-rw-r--r--reviewers.py12
2 files changed, 4 insertions, 15 deletions
diff --git a/external_updater_reviewers_test.py b/external_updater_reviewers_test.py
index d6e4b71..18497f5 100644
--- a/external_updater_reviewers_test.py
+++ b/external_updater_reviewers_test.py
@@ -28,7 +28,6 @@ class ExternalUpdaterReviewersTest(unittest.TestCase):
self.saved_proj_reviewers = reviewers.PROJ_REVIEWERS
self.saved_rust_reviewers = reviewers.RUST_REVIEWERS
self.saved_rust_reviewer_list = reviewers.RUST_REVIEWER_LIST
- self.saved_num_rust_projects = reviewers.NUM_RUST_PROJECTS
self.saved_rust_crate_owners = reviewers.RUST_CRATE_OWNERS
def tearDown(self):
@@ -37,7 +36,6 @@ class ExternalUpdaterReviewersTest(unittest.TestCase):
reviewers.PROJ_REVIEWERS = self.saved_proj_reviewers
reviewers.RUST_REVIEWERS = self.saved_rust_reviewers
reviewers.RUST_REVIEWER_LIST = self.saved_rust_reviewer_list
- reviewers.NUM_RUST_PROJECTS = self.saved_num_rust_projects
reviewers.RUST_CRATE_OWNERS = self.saved_rust_crate_owners
# pylint: disable=no-self-use
@@ -74,16 +72,11 @@ class ExternalUpdaterReviewersTest(unittest.TestCase):
"""Check the constants associated to the reviewers."""
# There should be enough people in the reviewers pool.
self.assertGreaterEqual(len(reviewers.RUST_REVIEWERS), 3)
- # The NUM_RUST_PROJECTS should not be too small.
- self.assertGreaterEqual(reviewers.NUM_RUST_PROJECTS, 50)
- self.assertGreaterEqual(reviewers.NUM_RUST_PROJECTS,
- len(reviewers.RUST_CRATE_OWNERS))
# Assume no project reviewers and recreate RUST_REVIEWER_LIST
reviewers.PROJ_REVIEWERS = {}
reviewers.RUST_REVIEWER_LIST = reviewers.create_rust_reviewer_list()
sum_projects = sum(reviewers.RUST_REVIEWERS.values())
self.assertEqual(sum_projects, len(reviewers.RUST_REVIEWER_LIST))
- self.assertGreaterEqual(sum_projects, reviewers.NUM_RUST_PROJECTS)
def test_reviewers_randomness(self):
"""Check random selection of reviewers."""
diff --git a/reviewers.py b/reviewers.py
index 6f826f1..70377cd 100644
--- a/reviewers.py
+++ b/reviewers.py
@@ -31,6 +31,7 @@ ProjMapping = Mapping[str, Union[str, List[str], Set[str]]]
RUST_CRATE_OWNERS: ProjMapping = {
'rust/crates/anyhow': 'mmaurer@google.com',
# more rust crate owners could be added later
+ # if so, consider modifying the quotas in RUST_REVIEWERS
}
PROJ_REVIEWERS: ProjMapping = {
@@ -40,16 +41,11 @@ PROJ_REVIEWERS: ProjMapping = {
# Combine all roject reviewers.
PROJ_REVIEWERS.update(RUST_CRATE_OWNERS)
-# Estimated number of rust projects, not the actual number.
-# It is only used to make random distribution "fair" among RUST_REVIEWERS.
-# It should not be too small, to spread nicely to multiple reviewers.
-# It should be larger or equal to len(RUST_CRATES_OWNERS).
-NUM_RUST_PROJECTS = 120
-
# Reviewers for external/rust/crates projects not found in PROJ_REVIEWER.
# Each person has a quota, the number of projects to review.
-# Sum of these numbers should be greater or equal to NUM_RUST_PROJECTS
-# to avoid error cases in the creation of RUST_REVIEWER_LIST.
+# The sum of these quotas should ideally be at least the number of Rust
+# projects, but this only matters if we have many entries in RUST_CRATE_OWNERS,
+# as we subtract a person's owned crates from their quota.
RUST_REVIEWERS: Mapping[str, int] = {
'ivanlozano@google.com': 20,
'jeffv@google.com': 20,