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
diff --git a/change-override b/change-override
index 4b0b940..b4308aa 100755
--- a/change-override
+++ b/change-override
@@ -103,6 +103,32 @@ def change_overrides(options, packages):
103 publication.phased_update_percentage),103 publication.phased_update_percentage),
104 "/".join(stringify_binary_kwargs(binary_kwargs))))104 "/".join(stringify_binary_kwargs(binary_kwargs))))
105105
106 # The MIR teams subscription is specific to Ubuntu
107 lpubuntu = None
108 if options.distribution.name == "ubuntu":
109 lpubuntu = options.launchpad.distributions["ubuntu"]
110 for pubtype, publication in publications:
111 if pubtype == "source":
112 if lpubuntu and options.component in ("main", "restricted"):
113 known_team_subscribed = False
114 source = publication.source_package_name
115 source_package = lpubuntu.getSourcePackage(name=source)
116 for subscription in source_package.getSubscriptions():
117 subscriber = subscription.subscriber
118 if subscriber.name in lputils.team_names:
119 known_team_subscribed = True
120 break
121 if not known_team_subscribed:
122 if (
123 YesNoQuestion().ask(
124 "No known owning team subscribed to '%s'. "
125 "Do you really want to promote?" % source,
126 "no",
127 )
128 != "yes"
129 ):
130 return
131
106 if options.dry_run:132 if options.dry_run:
107 print("Dry run; no publications overridden.")133 print("Dry run; no publications overridden.")
108 else:134 else:
@@ -113,32 +139,8 @@ def change_overrides(options, packages):
113 num_overridden = 0139 num_overridden = 0
114 num_same = 0140 num_same = 0
115141
116 # The MIR teams subscription is specific to Ubuntu
117 lpubuntu = None
118 if options.distribution.name == "ubuntu":
119 lpubuntu = options.launchpad.distributions["ubuntu"]
120
121 for pubtype, publication in publications:142 for pubtype, publication in publications:
122 if pubtype == "source":143 if pubtype == "source":
123 if lpubuntu and options.component in ("main", "restricted"):
124 known_team_subscribed = False
125 source = publication.source_package_name
126 source_package = lpubuntu.getSourcePackage(name=source)
127 for subscription in source_package.getSubscriptions():
128 subscriber = subscription.subscriber
129 if subscriber.name in lputils.team_names:
130 known_team_subscribed = True
131 break
132 if not known_team_subscribed:
133 if (
134 YesNoQuestion().ask(
135 "No known owning team subscribed to '%s'. "
136 "Do you really want to promote?" % source,
137 "no",
138 )
139 != "yes"
140 ):
141 return
142 kwargs = source_kwargs144 kwargs = source_kwargs
143 else:145 else:
144 kwargs = binary_kwargs146 kwargs = binary_kwargs

Subscribers

People subscribed via source and target branches