Merge lp:~laney/ubuntu-archive-tools/promote-to-release-move into lp:ubuntu-archive-tools

Proposed by Iain Lane
Status: Merged
Merged at revision: 1455
Proposed branch: lp:~laney/ubuntu-archive-tools/promote-to-release-move
Merge into: lp:ubuntu-archive-tools
Diff against target: 70 lines (+3/-43)
1 file modified
promote-to-release (+3/-43)
To merge this branch: bzr merge lp:~laney/ubuntu-archive-tools/promote-to-release-move
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+399176@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

This LGTM.

It may be worth noting that this makes the handling of single-architecture promotions even more obviously fictional than it already was. It was already the case that requesting a single-architecture promotion in fact caused the source and all its binaries to be copied (since copyPackage doesn't expose a way to limit the copy by architectures). promote-by-release previously attempted to limit the deletion by architecture, but that didn't actually make much sense without also limiting the copy. Now the whole source will be both copied and deleted, or neither, regardless of any attempt by britney to request promotions of single architectures.

I think this is not really any worse than what was there before, but I thought I'd point it out.

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 2020-11-02 18:24:01 +0000
3+++ promote-to-release 2021-03-04 17:26:00 +0000
4@@ -53,10 +53,10 @@
5 return True
6
7 if options.dry_run:
8- print("Would copy: %s" % display)
9+ print("Would move: %s" % display)
10 return
11 elif options.verbose:
12- print("Copying: %s" % display)
13+ print("Moving: %s" % display)
14 sys.stdout.flush()
15
16 try:
17@@ -64,7 +64,7 @@
18 if options.pocket == 'updates':
19 percentage = 10
20 options.archive.copyPackage(
21- source_name=name, version=version,
22+ move=True, source_name=name, version=version,
23 from_archive=options.archive,
24 from_series=options.series.name, from_pocket="Proposed",
25 to_series=options.series.name, to_pocket=options.pocket.title(),
26@@ -75,46 +75,6 @@
27 print("copyPackage %s: %s" % (display, e.content), file=sys.stderr)
28 return False
29
30- try:
31- proposed_source = options.archive.getPublishedSources(
32- source_name=name, version=version,
33- distro_series=options.series, pocket="Proposed",
34- exact_match=True)[0]
35- except HTTPError as e:
36- print("getPublishedSources %s: %s" % (display, e.content),
37- file=sys.stderr)
38- return True
39- except IndexError:
40- print("getPublishedSources %s found no publication" % display,
41- file=sys.stderr)
42- return True
43-
44- if architecture is None:
45- try:
46- proposed_source.requestDeletion(removal_comment="moved to %s" %
47- options.pocket)
48- except HTTPError as e:
49- print("requestDeletion %s: %s" % (display, e.content),
50- file=sys.stderr)
51- else:
52- for bpph in proposed_source.getPublishedBinaries():
53- if bpph.is_debug:
54- continue
55- elif bpph.architecture_specific:
56- if architecture != bpph.distro_arch_series.architecture_tag:
57- continue
58- else:
59- if architecture != "i386":
60- continue
61- try:
62- bpph.requestDeletion(removal_comment="moved to %s" %
63- options.pocket)
64- except HTTPError as e:
65- print("requestDeletion %s/%s/%s: %s" %
66- (bpph.binary_package_name, bpph.binary_package_version,
67- bpph.distro_arch_series.architecture_tag, e.content),
68- file=sys.stderr)
69-
70 return True
71
72

Subscribers

People subscribed via source and target branches