Bug 9311

Summary: patchtest: track last poll series' event inside patchtest so we do not depend on patchwork git
Product: [Yocto Project Subprojects] Patchwork/Patchtest Reporter: Leonardo Sandoval Gonzalez <leonardo.sandoval.gonzalez>
Component: PatchtestAssignee: Leonardo Sandoval Gonzalez <leonardo.sandoval.gonzalez>
Status: RESOLVED FIXED QA Contact: David Rodriguez <david.israelx.rodriguez.castellanos>
Severity: enhancement    
Priority: High CC: bluelightning, damien.lespiau, jose.perez.carranza
Version: 2.2   
Target Milestone: 2.2 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Leonardo Sandoval Gonzalez 2016-03-18 17:25:35 UTC
Currently, the system polls events using the patchwork git command. The latter, uses a file .git-pw.oe-core.poll.timestamp to store last polled series event (including the timestamp) and patchtest uses this timestamp to poll new events. This is fine if the .git-pw.oe-core.poll.timestamp is always present, but it may be the case that it is removed and next patchtest will poll ALL series events, doing multiple POST requests. The system should have a logic to avoid the latter.
Comment 1 Leonardo Sandoval Gonzalez 2016-04-06 20:31:51 UTC
This is an important feature that we should be done before release.
Comment 2 Leonardo Sandoval Gonzalez 2016-04-22 22:00:53 UTC
The following logic has been added:

if the timestamp file is not present:
    - poll all events, and take last event's timestamp and store it on the
      timestamp file
    - do not trigger patchtest
else
    - poll latest events, take last event's timestamp and update the 
      timestamp file
    - trigger patchtest with latest events