Bring back `clean_updates`, have it delete updates from DB
ClosedPublic

Authored by adamwill on Mar 25 2017, 12:53 AM.

Details

Summary

This is a modified revert of commit
2da425e354904273793e5321030882aac98d0c39.

Turns out this wasn't actually just cleaning up *deleted*
updates, though that's what it clearly thought it was doing.
It also marked updates for closed bugs - and other updates
which were no longer associated with a blocker or FE update,
for instance if the update was edited and no longer marked as
fixing the blocker bug - as 'deleted'. This is clearly wrong,
but did more or less the right thing sort of by accident; it
resulted in these updates not being shown in any of the views.

None of the 'update' code will actually update the status of
updates which no longer relate to a blocker or FE bug, so after
we removed clean_updates, there was a problem where updates
for closed bugs were still listed in the database with status
'testing', even though they're actually 'stable'. This probably
doesn't affect the main parts of the web UI much, since they
only actually show updates that fix bugs, but it does affect
the new 'requests' tab - it results in it including updates that
have already gone stable in both the 'compose request' and the
'stable push request' texts.

We could deal with this by tweaking the update code so we update
the status for all updates in the database, I guess, but I kinda
like this idea to trim the database by dropping updates that no
longer relate to blocker bugs from it entirely. If for whatever
reason an update pongs *back* to being relevant, it'll just get
re-added to the database at the next sync.

Test Plan

Bit tricky, as you need to get an update into the
database that subsequently becomes 'irrelevant' to see the
behaviour. If you just build a database while we're in an active
cycle then wait a few days, till after some of the bugs get
closed, that should work. Without this patch, the update will
likely remain in the database with state 'testing', and show
up in the 'requests' tab.

Diff Detail

Repository
rBLKR blockerbugs
Branch
clean-updates (branched from develop)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1115
Build 1115: arc lint + arc unit
adamwill created this revision.Mar 25 2017, 12:53 AM
adamwill updated this revision to Diff 3000.Mar 25 2017, 1:14 AM

Fix and extend test

mkrizek accepted this revision.Mar 27 2017, 8:31 AM

Didn't test, but code looks good to me.

This revision is now accepted and ready to land.Mar 27 2017, 8:31 AM
adamwill closed this revision.Mar 27 2017, 3:52 PM