Merge ~paelzer/ubuntu-archive-tools:check-subscription-early into ubuntu-archive-tools:main

Proposed by Christian Ehrhardt 
Status: Merged
Merge reported by: Christian Ehrhardt 
Merged at revision: ba779189a6c555e601bf4d45d0c00c638255086a
Proposed branch: ~paelzer/ubuntu-archive-tools:check-subscription-early
Merge into: ubuntu-archive-tools:main
Diff against target: 70 lines (+26/-24)
1 file modified
change-override (+26/-24)
Reviewer Review Type Date Requested Status
Chris Halse Rogers Approve
Review via email: mp+417088@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Doko and I found that this check could be way more useful if available earlier.
It is only moving the code that Seb added slightly earlier to achieve that.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

example with --dry-run and the new code

$ ./change-override -c main vym -s jammy --source-and-binary --dry-run
Override component to main
vym 2.6.11-3build1 in jammy: universe/kde -> main
vym 2.6.11-3build1 in jammy amd64: universe/kde/optional/100% -> main
vym 2.6.11-3build1 in jammy arm64: universe/kde/optional/100% -> main
vym 2.6.11-3build1 in jammy armhf: universe/kde/optional/100% -> main
vym 2.6.11-3build1 in jammy ppc64el: universe/kde/optional/100% -> main
vym 2.6.11-3build1 in jammy riscv64: universe/kde/optional/100% -> main
vym 2.6.11-3build1 in jammy s390x: universe/kde/optional/100% -> main
No known owning team subscribed to 'vym'. Do you really want to promote? [y|N]?

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

I did rebase and push the branch again, just to make sure it is current (no changes needed).
Still need a positive feedback to merge it.

Revision history for this message
Chris Halse Rogers (raof) wrote :

That looks sensible to me!

review: Approve
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thank you RAOF, merged

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/change-override b/change-override
2index 4b0b940..b4308aa 100755
3--- a/change-override
4+++ b/change-override
5@@ -103,6 +103,32 @@ def change_overrides(options, packages):
6 publication.phased_update_percentage),
7 "/".join(stringify_binary_kwargs(binary_kwargs))))
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+ for pubtype, publication in publications:
14+ if pubtype == "source":
15+ if lpubuntu and options.component in ("main", "restricted"):
16+ known_team_subscribed = False
17+ source = publication.source_package_name
18+ source_package = lpubuntu.getSourcePackage(name=source)
19+ for subscription in 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 (
26+ YesNoQuestion().ask(
27+ "No known owning team subscribed to '%s'. "
28+ "Do you really want to promote?" % source,
29+ "no",
30+ )
31+ != "yes"
32+ ):
33+ return
34+
35 if options.dry_run:
36 print("Dry run; no publications overridden.")
37 else:
38@@ -113,32 +139,8 @@ def change_overrides(options, packages):
39 num_overridden = 0
40 num_same = 0
41
42- # The MIR teams subscription is specific to Ubuntu
43- lpubuntu = None
44- if options.distribution.name == "ubuntu":
45- lpubuntu = options.launchpad.distributions["ubuntu"]
46-
47 for pubtype, publication in publications:
48 if pubtype == "source":
49- if lpubuntu and options.component in ("main", "restricted"):
50- known_team_subscribed = False
51- source = publication.source_package_name
52- source_package = lpubuntu.getSourcePackage(name=source)
53- for subscription in source_package.getSubscriptions():
54- subscriber = subscription.subscriber
55- if subscriber.name in lputils.team_names:
56- known_team_subscribed = True
57- break
58- if not known_team_subscribed:
59- if (
60- YesNoQuestion().ask(
61- "No known owning team subscribed to '%s'. "
62- "Do you really want to promote?" % source,
63- "no",
64- )
65- != "yes"
66- ):
67- return
68 kwargs = source_kwargs
69 else:
70 kwargs = binary_kwargs

Subscribers

People subscribed via source and target branches