Merge ~rodrigo-zaiden/qa-regression-testing:change-qrt-alternates-readme into qa-regression-testing:master

Proposed by Rodrigo Figueiredo Zaiden
Status: Merged
Merged at revision: b15fd3d897d52d02cd890738bbb461f097072eee
Proposed branch: ~rodrigo-zaiden/qa-regression-testing:change-qrt-alternates-readme
Merge into: qa-regression-testing:master
Diff against target: 17 lines (+5/-4)
1 file modified
scripts/README (+5/-4)
Reviewer Review Type Date Requested Status
Alex Murray Approve
Review via email: mp+418551@code.launchpad.net

Commit message

README: Change QRT-Alternates flag definition

QRT-Alternates does not stop at first successful installation,
instead it goes through the whole list. It has the ability to
specify the package to be installed according to the release.
Also adding a note to try to keep one line per package
specification for a better maintainability.

Description of the change

At a first glance, from the README, one may understand that QRT-Alternates can be used to try to install a package and stop when the first one on the list is successful installed, but `scripts/packages-helper` does not stop in such case:

        for pkg in to_install:
            tmp = pkg.split(':')
            pkg = tmp[0]
            if pkg in skipped:
                continue
            print("Trying '%s' ..." % (pkg))
            attempted_install = True
            if install(pkg):
                installed = True
                continue

If we change the last `continue` to `break` it could do the trick, but it would break at least one existing script, such as `scripts/test-libvirt.py`, that has lots of specific packages for specific releases in the same line.

Briefly discussed with Alex Murray that suggested a change in the README instead of changing the packages-helper and consequentially having to change (and test) all scripts using it differently, with a potential risk of breaking things without a really well defined gain.

So, updated the README to remove the "stop at first successful installation" and added a note on the <pkg>:<release> alternation support.

Suggestions are more than welcome.
Thanks Alex and everyone looking.

To post a comment you must log in.
Revision history for this message
Alex Murray (alexmurray) wrote :

LGTM! Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/scripts/README b/scripts/README
2index cc842ad..dec5e5f 100644
3--- a/scripts/README
4+++ b/scripts/README
5@@ -47,10 +47,11 @@ that aren't run at build time and aren't packaged.
6
7 QRT-Alternates: each one of these lines should be resolved separately. It
8 consists of a list of packages that should be attempted to be installed,
9-in order, stopping at the first successful installation. If there is just
10-a single package list, it must be installed if it exists. If there are
11-multiple packages listed, at least one must be installed. (install-packages
12-uses this field.)
13+in order. Specific package names can be alternated for specific releases
14+using the formats <pkg>:<release> and <pkg>:<!release>, with the latter
15+being used to exclude the package from being installed in the specified
16+release. One line per package alternation is preferred for better
17+maintainability. (install-packages uses this field.)
18
19
20

Subscribers

People subscribed via source and target branches