cki-project / sktm

"Sonic Kernel Testing Manager" - a job scheduler for skt
GNU General Public License v2.0
0 stars 6 forks source link

Refactor pendingpatches #111

Open major opened 6 years ago

major commented 6 years ago

This PR adjusts sktm to store patches in the database as soon as they are received. It also transforms the pendingpatches table into a linkage between a list of patches and a Jenkins job that is testing those patches.

This work is required so that sktm can exit after queueing jobs and check on those jobs later as described in #110.

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 351


Changes Missing Coverage Covered Lines Changed/Added Lines %
sktm/init.py 0 12 0.0%
<!-- Total: 16 28 57.14% -->
Totals Coverage Status
Change from base Build 343: 1.0%
Covered Lines: 323
Relevant Lines: 924

💛 - Coveralls
major commented 6 years ago

@veruu What if we did something like this:

  1. Insert all patches into the patch table as soon as sktm sees them
  2. Add a column to the patch table to hold the Jenkins job name/build id (this would signify that the patch is currently being tested)
  3. Delete the pendingpatches table
  4. Adjust the id in the patch table to be an auto incremented integer
  5. Rename id to patch_id in the patch table
  6. Add a unique constraint for patchsource_id and patch_id in the patch table

This would reduce the complexity in the database and let the patch table be the source of truth for sktm.

major commented 6 years ago

The downside would be that we would have the Jenkins data appearing repeatedly in the patch table. We could still have a pendingjobs table and link to that if it makes more sense.