~launchpad-pqm/launchpad/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
Buildd-mass-retry behaviour
===========================

    >>> import subprocess
    >>> import os
    >>> import sys
    >>> from lp.services.config import config

'buildd-mass-retry' is a tool designed to retry a group of 'failed'
build records in a distroseries and/or architecture.

    >>> script = os.path.join(
    ...     config.root, "scripts", "ftpmaster-tools", "buildd-mass-retry.py")

The user can specify a distribution, a suite name (-s) and/or and
architecture (-a) as a build record provider, it will restrict the
target group.

Also, can combine the types of failure we allow to be retried:

 * -F: retry builds marked as FAILEDTOBUILD
 * -D: retry builds marked as MANUALDEPWAIT
 * -C: retry builds marked as CHROOTWAIT

The available types can be combined acording the situation.

The script provides dry-run mode (-N).

See binarypackagebuild.txt for more information about IBuild.retry().

Passing only suite, request retry on all failed states:

    >>> process = subprocess.Popen(
    ...     [sys.executable, script, "-v", "-NFDC", "-s", "hoary"],
    ...     stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    >>> stdout, stderr = process.communicate()
    >>> process.returncode
    0
    >>> print stderr
    INFO    Creating lockfile: ...
    INFO    Initializing Build Mass-Retry for
    'The Hoary Hedgehog Release/RELEASE'
    INFO    Processing builds in 'Failed to build'
    INFO    Processing builds in 'Dependency wait'
    INFO    Retrying i386 build of libstdc++ b8p in ubuntu hoary RELEASE (12)
    INFO    Processing builds in 'Chroot problem'
    INFO    Success.
    INFO    Dry-run.
    DEBUG   Removing lock file: ...
    <BLANKLINE>

Superseded builds won't be retried; buildd-manager will just skip the build
and set it to SUPERSEDED.

    >>> from zope.security.proxy import removeSecurityProxy
    >>> from lp.soyuz.interfaces.binarypackagebuild import (
    ...     IBinaryPackageBuildSet)
    >>> from lp.soyuz.enums import PackagePublishingStatus
    >>> build = getUtility(IBinaryPackageBuildSet).getByID(12)
    >>> pub = removeSecurityProxy(build.current_source_publication)

Let's mark the build from the previous run superseded.

    >>> pub.status = PackagePublishingStatus.SUPERSEDED
    >>> print build.current_source_publication
    None
    >>> transaction.commit()

A new run doesn't pick it up.

    >>> process = subprocess.Popen(
    ...     [sys.executable, script, "-v", "-NFDC", "-s", "hoary"],
    ...     stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    >>> stdout, stderr = process.communicate()
    >>> process.returncode
    0
    >>> print stderr
    INFO    Creating lockfile: ...
    INFO    Initializing Build Mass-Retry for
    'The Hoary Hedgehog Release/RELEASE'
    INFO    Processing builds in 'Failed to build'
    INFO    Processing builds in 'Dependency wait'
    DEBUG   Skipping superseded i386 build of libstdc++ b8p in
    ubuntu hoary RELEASE (12)
    INFO    Processing builds in 'Chroot problem'
    INFO    Success.
    INFO    Dry-run.
    DEBUG   Removing lock file: ...
    <BLANKLINE>

    >>> pub.status = PackagePublishingStatus.PUBLISHED
    >>> transaction.commit()

Passing an architecture, which contains no failed build records,
nothing is done:

    >>> process = subprocess.Popen(
    ...     [
    ...         sys.executable, script,
    ...         "-v", "-NFDC", "-s", "hoary", "-a", "hppa",
    ...     ],
    ...     stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    >>> stdout, stderr = process.communicate()
    >>> process.returncode
    0
    >>> print stderr
    INFO    Creating lockfile: ...
    INFO    Initializing Build Mass-Retry for
    'The Hoary Hedgehog Release for hppa (hppa)/RELEASE'
    INFO    Processing builds in 'Failed to build'
    INFO    Processing builds in 'Dependency wait'
    INFO    Processing builds in 'Chroot problem'
    INFO    Success.
    INFO    Dry-run.
    DEBUG   Removing lock file: ...
    <BLANKLINE>


Selecting only a specific failed state:

    >>> process = subprocess.Popen(
    ...     [sys.executable, script, "-v", "-NF", "-s", "hoary"],
    ...     stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    >>> stdout, stderr = process.communicate()
    >>> process.returncode
    0
    >>> print stderr
    INFO    Creating lockfile: ...
    INFO    Initializing Build Mass-Retry for
    'The Hoary Hedgehog Release/RELEASE'
    INFO    Processing builds in 'Failed to build'
    INFO    Success.
    INFO    Dry-run.
    DEBUG   Removing lock file: ...
    <BLANKLINE>