← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Ursula Junque has proposed merging lp:~ursinha/launchpad/fix-588062-751160-expose-build-duration-build-datestarted into lp:launchpad.

Commit message:
Exports build duration and date_started on devel lp api.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)
Related bugs:
  Bug #588062 in Launchpad itself: "Expose date_started for builds"
  https://bugs.launchpad.net/launchpad/+bug/588062
  Bug #751160 in Launchpad itself: "lp api:  please expose buildduration in the build record"
  https://bugs.launchpad.net/launchpad/+bug/751160

For more details, see:
https://code.launchpad.net/~ursinha/launchpad/fix-588062-751160-expose-build-duration-build-datestarted/+merge/161979

Fixes bugs 588062 and 751160, exporting the build duration and date started on devel lp api.
-- 
https://code.launchpad.net/~ursinha/launchpad/fix-588062-751160-expose-build-duration-build-datestarted/+merge/161979
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~ursinha/launchpad/fix-588062-751160-expose-build-duration-build-datestarted into lp:launchpad.
=== 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:04:28 +0000
@@ -203,9 +203,12 @@
         as_of="beta",
         )
 
-    date_started = Datetime(
-        title=_("Date started"), required=False, readonly=True,
-        description=_("The timestamp when the build farm job was started."))
+    date_started = exported(
+        Datetime(
+            title=_("Date started"), required=False, readonly=True,
+            description=_(
+                "The timestamp when the build farm job was started.")),
+        as_of="devel")
 
     date_finished = exported(
         Datetime(
@@ -216,10 +219,12 @@
         as_of="beta",
         )
 
-    duration = Timedelta(
-        title=_("Duration"), required=False,
-        description=_("Duration interval, calculated when the "
-                      "result gets collected."))
+    duration = exported(
+        Timedelta(
+            title=_("Duration"), required=False, readonly=True,
+            description=_("Duration interval, calculated when the "
+                          "result gets collected.")),
+        as_of="devel")
 
     date_first_dispatched = exported(
         Datetime(

=== 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:04:28 +0000
@@ -96,6 +96,39 @@
     upload_log_url: None
     web_link: u'http://launchpad.../~cprov/+archive/ppa/+build/26'
 
+devel webservice also contains build date_started and duration.
+
+    >>> builds_devel = webservice.named_get(
+    ...     source_pub['self_link'].replace('beta', 'devel'), 'getBuilds')
+    >>> pprint_entry(builds_devel.jsonBody()['entries'][0])
+    arch_tag: u'i386'
+    archive_link: u'http://.../~cprov/+archive/ppa'
+    build_log_url:
+    u'http://.../~cprov/+archive/ppa/+build/26/+files/netapplet-1.0.0.tar.gz'
+    builder_link: u'http://.../builders/bob'
+    buildstate: u'Failed to build'
+    can_be_cancelled: False
+    can_be_rescored: False
+    can_be_retried: True
+    changesfile_url: None
+    current_source_publication_link:
+    u'http://.../~cprov/+archive/ppa/+sourcepub/27'
+    date_first_dispatched: None
+    date_started: u'2007-07-07T23:58:41+00:00'
+    datebuilt: u'2007-07-08T00:00:01+00:00'
+    datecreated: u'2007-07-08T00:00:00+00:00'
+    dependencies: None
+    distribution_link: u'http://.../ubuntu'
+    duration: u'0:01:20'
+    pocket: u'Release'
+    resource_type_link: u'http://.../#build'
+    score: None
+    self_link: u'http://.../~cprov/+archive/ppa/+build/26'
+    title: u'i386 build of cdrkit 1.0 in ubuntu breezy-autotest RELEASE'
+    upload_log_url: None
+    web_link: u'http://launchpad.../~cprov/+archive/ppa/+build/26'
+
+
 For testing purposes we will set 'buildlog' and 'upload_log' to the
 same library file, so both can be verified.