Merge ~juliank/britney/+git/britney2-ubuntu:no-remove-pending-tests into ~juliank/britney/+git/britney2-ubuntu:master

Proposed by Julian Andres Klode
Status: Needs review
Proposed branch: ~juliank/britney/+git/britney2-ubuntu:no-remove-pending-tests
Merge into: ~juliank/britney/+git/britney2-ubuntu:master
Diff against target: 380 lines (+72/-34)
7 files modified
britney.conf (+4/-3)
britney.py (+15/-3)
britney2/policies/autopkgtest.py (+46/-23)
britney2/policies/email.py (+3/-3)
britney2/policies/sourceppa.py (+3/-0)
britney2/policies/sruadtregression.py (+1/-1)
britney_nobreakall.conf (+0/-1)
Reviewer Review Type Date Requested Status
Julian Andres Klode Pending
Review via email: mp+463025@code.launchpad.net
To post a comment you must log in.
467dfe8... by Julian Andres Klode

Use all-proposed in noble for all architectures

cdc015e... by Julian Andres Klode

Do not set all-proposed with migration-reference/0

b2436f7... by Julian Andres Klode

Only remove tests from pending for non-ignored results

This avoids endlessly requeuing the test if the test produces
an older result.

This will make tests "disappear" if the infrastructure returns
old results for newer triggers but avoids the problem right
now where we end up queuing the same tests every run.

Unmerged commits

b2436f7... by Julian Andres Klode

Only remove tests from pending for non-ignored results

This avoids endlessly requeuing the test if the test produces
an older result.

This will make tests "disappear" if the infrastructure returns
old results for newer triggers but avoids the problem right
now where we end up queuing the same tests every run.

cdc015e... by Julian Andres Klode

Do not set all-proposed with migration-reference/0

467dfe8... by Julian Andres Klode

Use all-proposed in noble for all architectures

a3da577... by Steve Langasek

Merge branch 'no-implicit-dependency-policy'

ad797bd... by Julian Andres Klode

Revert "Temporarily disable use of sqlite db for autopkgtests"

The database has been regenerated, so let's switch back to using
it to speed up britney.

This reverts commit e0fb5d881654438dda09143e6b48c6d153975232.

57710ee... by Michael Hudson-Doyle

autopkgtest: Fix the date creation and comparison for time_t hack

50d59b6... by Brian Murray

Fix a pep8 issue

bc3a622... by Julian Andres Klode

Temporarily queue noble armhf tests with all-proposed=1

This is needed for the time_t transition.

e5a438f... by Steve Langasek

Add support in code for disabling ImplicitDependencyPolicy, and disable it

08a27a5... by Ɓukasz Zemczak

