Merge ubuntu-archive-tools:blocked-by-tests into ubuntu-archive-tools:main

Proposed by Brian Murray
Status: Merged
Merged at revision: c312546516c21411117b2076d292c94de155a717
Proposed branch: ubuntu-archive-tools:blocked-by-tests
Merge into: ubuntu-archive-tools:main
Diff against target: 63 lines (+19/-4)
1 file modified
retry-autopkgtest-regressions (+19/-4)
Reviewer Review Type Date Requested Status
Paride Legovini (community) Approve
Lukas Märdian (community) Approve
Ubuntu Package Archive Administrators Pending
Review via email: mp+427241@code.launchpad.net

Description of the change

We'd been having issues with tests receiving a 403 from the proxy server and I wanted to rerun all the test failures of ubuntu-release-upgrader. I thought the --blocked-by argument would be the right one but it isn't. To avoid confusion going forward I've added a new '--blocked-by-tests' argument which might be clearer (I'm open to suggestions on the name and help). Additionally, this seems better than 'retry-autopkgtest-regressions | grep ubuntu-release-upgrader'.

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :
Revision history for this message
Lukas Märdian (slyon) wrote :

The new "--blocked-by-tests" logic LGTM and behaves in a way that I would have assumed "--blocked-by" works. BUT: There's one line "matches_blocked_by = False" that unconditionally disables the "--blocked-by" logic IMO, which you should have another look at (see inline comment below).

After that line is double checked (and potentially fixed) this MP is good for merging IMO.

=========

Handling the "--blocked-by" confusion is another topic, that we might or might not address in a different MP:

Looking at a report like this:
https://people.canonical.com/~ubuntu-archive/proposed-migration/update_excuses_by_team.html

binutils blocking gcc-11 (11.3.0-4ubuntu1 to 11.3.0-5ubuntu1) for 4 days
Regressions
binutils/2.38.90.20220713-2ubuntu1: arm64 (log, history)

I would assume "./retry-autopkgtests --blocks gcc-11" to output some "&package=binutils&trigger=gcc-11/..." tests (this works as expected) and "./retry-autopkgtests --blocked-by binutils" (being the reverse) to output the same "&package=binutils&trigger=gcc-11/..." test, but using the reverse search key. => This is what "--blocked-by-tests binutils" is now handling properly.

IMO the "--blocked-by" parameter is confusing and should maybe be renamed. Looking at the source code, it checks for "migrate-after", so maybe it should be renamed to something like "--depends"/"--requires"/"--migrate-after"/("--after-transition"). WDYT?

Revision history for this message
Lukas Märdian (slyon) wrote :

Thanks, LGTM.

review: Approve
Revision history for this message
Paride Legovini (paride) wrote :

Admittedly I had to stop and think a bit about what --blocked-by / --blocked-by-tests do, but it's mostly --blocked-by that confuses me. This LGTM, thanks.

review: Approve
Revision history for this message
Brian Murray (brian-murray) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/retry-autopkgtest-regressions b/retry-autopkgtest-regressions
2index 8752f92..7ff5a05 100755
3--- a/retry-autopkgtest-regressions
4+++ b/retry-autopkgtest-regressions
5@@ -83,6 +83,9 @@ def parse_args():
6 parser.add_argument('--blocked-by',
7 help='rerun only those tests that are blocked by (rdeps of) '
8 'the named package')
9+ parser.add_argument('--blocked-by-tests',
10+ help='rerun only those tests that are blocked by test '
11+ 'failures of the named package')
12 parser.add_argument('--no-proposed', action='store_true',
13 help='run tests against release+updates instead of '
14 'against proposed, to re-establish a baseline for the '
15@@ -224,7 +227,8 @@ def already_triggered(release, arch, pkg, triggers, extra_params, running, queue
16
17
18 def get_regressions(excuses_url, release, retry_states, min_age, max_age,
19- blocks, blocked_by, no_proposed, log_regex, force_cached):
20+ blocks, blocked_by, blocked_by_tests, no_proposed,
21+ log_regex, force_cached):
22 '''Return dictionary with regressions
23
24 Return dict: release → pkg → arch → [trigger, ...]
25@@ -255,8 +259,16 @@ def get_regressions(excuses_url, release, retry_states, min_age, max_age,
26 matches_blocked_by = blocked_by and blocked_by in excuse['dependencies']['migrate-after']
27 except KeyError:
28 matches_blocked_by = False
29+ try:
30+ matches_blocked_by_tests = False
31+ for issue in excuse['excuses']:
32+ if issue.startswith('autopkgtest for %s' % blocked_by_tests):
33+ matches_blocked_by_tests = True
34+ break
35+ except KeyError:
36+ mactches_blocked_by_tests = False
37
38- if (blocks or blocked_by) and not (matches_blocks or matches_blocked_by):
39+ if (blocks or blocked_by or blocked_by_tests) and not (matches_blocks or matches_blocked_by or matches_blocked_by_tests):
40 continue
41
42 try:
43@@ -277,6 +289,8 @@ def get_regressions(excuses_url, release, retry_states, min_age, max_age,
44 if no_proposed:
45 continue
46 pkg_ver = None
47+ if matches_blocked_by_tests and pkg != blocked_by_tests:
48+ continue
49 if no_proposed:
50 trigger = 'migration-reference/0'
51 else:
52@@ -356,8 +370,9 @@ else:
53 excuses_url = 'http://people.canonical.com/~ubuntu-archive/proposed-migration/%s/update_excuses.yaml.xz' % args.series
54 regressions = get_regressions(excuses_url, args.series, args.state,
55 args.min_age, args.max_age, args.blocks,
56- args.blocked_by, args.no_proposed,
57- args.log_regex, args.force_cached)
58+ args.blocked_by, args.blocked_by_tests,
59+ args.no_proposed, args.log_regex,
60+ args.force_cached)
61
62
63 # load JSON running and queued tests

Subscribers

People subscribed via source and target branches