Merge ~cjwatson/launchpad:snapbuild-requester-visibility into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 2fc29d02b45e13522aa3b1770684ce4841e86480
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:snapbuild-requester-visibility
Merge into: launchpad:master
Diff against target: 44 lines (+13/-2)
2 files modified
lib/lp/registry/model/person.py (+2/-1)
lib/lp/registry/tests/test_team.py (+11/-1)
Reviewer Review Type Date Requested Status
Cristian Gonzalez Approve
Review via email: mp+398007@code.launchpad.net

Commit message

Don't block team visibility changes due to SnapBuild.requester

To post a comment you must log in.
Revision history for this message
Cristian Gonzalez (cristiangsp) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/registry/model/person.py b/lib/lp/registry/model/person.py
2index 4746d64..b7c95db 100644
3--- a/lib/lp/registry/model/person.py
4+++ b/lib/lp/registry/model/person.py
5@@ -1,4 +1,4 @@
6-# Copyright 2009-2020 Canonical Ltd. This software is licensed under the
7+# Copyright 2009-2021 Canonical Ltd. This software is licensed under the
8 # GNU Affero General Public License version 3 (see the file LICENSE).
9
10 """Implementation classes for a Person."""
11@@ -2353,6 +2353,7 @@ class Person(
12 ('productseries', 'owner'),
13 ('sharingjob', 'grantee'),
14 ('signedcodeofconduct', 'owner'),
15+ ('snapbuild', 'requester'),
16 ('specificationsubscription', 'person'),
17 ('sshkey', 'person'),
18 ('structuralsubscription', 'subscriber'),
19diff --git a/lib/lp/registry/tests/test_team.py b/lib/lp/registry/tests/test_team.py
20index 7ffc5e1..e860410 100644
21--- a/lib/lp/registry/tests/test_team.py
22+++ b/lib/lp/registry/tests/test_team.py
23@@ -1,4 +1,4 @@
24-# Copyright 2010-2018 Canonical Ltd. This software is licensed under the
25+# Copyright 2010-2021 Canonical Ltd. This software is licensed under the
26 # GNU Affero General Public License version 3 (see the file LICENSE).
27
28 """Tests for PersonSet."""
29@@ -587,6 +587,16 @@ class TestVisibilityConsistencyWarning(TestCaseWithFactory):
30 None,
31 self.team.visibilityConsistencyWarning(PersonVisibility.PRIVATE))
32
33+ def test_no_warning_for_SnapBuild_requester(self):
34+ # Sometimes snap recipe builds can end up having their requester set
35+ # to a team for one reason or another. This doesn't cause a
36+ # warning, since the requester does not expose team membership
37+ # information.
38+ self.factory.makeSnapBuild(
39+ requester=self.team, snap=self.factory.makeSnap())
40+ self.assertIsNone(
41+ self.team.visibilityConsistencyWarning(PersonVisibility.PRIVATE))
42+
43
44 class TestPersonJoinTeam(TestCaseWithFactory):
45

Subscribers

People subscribed via source and target branches

to status/vote changes: