Merge lp:~ursinha/launchpad/fix-588062-751160-expose-build-duration-build-datestarted into lp:launchpad

Proposed by Ursula Junque
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 16597
Proposed branch: lp:~ursinha/launchpad/fix-588062-751160-expose-build-duration-build-datestarted
Merge into: lp:launchpad
Diff against target: 79 lines (+45/-7)
2 files modified
lib/lp/buildmaster/interfaces/buildfarmjob.py (+12/-7)
lib/lp/soyuz/stories/webservice/xx-builds.txt (+33/-0)
To merge this branch: bzr merge lp:~ursinha/launchpad/fix-588062-751160-expose-build-duration-build-datestarted
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+161979@code.launchpad.net

Commit message

Exports build duration and date_started on devel lp api.

Description of the change

Fixes bugs 588062 and 751160, exporting the build duration and date started on devel lp api.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/buildmaster/interfaces/buildfarmjob.py'
2--- lib/lp/buildmaster/interfaces/buildfarmjob.py 2013-01-31 10:36:34 +0000
3+++ lib/lp/buildmaster/interfaces/buildfarmjob.py 2013-05-01 23:06:26 +0000
4@@ -203,9 +203,12 @@
5 as_of="beta",
6 )
7
8- date_started = Datetime(
9- title=_("Date started"), required=False, readonly=True,
10- description=_("The timestamp when the build farm job was started."))
11+ date_started = exported(
12+ Datetime(
13+ title=_("Date started"), required=False, readonly=True,
14+ description=_(
15+ "The timestamp when the build farm job was started.")),
16+ as_of="devel")
17
18 date_finished = exported(
19 Datetime(
20@@ -216,10 +219,12 @@
21 as_of="beta",
22 )
23
24- duration = Timedelta(
25- title=_("Duration"), required=False,
26- description=_("Duration interval, calculated when the "
27- "result gets collected."))
28+ duration = exported(
29+ Timedelta(
30+ title=_("Duration"), required=False, readonly=True,
31+ description=_("Duration interval, calculated when the "
32+ "result gets collected.")),
33+ as_of="devel")
34
35 date_first_dispatched = exported(
36 Datetime(
37
38=== modified file 'lib/lp/soyuz/stories/webservice/xx-builds.txt'
39--- lib/lp/soyuz/stories/webservice/xx-builds.txt 2013-01-22 02:06:59 +0000
40+++ lib/lp/soyuz/stories/webservice/xx-builds.txt 2013-05-01 23:06:26 +0000
41@@ -96,6 +96,39 @@
42 upload_log_url: None
43 web_link: u'http://launchpad.../~cprov/+archive/ppa/+build/26'
44
45+devel webservice also contains build date_started and duration.
46+
47+ >>> builds_devel = webservice.named_get(
48+ ... source_pub['self_link'].replace('beta', 'devel'), 'getBuilds')
49+ >>> pprint_entry(builds_devel.jsonBody()['entries'][0])
50+ arch_tag: u'i386'
51+ archive_link: u'http://.../~cprov/+archive/ppa'
52+ build_log_url:
53+ u'http://.../~cprov/+archive/ppa/+build/26/+files/netapplet-1.0.0.tar.gz'
54+ builder_link: u'http://.../builders/bob'
55+ buildstate: u'Failed to build'
56+ can_be_cancelled: False
57+ can_be_rescored: False
58+ can_be_retried: True
59+ changesfile_url: None
60+ current_source_publication_link:
61+ u'http://.../~cprov/+archive/ppa/+sourcepub/27'
62+ date_first_dispatched: None
63+ date_started: u'2007-07-07T23:58:41+00:00'
64+ datebuilt: u'2007-07-08T00:00:01+00:00'
65+ datecreated: u'2007-07-08T00:00:00+00:00'
66+ dependencies: None
67+ distribution_link: u'http://.../ubuntu'
68+ duration: u'0:01:20'
69+ pocket: u'Release'
70+ resource_type_link: u'http://.../#build'
71+ score: None
72+ self_link: u'http://.../~cprov/+archive/ppa/+build/26'
73+ title: u'i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE'
74+ upload_log_url: None
75+ web_link: u'http://launchpad.../~cprov/+archive/ppa/+build/26'
76+
77+
78 For testing purposes we will set 'buildlog' and 'upload_log' to the
79 same library file, so both can be verified.
80