There should be a DB API test that ensures no new tables have soft-delete columns

Bug #1533859 reported by Matt Riedemann on 2016-01-13
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Medium
Diana Clarke

Bug Description

In mitaka we approved a spec to no longer have the SoftDeleteMixin in the data model so new tables don't implicitly inherit from that and get the deleted and deleted_at columns:

http://specs.openstack.org/openstack/nova-specs/specs/mitaka/approved/no-more-soft-delete.html

We don't have anything enforcing that policy though, except code review, which has failed a few times.

We should have a db api unit test which basically has a whitelist of which tables already have those columns and then we check the models against that, and if any new tables are introduced in the model which have the deleted or deleted_at columns, they'd fail the test.

Matt Riedemann (mriedem) on 2016-01-13
Changed in nova:
status: New → Confirmed
importance: Undecided → Medium
tags: added: low-hanging-fruit
Changed in nova:
assignee: nobody → Chuck Carmack (chuckcarmack75)
Diana Clarke (diana-clarke) wrote :

@Chuck: Do you plan on working on this still? If not, I'd like to take this. Cheers

Chuck Carmack (chuckcarmack75) wrote :

@Diana, I won't have time to work on it, so I'll unassign myself.

Changed in nova:
assignee: Chuck Carmack (chuckcarmack75) → nobody
Changed in nova:
assignee: nobody → Diana Clarke (diana-clarke)

Fix proposed to branch: master
Review: https://review.openstack.org/275912

Changed in nova:
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/275912
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=0d48617e5744acba94b90f8f6844c9964715691f
Submitter: Jenkins
Branch: master

commit 0d48617e5744acba94b90f8f6844c9964715691f
Author: Diana Clarke <email address hidden>
Date: Wed Feb 3 15:18:45 2016 -0500

    Test that new tables don't use soft deletes

    Soft deletes were deprecated in Mitaka. Whitelist the existing
    tables that use soft deletes, and add a test to make sure no new
    ones are added.

    Change-Id: Ibdf0f0e9944a8d3e71ef7411d14f0054ed17e7b6
    Closes-Bug: #1533859

Changed in nova:
status: In Progress → Fix Released

This issue was fixed in the openstack/nova 13.0.0.0b3 development milestone.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints