IHWSubmissionSet.search should be available in the API

Bug #801334 reported by Marc Tardif
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Undecided
Marc Tardif

Bug Description

In order to implement part of the Results Tracker LEP [1], the IHWSubmissionSet.search method should be exposed in the API and extended to support searching by date. This will make it possible for the tracker to query Launchpad for the latest submissions so that they can be parsed incrementally.

1. https://dev.launchpad.net/LEP/ResultsTracker

Tags: qa-ok

Related branches

Marc Tardif (cr3)
Changed in launchpad:
status: New → In Progress
assignee: nobody → Marc Tardif (cr3)
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Revision history for this message
Marc Tardif (cr3) wrote :

Looks good, tested with the following script:

#!/usr/bin/env python

from datetime import (
    datetime,
    timedelta,
    )

import lazr.restful
from launchpadlib.launchpad import Launchpad

LAUNCHPAD_RESULTS_SERVICE_ROOT = "https://api.qastaging.launchpad.net/"
launchpad = Launchpad.login_with("Launchpad Project", LAUNCHPAD_RESULTS_SERVICE_ROOT)
hwdb = launchpad.load('%s+hwdb' % launchpad._root_uri)

print "Submissions created in the last 15 days"
now = datetime.now()
ago = now - timedelta(days=15)
for submission in hwdb.search(created_before=now, created_after=ago):
    print submission.date_created

print "Submissions created in the 15 days before"
now = ago
ago = now - timedelta(days=15)
for submission in hwdb.search(created_before=now, created_after=ago):
    print submission.date_created

print "Make sure the dates are within the range and they don't overlap"

tags: added: qa-ok
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.