Merge lp:~brian-murray/ubuntu-archive-tools/promote-to-updates into lp:ubuntu-archive-tools

Proposed by Brian Murray
Status: Merged
Approved by: Łukasz Zemczak
Approved revision: 1238
Merged at revision: 1241
Proposed branch: lp:~brian-murray/ubuntu-archive-tools/promote-to-updates
Merge into: lp:ubuntu-archive-tools
Diff against target: 78 lines (+19/-5)
1 file modified
promote-to-release (+19/-5)
To merge this branch: bzr merge lp:~brian-murray/ubuntu-archive-tools/promote-to-updates
Reviewer Review Type Date Requested Status
Łukasz Zemczak Approve
Review via email: mp+372888@code.launchpad.net

Commit message

promote-to-release: support promoting to -updates, utilize phased-update-percentage

Description of the change

Given that the pocket option has a default value of release this should be fine to merge straight away.

To post a comment you must log in.
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Elegant and nice. +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'promote-to-release'
2--- promote-to-release 2014-12-09 16:35:55 +0000
3+++ promote-to-release 2019-09-17 14:13:16 +0000
4@@ -34,16 +34,18 @@
5 else:
6 display = "%s/%s/%s" % (name, version, architecture)
7
8+ # check to see if the package and version has already been published or is
9+ # pending publication
10 if architecture is None:
11 try:
12 release_sources = options.archive.getPublishedSources(
13 source_name=name, version=version,
14- distro_series=options.series, pocket="Release",
15+ distro_series=options.series, pocket=options.pocket.title(),
16 exact_match=True, status="Published")
17 except IndexError:
18 release_sources = options.archive.getPublishedSources(
19 source_name=name, version=version,
20- distro_series=options.series, pocket="Release",
21+ distro_series=options.series, pocket=options.pocket.title(),
22 exact_match=True, status="Pending")
23 except HTTPError as e:
24 print("getPublishedSources %s: %s" % (display, e.content),
25@@ -60,12 +62,16 @@
26 sys.stdout.flush()
27
28 try:
29+ percentage = None
30+ if options.pocket == 'updates':
31+ percentage = 10
32 options.archive.copyPackage(
33 source_name=name, version=version,
34 from_archive=options.archive,
35 from_series=options.series.name, from_pocket="Proposed",
36- to_series=options.series.name, to_pocket="Release",
37+ to_series=options.series.name, to_pocket=options.pocket.title(),
38 include_binaries=True, sponsored=options.requestor,
39+ phased_update_percentage=percentage,
40 auto_approve=True)
41 except HTTPError as e:
42 print("copyPackage %s: %s" % (display, e.content), file=sys.stderr)
43@@ -87,7 +93,8 @@
44
45 if architecture is None:
46 try:
47- proposed_source.requestDeletion(removal_comment="moved to release")
48+ proposed_source.requestDeletion(removal_comment="moved to %s" %
49+ options.pocket)
50 except HTTPError as e:
51 print("requestDeletion %s: %s" % (display, e.content),
52 file=sys.stderr)
53@@ -102,7 +109,8 @@
54 if architecture != "i386":
55 continue
56 try:
57- bpph.requestDeletion(removal_comment="moved to release")
58+ bpph.requestDeletion(removal_comment="moved to %s" %
59+ options.pocket)
60 except HTTPError as e:
61 print("requestDeletion %s/%s/%s: %s" %
62 (bpph.binary_package_name, bpph.binary_package_version,
63@@ -173,9 +181,15 @@
64 parser.add_option(
65 "-s", "--series", dest="suite",
66 metavar="SERIES", help="promote from SERIES-proposed to SERIES")
67+ parser.add_option(
68+ "-p", "--pocket", default="release",
69+ help="the pocket to which the package should be copied")
70 options, args = parser.parse_args()
71 if len(args) != 1:
72 parser.error("need britney output delta file")
73+ if options.pocket not in ('updates', 'release'):
74+ parser.error("pocket must be updates or release not %s" %
75+ options.pocket)
76
77 options.launchpad = Launchpad.login_with(
78 "promote-to-release", options.launchpad_instance, version="devel")

Subscribers

People subscribed via source and target branches