Attempt to get swift results working properly by using a workaround from security-britney.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/britney.conf b/britney.conf
2index e6b1d4e..b6c82ed 100644
3--- a/britney.conf
4+++ b/britney.conf
5@@ -57,7 +57,6 @@ BOUNTY_MIN_AGE = 2
6 HINTSDIR = data/%(SERIES)-proposed/Hints
7
8 # hint permissions
9-HINTS_ADCONRAD = ALL
10 HINTS_LANEY = ALL
11 HINTS_STEFANOR = ALL
12 HINTS_STGRABER = ALL
13@@ -82,7 +81,7 @@ HINTS_FREEZE = block block-all
14 #
15 # naming a non-existent section will effectively disable new smooth
16 # updates but still allow removals to occur
17-SMOOTH_UPDATES = badgers
18+SMOOTH_UPDATES = libs oldlibs
19
20 IGNORE_CRUFT = 0
21
22@@ -90,6 +89,8 @@ REMOVE_OBSOLETE = no
23
24 CHECK_BUILDD = no
25
26+IMPLICIT_DEPS = no
27+
28 ADT_ENABLE = yes
29 ADT_ARCHES = amd64 i386 armhf ppc64el arm64
30 ADT_AMQP = amqp://test_request:password@autopkgtest-amqp.internal
31@@ -101,7 +102,7 @@ ADT_PPAS =
32 ADT_SHARED_RESULTS_CACHE =
33 # Swift base URL with the results (must be publicly readable and browsable)
34 # or file location if results are pre-fetched
35-ADT_SWIFT_URL = https://autopkgtest.ubuntu.com/results/
36+ADT_SWIFT_URL = https://objectstorage.prodstack5.canonical.com/swift/v1/AUTH_0f9aae918d5b4744bf7b827671c86842/
37 # Base URL for autopkgtest site, used for links in the excuses
38 ADT_CI_URL = https://autopkgtest.ubuntu.com/
39 # URL for the autopkgtest database, if used
40diff --git a/britney.py b/britney.py
41index b5deff2..8d8f427 100755
42--- a/britney.py
43+++ b/britney.py
44@@ -236,6 +236,8 @@ from britney2.utils import (log_and_format_old_libraries,
45 __author__ = 'Fabio Tranchitella and the Debian Release Team'
46 __version__ = '2.0'
47
48+# "temporarily" raise recursion limit for the auto hinter
49+sys.setrecursionlimit(2000)
50
51 class Britney(object):
52 """Britney, the Debian testing updater script
53@@ -521,8 +523,9 @@ class Britney(object):
54 self._policy_engine.add_policy(RCBugPolicy(self.options, self.suite_info))
55 if getattr(self.options, 'piuparts_enable', 'yes') == 'yes':
56 self._policy_engine.add_policy(PiupartsPolicy(self.options, self.suite_info))
57- if getattr(self.options, 'adt_enable') == 'yes':
58- self._policy_engine.add_policy(AutopkgtestPolicy(self.options, self.suite_info))
59+ add_autopkgtest_policy = getattr(self.options, 'adt_enable', 'no')
60+ if add_autopkgtest_policy in ('yes', 'dry-run'):
61+ self._policy_engine.add_policy(AutopkgtestPolicy(self.options, self.suite_info, dry_run=add_autopkgtest_policy == 'dry-run'))
62 self._policy_engine.add_policy(AgePolicy(self.options, self.suite_info, MINDAYS))
63 # XXX this policy results in asymmetric enforcement of
64 # build-dependencies in the release pocket (nothing blocks
65@@ -535,7 +538,13 @@ class Britney(object):
66 self._policy_engine.add_policy(BlockPolicy(self.options, self.suite_info))
67 # XXX re-enable once https://bugs.launchpad.net/launchpad/+bug/1868558 is fixed
68 # self._policy_engine.add_policy(BuiltUsingPolicy(self.options, self.suite_info))
69- self._policy_engine.add_policy(ImplicitDependencyPolicy(self.options, self.suite_info))
70+ # This policy is objectively terrible, it reduces britney runtime
71+ # at the cost of giving only partial information about blocking
72+ # packages during large transitions instead of giving full detail in
73+ # update_output that the team can work through in parallel, thus
74+ # dragging out complicated transitions. vorlon 20240214
75+ if getattr(self.options, 'implicit_deps', 'yes') == 'yes':
76+ self._policy_engine.add_policy(ImplicitDependencyPolicy(self.options, self.suite_info))
77 if getattr(self.options, 'check_buildd', 'no') == 'yes':
78 self._policy_engine.add_policy(BuiltOnBuilddPolicy(self.options, self.suite_info))
79 self._policy_engine.add_policy(LPBlockBugPolicy(self.options, self.suite_info))
80@@ -1461,6 +1470,9 @@ class Britney(object):
81 """
82 self.logger.info("> Processing hints from the auto hinter")
83
84+ self.logger.info(">> Skipping auto hinting due to recursion problem")
85+ return []
86+
87 sources_t = self.suite_info.target_suite.sources
88 excuses = self.excuses
89
90diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py
91index 5faba7e..ac001c3 100644
92--- a/britney2/policies/autopkgtest.py
93+++ b/britney2/policies/autopkgtest.py
94@@ -19,7 +19,7 @@
95 import calendar
96 import collections
97 from copy import deepcopy
98-from datetime import datetime
99+from datetime import datetime, date
100 from enum import Enum
101 import os
102 import json
103@@ -117,7 +117,8 @@ class AutopkgtestPolicy(BasePolicy):
104 reject the upload if any of those regress.
105 """
106
107- def __init__(self, options, suite_info):
108+ def __init__(self, options, suite_info, dry_run=False):
109+
110 super().__init__('autopkgtest', options, suite_info, {SuiteClass.PRIMARY_SOURCE_SUITE})
111 # tests requested in this and previous runs
112 # trigger -> src -> [arch]
113@@ -126,6 +127,7 @@ class AutopkgtestPolicy(BasePolicy):
114 self.testsuite_triggers = {}
115 self.result_in_baseline_cache = collections.defaultdict(dict)
116 self.database_path = os.path.join(self.state_dir, 'autopkgtest.db')
117+ self.dry_run = dry_run
118
119 # results map: trigger -> src -> arch -> [passed, version, run_id, seen]
120 # - trigger is "source/version" of an unstable package that triggered
121@@ -292,7 +294,7 @@ class AutopkgtestPolicy(BasePolicy):
122 # Initialize AMQP connection
123 self.amqp_channel = None
124 self.amqp_file = None
125- if self.options.dry_run:
126+ if self.options.dry_run or self.dry_run:
127 return
128
129 amqp_url = self.options.adt_amqp
130@@ -475,7 +477,7 @@ class AutopkgtestPolicy(BasePolicy):
131 history_url = cloud_url % {
132 'h': srchash(testsrc), 's': testsrc,
133 'r': self.options.series, 'a': arch}
134- if status == 'REGRESSION':
135+ if status in ['REGRESSION', 'RUNNING-REFERENCE']:
136 if self.options.adt_retry_url_mech == 'run_id':
137 retry_url = self.options.adt_ci_url + 'api/v1/retry/' + run_id
138 else:
139@@ -892,7 +894,8 @@ class AutopkgtestPolicy(BasePolicy):
140
141 # request new results from swift
142 url = os.path.join(swift_url, self.swift_container)
143- url += '?' + urllib.parse.urlencode(query)
144+ # XXX: Workaround for PS5 swift deployment - container name needs to be suffixed with /
145+ url += '/?' + urllib.parse.urlencode(query)
146 f = None
147 try:
148 f = self.download_retry(url)
149@@ -1029,7 +1032,7 @@ class AutopkgtestPolicy(BasePolicy):
150 ' r.run_id FROM test AS t '
151 'LEFT JOIN result AS r ON t.id=r.test_id '
152 'WHERE t.release=? AND t.arch=? '
153- 'AND t.package=? AND r.run_id >= ?',
154+ 'AND t.package=? AND r.run_id > ?',
155 (self.options.series, arch, src, latest_run_id)):
156 exitcode, ver, triggers, run_id = row
157 if not ver:
158@@ -1048,7 +1051,7 @@ class AutopkgtestPolicy(BasePolicy):
159
160 # parse recorded triggers in test result
161 if triggers:
162- result_triggers = [i for i in triggers.split(' ', 1) if '/' in i]
163+ result_triggers = [i for i in triggers.split(' ') if '/' in i]
164 else:
165 self.logger.error('%s result has no ADT_TEST_TRIGGERS, ignoring')
166 continue
167@@ -1068,13 +1071,10 @@ class AutopkgtestPolicy(BasePolicy):
168 'Fetched test result for %s/%s/%s %s (triggers: %s): %s',
169 src, ver, arch, run_id, result_triggers, result.name.lower())
170
171- # remove matching test requests
172- for trigger in result_triggers:
173- self.remove_from_pending(trigger, src, arch)
174-
175- # add this result
176+ # add this result and remove pending test requests if valid
177 for trigger in result_triggers:
178- self.add_trigger_to_results(trigger, src, ver, arch, run_id, seen, result)
179+ if self.add_trigger_to_results(trigger, src, ver, arch, run_id, seen, result):
180+ self.remove_from_pending(trigger, src, arch)
181
182 def remove_from_pending(self, trigger, src, arch):
183 try:
184@@ -1094,10 +1094,10 @@ class AutopkgtestPolicy(BasePolicy):
185 (trigsrc, trigver) = trigger.split('/', 1)
186 except ValueError:
187 self.logger.info('Ignoring invalid test trigger %s', trigger)
188- return
189+ return False
190 if trigsrc == src and apt_pkg.version_compare(ver, trigver) < 0:
191 self.logger.debug('test trigger %s, but run for older version %s, ignoring', trigger, ver)
192- return
193+ return False
194
195 result = self.test_results.setdefault(trigger, {}).setdefault(
196 src, {}).setdefault(arch, [Result.FAIL, None, '', 0])
197@@ -1111,13 +1111,15 @@ class AutopkgtestPolicy(BasePolicy):
198 result[2] = run_id
199 result[3] = seen
200
201+ return True
202+
203 def send_test_request(self, src, arch, triggers, huge=False):
204 '''Send out AMQP request for testing src/arch for triggers
205
206 If huge is true, then the request will be put into the -huge instead of
207 normal queue.
208 '''
209- if self.options.dry_run:
210+ if self.options.dry_run or self.dry_run:
211 return
212
213 params = {'triggers': triggers}
214@@ -1128,6 +1130,11 @@ class AutopkgtestPolicy(BasePolicy):
215 qname = 'debci-huge-%s-%s' % (self.options.series, arch)
216 else:
217 qname = 'debci-%s-%s' % (self.options.series, arch)
218+ # FIXME: Remove after the time_t transition
219+ if (self.options.series == "noble" and
220+ "migration-reference/0" not in triggers and
221+ datetime.utcnow().date() < date(2024, 4, 4)):
222+ params["all-proposed"] = "1"
223 params['submit-time'] = datetime.strftime(datetime.utcnow(), '%Y-%m-%d %H:%M:%S%z')
224
225 if self.amqp_channel:
226@@ -1168,11 +1175,12 @@ class AutopkgtestPolicy(BasePolicy):
227 if has_result:
228 result_state = result[0]
229 version = result[1]
230- baseline = self.result_in_baseline(src, arch)
231 if result_state in {Result.OLD_PASS, Result.OLD_FAIL, Result.OLD_NEUTRAL}:
232 pass
233 elif result_state == Result.FAIL and \
234- baseline[0] in {Result.PASS, Result.NEUTRAL, Result.OLD_PASS, Result.OLD_NEUTRAL} and \
235+ self.result_in_baseline(src, arch)[0] in \
236+ {Result.PASS, Result.NEUTRAL, Result.OLD_PASS,
237+ Result.OLD_NEUTRAL} and \
238 self.options.adt_retry_older_than and \
239 result[3] + int(self.options.adt_retry_older_than) * SECPERDAY < self._now:
240 # We might want to retry this failure, so continue
241@@ -1233,7 +1241,21 @@ class AutopkgtestPolicy(BasePolicy):
242 result_reference = [Result.NONE, None, '', 0]
243 if self.options.adt_baseline == 'reference':
244 try:
245- result_reference = self.test_results[REF_TRIG][src][arch]
246+ try:
247+ result_reference = self.test_results[REF_TRIG][src][arch]
248+ except KeyError:
249+ uses_swift = not self.options.adt_swift_url.startswith('file://')
250+ # Without swift or autopkgtest.db we don't expect new results
251+ if hasattr(self,'db'):
252+ self.logger.info('Checking for new results for %s/%s for trigger %s', src, arch, REF_TRIG)
253+ self.fetch_sqlite_results(src, arch)
254+ elif uses_swift:
255+ self.logger.info('Checking for new results for %s/%s for trigger %s', src, arch, REF_TRIG)
256+ self.fetch_swift_results(self.options.adt_swift_url, src, arch)
257+
258+ # do we have one now?
259+ result_reference = self.test_results[REF_TRIG][src][arch]
260+
261 self.logger.debug('Found result for src %s in reference: %s',
262 src, result_reference[0].name)
263 except KeyError:
264@@ -1270,9 +1292,6 @@ class AutopkgtestPolicy(BasePolicy):
265 binaries_info = target_suite.binaries[arch]
266
267 # determine current test result status
268- baseline_result = self.result_in_baseline(src, arch)[0]
269-
270- # determine current test result status
271 until = self.find_max_lower_force_reset_test(src, ver, arch)
272
273 # Special-case triggers from linux-meta*: we cannot compare results
274@@ -1297,6 +1316,9 @@ class AutopkgtestPolicy(BasePolicy):
275 run_id = r[2]
276
277 if r[0] in {Result.FAIL, Result.OLD_FAIL}:
278+ # determine current test result status
279+ baseline_result = self.result_in_baseline(src, arch)[0]
280+
281 if baseline_result == Result.FAIL:
282 result = 'ALWAYSFAIL'
283 elif baseline_result in {Result.NONE, Result.OLD_FAIL}:
284@@ -1354,6 +1376,7 @@ class AutopkgtestPolicy(BasePolicy):
285 except KeyError:
286 # no result for src/arch; still running?
287 if arch in self.pending_tests.get(trigger, {}).get(src, []):
288+ baseline_result = self.result_in_baseline(src, arch)[0]
289 if baseline_result != Result.FAIL and not self.has_force_badtest(src, ver, arch):
290 result = 'RUNNING'
291 else:
292@@ -1420,10 +1443,10 @@ class AutopkgtestPolicy(BasePolicy):
293 self.reset_hints = self.hints.search('force-reset-test')
294
295 for hint in self.reset_hints:
296- self.logger.info('Checking hints for %s/%s/%s: %s' % (src, ver, arch, str(hint)))
297 for mi in hint.packages:
298 if mi.package != src:
299 continue
300+ self.logger.info('Checking hints for %s/%s/%s: %s' % (src, ver, arch, str(hint)))
301 if (mi.architecture in ['source', arch] and
302 mi.version != 'all' and
303 apt_pkg.version_compare(mi.version, ver) >= 0):
304diff --git a/britney2/policies/email.py b/britney2/policies/email.py
305index f500a79..349bf91 100644
306--- a/britney2/policies/email.py
307+++ b/britney2/policies/email.py
308@@ -28,7 +28,7 @@ BOTS = {
309 USER + "katie",
310 }
311
312-MESSAGE = """From: Ubuntu Release Team <noreply@canonical.com>
313+MESSAGE = """From: Ubuntu Release Team <noreply+proposed-migration@ubuntu.com>
314 To: {recipients}
315 X-Proposed-Migration: notice
316 Subject: [proposed-migration] {source_name} {version} stuck in {series}-proposed for {age} day{plural}.
317@@ -45,7 +45,7 @@ http://people.canonical.com/~ubuntu-archive/proposed-migration/{series}/update_e
318
319 https://wiki.ubuntu.com/ProposedMigration
320
321-If you have any questions about this email, please ask them in #ubuntu-release channel on Freenode IRC.
322+If you have any questions about this email, please ask them in #ubuntu-release channel on libera.chat.
323
324 Regards, Ubuntu Release Team.
325 """
326@@ -287,7 +287,7 @@ class EmailPolicy(BasePolicy, Rest):
327 )
328 )
329 server = smtplib.SMTP(self.email_host)
330- server.sendmail("noreply@canonical.com", emails, msg)
331+ server.sendmail("noreply+proposed-migration@ubuntu.com", emails, msg)
332 server.quit()
333 # record the age at which the mail should have been sent
334 last_sent = last_due
335diff --git a/britney2/policies/sourceppa.py b/britney2/policies/sourceppa.py
336index ea01e76..bbef00d 100644
337--- a/britney2/policies/sourceppa.py
338+++ b/britney2/policies/sourceppa.py
339@@ -15,6 +15,7 @@ from britney2.policies.policy import BasePolicy, PolicyVerdict
340 LAUNCHPAD_URL = "https://api.launchpad.net/1.0/"
341 PRIMARY = LAUNCHPAD_URL + "ubuntu/+archive/primary"
342 INCLUDE = ["~bileto-ppa-service/", "~ci-train-ppa-service/"]
343+EXCLUDE = ["~ci-train-ppa-service/+archive/ubuntu/4810", "~ci-train-ppa-service/+archive/ubuntu/4813", "~ci-train-ppa-service/+archive/ubuntu/4815", "~ci-train-ppa-service/+archive/ubuntu/4816"]
344
345
346 class SourcePPAPolicy(BasePolicy, Rest):
347@@ -105,6 +106,8 @@ class SourcePPAPolicy(BasePolicy, Rest):
348 sourceppa = self.lp_get_source_ppa(source_name, version) or ""
349 verdict = excuse.policy_verdict
350 self.source_ppas_by_pkg[source_name][version] = sourceppa
351+ if [team for team in EXCLUDE if team in sourceppa]:
352+ return PolicyVerdict.PASS
353 if not [team for team in INCLUDE if team in sourceppa]:
354 return PolicyVerdict.PASS
355
356diff --git a/britney2/policies/sruadtregression.py b/britney2/policies/sruadtregression.py
357index 1c8ac82..6fa8985 100644
358--- a/britney2/policies/sruadtregression.py
359+++ b/britney2/policies/sruadtregression.py
360@@ -171,7 +171,7 @@ class SRUADTRegressionPolicy(BasePolicy, Rest):
361 bug_mail = "%s@bugs.launchpad.net" % bug
362 server = smtplib.SMTP(self.email_host)
363 server.sendmail(
364- "noreply@canonical.com",
365+ "noreply+proposed-migration@ubuntu.com",
366 bug_mail,
367 MESSAGE.format(**locals()),
368 )
369diff --git a/britney_nobreakall.conf b/britney_nobreakall.conf
370index 5da361b..4576790 100644
371--- a/britney_nobreakall.conf
372+++ b/britney_nobreakall.conf
373@@ -57,7 +57,6 @@ BOUNTY_MIN_AGE = 2
374 HINTSDIR = data/%(SERIES)-proposed/Hints
375
376 # hint permissions
377-HINTS_ADCONRAD = ALL
378 HINTS_LANEY = ALL
379 HINTS_STEFANOR = ALL
380 HINTS_STGRABER = ALL

Subscribers

People subscribed via source and target branches

to all changes: