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
=== modified file 'lib/lp/buildmaster/interfaces/buildfarmjob.py'
--- lib/lp/buildmaster/interfaces/buildfarmjob.py 2013-01-31 10:36:34 +0000
+++ lib/lp/buildmaster/interfaces/buildfarmjob.py 2013-05-01 23:06:26 +0000
@@ -203,9 +203,12 @@
203 as_of="beta",203 as_of="beta",
204 )204 )
205205
206 date_started = Datetime(206 date_started = exported(
207 title=_("Date started"), required=False, readonly=True,207 Datetime(
208 description=_("The timestamp when the build farm job was started."))208 title=_("Date started"), required=False, readonly=True,
209 description=_(
210 "The timestamp when the build farm job was started.")),
211 as_of="devel")
209212
210 date_finished = exported(213 date_finished = exported(
211 Datetime(214 Datetime(
@@ -216,10 +219,12 @@
216 as_of="beta",219 as_of="beta",
217 )220 )
218221
219 duration = Timedelta(222 duration = exported(
220 title=_("Duration"), required=False,223 Timedelta(
221 description=_("Duration interval, calculated when the "224 title=_("Duration"), required=False, readonly=True,
222 "result gets collected."))225 description=_("Duration interval, calculated when the "
226 "result gets collected.")),
227 as_of="devel")
223228
224 date_first_dispatched = exported(229 date_first_dispatched = exported(
225 Datetime(230 Datetime(
226231
=== modified file 'lib/lp/soyuz/stories/webservice/xx-builds.txt'
--- lib/lp/soyuz/stories/webservice/xx-builds.txt 2013-01-22 02:06:59 +0000
+++ lib/lp/soyuz/stories/webservice/xx-builds.txt 2013-05-01 23:06:26 +0000
@@ -96,6 +96,39 @@
96 upload_log_url: None96 upload_log_url: None
97 web_link: u'http://launchpad.../~cprov/+archive/ppa/+build/26'97 web_link: u'http://launchpad.../~cprov/+archive/ppa/+build/26'
9898
99devel webservice also contains build date_started and duration.
100
101 >>> builds_devel = webservice.named_get(
102 ... source_pub['self_link'].replace('beta', 'devel'), 'getBuilds')
103 >>> pprint_entry(builds_devel.jsonBody()['entries'][0])
104 arch_tag: u'i386'
105 archive_link: u'http://.../~cprov/+archive/ppa'
106 build_log_url:
107 u'http://.../~cprov/+archive/ppa/+build/26/+files/netapplet-1.0.0.tar.gz'
108 builder_link: u'http://.../builders/bob'
109 buildstate: u'Failed to build'
110 can_be_cancelled: False
111 can_be_rescored: False
112 can_be_retried: True
113 changesfile_url: None
114 current_source_publication_link:
115 u'http://.../~cprov/+archive/ppa/+sourcepub/27'
116 date_first_dispatched: None
117 date_started: u'2007-07-07T23:58:41+00:00'
118 datebuilt: u'2007-07-08T00:00:01+00:00'
119 datecreated: u'2007-07-08T00:00:00+00:00'
120 dependencies: None
121 distribution_link: u'http://.../ubuntu'
122 duration: u'0:01:20'
123 pocket: u'Release'
124 resource_type_link: u'http://.../#build'
125 score: None
126 self_link: u'http://.../~cprov/+archive/ppa/+build/26'
127 title: u'i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE'
128 upload_log_url: None
129 web_link: u'http://launchpad.../~cprov/+archive/ppa/+build/26'
130
131
99For testing purposes we will set 'buildlog' and 'upload_log' to the132For testing purposes we will set 'buildlog' and 'upload_log' to the
100same library file, so both can be verified.133same library file, so both can be verified.
101134