launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #05894
[Merge] lp:~allenap/launchpad/check-teamparticipation-remove-self into lp:launchpad
Gavin Panella has proposed merging lp:~allenap/launchpad/check-teamparticipation-remove-self into lp:launchpad with lp:~allenap/launchpad/check-teamparticipation-fix-too-bug-897269 as a prerequisite.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~allenap/launchpad/check-teamparticipation-remove-self/+merge/85149
--
https://code.launchpad.net/~allenap/launchpad/check-teamparticipation-remove-self/+merge/85149
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~allenap/launchpad/check-teamparticipation-remove-self into lp:launchpad.
=== modified file 'cronscripts/check-teamparticipation.py'
--- cronscripts/check-teamparticipation.py 2011-12-09 16:06:45 +0000
+++ cronscripts/check-teamparticipation.py 2011-12-09 16:06:45 +0000
@@ -23,7 +23,6 @@
from lp.registry.scripts.teamparticipation import (
check_teamparticipation_circular,
check_teamparticipation_consistency,
- check_teamparticipation_self,
fetch_team_participation_info,
fix_teamparticipation_consistency,
)
@@ -54,7 +53,6 @@
if self.options.load_info:
participation_info = load_bz2_pickle(self.options.load_info)
else:
- check_teamparticipation_self(self.logger)
check_teamparticipation_circular(self.logger)
participation_info = fetch_team_participation_info(self.logger)
if self.options.save_info:
=== modified file 'lib/lp/registry/scripts/teamparticipation.py'
--- lib/lp/registry/scripts/teamparticipation.py 2011-12-09 16:06:45 +0000
+++ lib/lp/registry/scripts/teamparticipation.py 2011-12-09 16:06:45 +0000
@@ -7,7 +7,6 @@
__all__ = [
"check_teamparticipation_circular",
"check_teamparticipation_consistency",
- "check_teamparticipation_self",
"fetch_team_participation_info",
"fix_teamparticipation_consistency",
]
@@ -57,26 +56,6 @@
return getUtility(IStoreSelector).get(MAIN_STORE, SLAVE_FLAVOR)
-def check_teamparticipation_self(log):
- """Check self-participation.
-
- All people and teams should participate in themselves.
- """
- query = """
- SELECT id, name
- FROM Person
- WHERE id NOT IN (
- SELECT person FROM TeamParticipation
- WHERE person = team)
- AND merged IS NULL
- """
- non_self_participants = list(get_slave_store().execute(query))
- if len(non_self_participants) > 0:
- log.warn(
- "Some people/teams are not members of themselves: %s",
- non_self_participants)
-
-
def check_teamparticipation_circular(log):
"""Check circular references.
=== modified file 'lib/lp/registry/tests/test_teammembership.py'
--- lib/lp/registry/tests/test_teammembership.py 2011-12-09 16:06:45 +0000
+++ lib/lp/registry/tests/test_teammembership.py 2011-12-09 16:06:45 +0000
@@ -59,7 +59,6 @@
from lp.registry.scripts.teamparticipation import (
check_teamparticipation_circular,
check_teamparticipation_consistency,
- check_teamparticipation_self,
ConsistencyError,
fetch_team_participation_info,
fix_teamparticipation_consistency,
@@ -1121,8 +1120,6 @@
re.search('missing TeamParticipation entries for zzzzz', err))
self.failUnless(
re.search('spurious TeamParticipation entries for zzzzz', err))
- self.failUnless(
- re.search('not members of themselves:.*zzzzz.*', err))
def test_report_circular_team_references(self):
"""The script reports circular references between teams.
@@ -1259,11 +1256,10 @@
logger = BufferLogger()
self.addDetail("log", logger.content)
with StormStatementRecorder() as recorder:
- check_teamparticipation_self(logger)
check_teamparticipation_circular(logger)
check_teamparticipation_consistency(
logger, fetch_team_participation_info(logger))
- self.assertThat(recorder, HasQueryCount(Equals(6)))
+ self.assertThat(recorder, HasQueryCount(Equals(5)))
def test_suite():