Merge lp:~seb128/ubuntu-archive-tools/confirmation-for-not-team-owned-promotion into lp:ubuntu-archive-tools

Proposed by Sebastien Bacher
Status: Merged
Merged at revision: 1457
Proposed branch: lp:~seb128/ubuntu-archive-tools/confirmation-for-not-team-owned-promotion
Merge into: lp:ubuntu-archive-tools
Diff against target: 97 lines (+39/-22)
3 files modified
change-override (+17/-0)
lputils.py (+21/-0)
package-subscribers (+1/-22)
To merge this branch: bzr merge lp:~seb128/ubuntu-archive-tools/confirmation-for-not-team-owned-promotion
Reviewer Review Type Date Requested Status
Iain Lane Approve
Didier Roche-Tolomelli Approve
Review via email: mp+399310@code.launchpad.net

Commit message

Request confirmation before promoting a package without known owner

The new MIR team process doesn't require the team to be subscribed upfront
so ensure we don't forget to check it's done before promoting.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Looks good overall, some fixes needed and nitpicks :) Thanks for tackling this!

review: Needs Fixing
Revision history for this message
Iain Lane (laney) wrote :

One review comment and one nitpick inline. Thanks for looking at this :>

review: Needs Fixing
Revision history for this message
Steve Langasek (vorlon) :
1460. By Sebastien Bacher

Update to resolve some of the review comments
- replace the coded example by the real source
- check while iterating on the packages
- don't continue iterating after the first match
- limit the check to source promotions
- use if-not check pythonish syntax

1461. By Sebastien Bacher

use a safer default on only considering yes as a positive choice

1462. By Sebastien Bacher

reuse the launchpadlib distribution object

restrict the subscriber check to Ubuntu

Revision history for this message
Sebastien Bacher (seb128) wrote :

New commits pushed that should address the issue (and also restrict the check to the Ubuntu distribution, unsure if anyone ever change-override on other targets but since the MIR process is specific to Ubuntu I think it makes sense)

Revision history for this message
Sebastien Bacher (seb128) :
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Thanks a lot! All my remarks are now addressed. Fine by me.

review: Approve
Revision history for this message
Iain Lane (laney) wrote :

👍

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'change-override'
2--- change-override 2020-03-02 11:24:44 +0000
3+++ change-override 2021-03-09 09:43:26 +0000
4@@ -112,8 +112,25 @@
5
6 num_overridden = 0
7 num_same = 0
8+
9+ # The MIR teams subscription is specific to Ubuntu
10+ lpubuntu = None
11+ if options.distribution.name == 'ubuntu':
12+ lpubuntu = options.launchpad.distributions['ubuntu']
13+
14 for pubtype, publication in publications:
15 if pubtype == "source":
16+ if options.component == 'main' and lpubuntu:
17+ known_team_subscribed = False
18+ distribution_source_package = lpubuntu.getSourcePackage(name=publication.source_package_name)
19+ for subscription in distribution_source_package.getSubscriptions():
20+ subscriber = subscription.subscriber
21+ if subscriber.name in lputils.team_names:
22+ known_team_subscribed = True
23+ break
24+ if not known_team_subscribed:
25+ if YesNoQuestion().ask("No known owning team subscribed, do you really want to promote?", "no") != "yes":
26+ return
27 kwargs = source_kwargs
28 else:
29 kwargs = binary_kwargs
30
31=== modified file 'lputils.py'
32--- lputils.py 2018-01-05 12:24:50 +0000
33+++ lputils.py 2021-03-09 09:43:26 +0000
34@@ -43,6 +43,27 @@
35 '"ubuntu/partner" for a partner or copy archive.')
36
37
38+team_names = [
39+ 'canonical-support',
40+ 'checkbox-bugs',
41+ 'desktop-packages',
42+ 'documentation-packages',
43+ 'foundations-bugs',
44+ 'kernel-packages',
45+ 'kubuntu-bugs',
46+ 'landscape',
47+ 'maas-maintainers',
48+ 'mir-team',
49+ 'oem-solutions-engineers',
50+ 'pkg-ime',
51+ 'snappy-dev',
52+ 'translators-packages',
53+ 'ubuntu-openstack',
54+ 'ubuntu-printing',
55+ 'ubuntu-security',
56+ 'ubuntu-server',
57+ ]
58+
59 def setup_location(args, default_pocket="Release"):
60 archive = None
61 if getattr(args, "archive", False):
62
63=== modified file 'package-subscribers'
64--- package-subscribers 2021-01-21 17:06:42 +0000
65+++ package-subscribers 2021-03-09 09:43:26 +0000
66@@ -106,30 +106,9 @@
67
68 lputils.setup_location(options)
69
70- team_names = [
71- 'canonical-support',
72- 'checkbox-bugs',
73- 'desktop-packages',
74- 'documentation-packages',
75- 'foundations-bugs',
76- 'kernel-packages',
77- 'kubuntu-bugs',
78- 'landscape',
79- 'maas-maintainers',
80- 'mir-team',
81- 'oem-solutions-engineers',
82- 'pkg-ime',
83- 'snappy-dev',
84- 'translators-packages',
85- 'ubuntu-openstack',
86- 'ubuntu-printing',
87- 'ubuntu-security',
88- 'ubuntu-server',
89- ]
90-
91 data = { "unsubscribed": [] }
92 subscriptions = defaultdict(list)
93- for team_name in team_names:
94+ for team_name in lputils.team_names:
95 data[team_name] = []
96 team = launchpad.people[team_name]
97 team_subs = team.getBugSubscriberPackages()

Subscribers

People subscribed via source and target branches