845cc55 Clean updates by release

Authored and Committed by adamwill 7 years ago
    Clean updates by release
    
    Summary:
    This should fix the lack of updates in production blockerbugs.
    The problem is that the logic for finding deleted updates fails
    to handle the case where we have active milestones for more
    than one release. It assumes any update at all that's in the
    database but not in the (per-release) Bodhi query that just
    ran has been deleted. It should only consider updates that are
    for the release we just queried.
    
    This affects production because I've started updating after
    each milestone release, rather than each final release, so
    right now we have 25 Final, 26 Alpha and 26 Beta live in prod.
    It doesn't affect a typical test deployment because the script
    only loads the F25 blockers; you have to manually add an F26
    milestone to reproduce the problem.
    
    We'll have to force a full resync on the infra deployments to
    flush out the erroneously 'deleted' updates.
    
    Test Plan:
    To see the bug, set up a test deployment with just
    F25 milestones, sync it, and see that it works OK. Now add an
    F26 milestone, sync, and watch all the updates move to 'deleted'
    status in the database (and disappear from the UI). Now re-try
    with this patch applied and hopefully the updates will survive.
    
    Reviewers: tflink, mkrizek
    
    Reviewed By: mkrizek
    
    Differential Revision: https://phab.qadevel.cloud.fedoraproject.org/D1049