)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"90449470341bc86815c51e78b7041ed98a6ef987","unresolved":false,"context_lines":[{"line_number":18,"context_line":"Since we no longer need to distinguish among multiple database files, we"},{"line_number":19,"context_line":"can simplify the naming of these files."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Some of the tests are not currently, these are marked in the"},{"line_number":22,"context_line":"test_migrations.py. An additional test, from oslo_db, named"},{"line_number":23,"context_line":"`test_models_sync` is _sometimes_ failing because of the server_default"},{"line_number":24,"context_line":"on consumer generations."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f79a3b5_2d12e1b4","line":21,"range":{"start_line":21,"start_character":26,"end_line":21,"end_character":35},"updated":"2018-11-02 13:04:17.000000000","message":"passing?","commit_id":"6ad4cb9a27efd6087a22f282be2c482795a5289e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4117000313189a19d0224c9cafdb4ec402967cbd","unresolved":false,"context_lines":[{"line_number":15,"context_line":"this proved hard to debug and get correct, so we\u0027ve used something"},{"line_number":16,"context_line":"that leverages the available oslo_db tools, but with more visibility."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Because these tests mix sqlite, mysql and postgresql settings in the"},{"line_number":19,"context_line":"potentially the same process we need a way to insure that global"},{"line_number":20,"context_line":"settings for databases do not leak into other tests. This is done with"},{"line_number":21,"context_line":"a reset() on the placement db fixture, called by the msyql and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"3f79a3b5_69a658c2","line":18,"range":{"start_line":18,"start_character":62,"end_line":18,"end_character":68},"updated":"2018-11-19 18:52:42.000000000","message":"s/in the/in/","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4117000313189a19d0224c9cafdb4ec402967cbd","unresolved":false,"context_lines":[{"line_number":18,"context_line":"Because these tests mix sqlite, mysql and postgresql settings in the"},{"line_number":19,"context_line":"potentially the same process we need a way to insure that global"},{"line_number":20,"context_line":"settings for databases do not leak into other tests. This is done with"},{"line_number":21,"context_line":"a reset() on the placement db fixture, called by the msyql and"},{"line_number":22,"context_line":"postgresql tests before and after they run. We also need careful"},{"line_number":23,"context_line":"management of that cleanup when these tests are skipped (because db"},{"line_number":24,"context_line":"server or database is not there)."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"3f79a3b5_8982d401","line":21,"range":{"start_line":21,"start_character":53,"end_line":21,"end_character":58},"updated":"2018-11-19 18:52:42.000000000","message":"mysql","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"}],"placement/db/sqlalchemy/alembic.ini":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# A generic, single database configuration."},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"[alembic]"},{"line_number":4,"context_line":"# path to migration scripts"}],"source_content_type":"text/x-properties","patch_set":15,"id":"3f79a3b5_eaa06891","line":1,"updated":"2018-11-13 16:11:53.000000000","message":"I don\u0027t know much about alembic, but I know neutron uses it and this ini matches theirs for the most part:\n\nhttps://github.com/openstack/neutron/blob/master/neutron/db/migration/alembic.ini\n\nThe major difference being the sqlalchemy.url. Looks like the template is generated:\n\nhttps://alembic.zzzcomputing.com/en/latest/tutorial.html#creating-an-environment","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# A generic, single database configuration."},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"[alembic]"},{"line_number":4,"context_line":"# path to migration scripts"}],"source_content_type":"text/x-properties","patch_set":15,"id":"3f79a3b5_80819300","line":1,"in_reply_to":"3f79a3b5_eaa06891","updated":"2018-11-13 18:35:19.000000000","message":"Yes, it\u0027s generated.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":35,"context_line":"# are written from script.py.mako"},{"line_number":36,"context_line":"# output_encoding \u003d utf-8"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"#sqlalchemy.url \u003d driver://user:pass@localhost/dbname"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"# Logging configuration"}],"source_content_type":"text/x-properties","patch_set":15,"id":"3f79a3b5_0af12498","line":38,"updated":"2018-11-13 16:11:53.000000000","message":"I assume this is commented out because we end up using what\u0027s in CONF.placement_database.connection. As such, I\u0027d probably put a comment in here on why it\u0027s commented out (or just remove it).","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":35,"context_line":"# are written from script.py.mako"},{"line_number":36,"context_line":"# output_encoding \u003d utf-8"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"#sqlalchemy.url \u003d driver://user:pass@localhost/dbname"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"# Logging configuration"}],"source_content_type":"text/x-properties","patch_set":15,"id":"3f79a3b5_c0a30b9c","line":38,"in_reply_to":"3f79a3b5_0af12498","updated":"2018-11-13 18:35:19.000000000","message":"OK, I can add that.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":35,"context_line":"# are written from script.py.mako"},{"line_number":36,"context_line":"# output_encoding \u003d utf-8"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"#sqlalchemy.url \u003d driver://user:pass@localhost/dbname"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"# Logging configuration"}],"source_content_type":"text/x-properties","patch_set":15,"id":"3f79a3b5_e085e754","line":38,"in_reply_to":"3f79a3b5_0af12498","updated":"2018-11-13 16:46:56.000000000","message":"yes, that\u0027s right\n\nmuch of the stuff that happens when you initialise an alembic install is boilerplate","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"}],"placement/db/sqlalchemy/alembic/README":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Generic single-database configuration."}],"source_content_type":"application/octet-stream","patch_set":15,"id":"3f79a3b5_4a05dc67","line":1,"updated":"2018-11-13 16:11:53.000000000","message":"Is this readme required? It\u0027s pretty sparse if we don\u0027t need it, might as well remove it. Otherwise I\u0027d think we\u0027d want to put some more information in here, at least mentioning what this does (DB schema migrations), how it\u0027s initiated (placement-manage db sync?) and link to placement upgrade docs for more info?","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Generic single-database configuration."}],"source_content_type":"application/octet-stream","patch_set":15,"id":"3f79a3b5_c06d4b31","line":1,"in_reply_to":"3f79a3b5_4a05dc67","updated":"2018-11-13 18:35:19.000000000","message":"It was created by the alembic init. I\u0027ll remove it.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"}],"placement/db/sqlalchemy/alembic/env.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"from __future__ import with_statement"},{"line_number":15,"context_line":"from alembic import context"},{"line_number":16,"context_line":"from logging.config import fileConfig"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from placement import conf"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_cadb2ce9","line":15,"updated":"2018-11-13 16:11:53.000000000","message":"nit: split this 3rd party import apart from the standard library imports.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"from __future__ import with_statement"},{"line_number":15,"context_line":"from alembic import context"},{"line_number":16,"context_line":"from logging.config import fileConfig"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from placement import conf"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_40e13b97","line":15,"in_reply_to":"3f79a3b5_cadb2ce9","updated":"2018-11-13 18:35:19.000000000","message":"Done","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    and associate a connection with the context."},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    \"\"\""},{"line_number":74,"context_line":"    # If CONF and the  database is not already configured, set"},{"line_number":75,"context_line":"    # it up. This can happen when using the alembic command line"},{"line_number":76,"context_line":"    # tool."},{"line_number":77,"context_line":"    if not CONF.placement_database.connection:"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_ca89ecc8","line":74,"range":{"start_line":74,"start_character":21,"end_line":74,"end_character":23},"updated":"2018-11-13 16:11:53.000000000","message":"nit: single space","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":71,"context_line":"    and associate a connection with the context."},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    \"\"\""},{"line_number":74,"context_line":"    # If CONF and the  database is not already configured, set"},{"line_number":75,"context_line":"    # it up. This can happen when using the alembic command line"},{"line_number":76,"context_line":"    # tool."},{"line_number":77,"context_line":"    if not CONF.placement_database.connection:"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_c0a22b41","line":74,"range":{"start_line":74,"start_character":21,"end_line":74,"end_character":23},"in_reply_to":"3f79a3b5_ca89ecc8","updated":"2018-11-13 18:35:19.000000000","message":"Done. Also fixed the mismatched singular/plural wording.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506deecf38a92ed172ed38b7746ffa0e2abb3e9f","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    with connectable.connect() as connection:"},{"line_number":83,"context_line":"        context.configure("},{"line_number":84,"context_line":"            connection\u003dconnection,"},{"line_number":85,"context_line":"            target_metadata\u003dtarget_metadata,"},{"line_number":86,"context_line":"        )"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        with context.begin_transaction():"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_72067bcf","line":85,"range":{"start_line":85,"start_character":43,"end_line":85,"end_character":44},"updated":"2018-11-14 14:24:22.000000000","message":"What is with this dangling comma?","commit_id":"a1149a8b018a705e14561589e49fb935755029c1"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"006138d991d208ad275cf63815a81c73c48c17c7","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    with connectable.connect() as connection:"},{"line_number":83,"context_line":"        context.configure("},{"line_number":84,"context_line":"            connection\u003dconnection,"},{"line_number":85,"context_line":"            target_metadata\u003dtarget_metadata,"},{"line_number":86,"context_line":"        )"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        with context.begin_transaction():"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_324d63c6","line":85,"range":{"start_line":85,"start_character":43,"end_line":85,"end_character":44},"in_reply_to":"3f79a3b5_72067bcf","updated":"2018-11-19 20:54:47.000000000","message":"Done","commit_id":"a1149a8b018a705e14561589e49fb935755029c1"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4117000313189a19d0224c9cafdb4ec402967cbd","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"from __future__ import with_statement"},{"line_number":15,"context_line":"from logging.config import fileConfig"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from alembic import context"}],"source_content_type":"text/x-python","patch_set":18,"id":"3f79a3b5_a9b310eb","line":14,"range":{"start_line":14,"start_character":0,"end_line":14,"end_character":37},"updated":"2018-11-19 18:52:42.000000000","message":"more like:\n\n from __way_back_in_the_past__ import with_statement\n\n:) pretty sure we don\u0027t support py26 any more, but OK :)","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"006138d991d208ad275cf63815a81c73c48c17c7","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"from __future__ import with_statement"},{"line_number":15,"context_line":"from logging.config import fileConfig"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from alembic import context"}],"source_content_type":"text/x-python","patch_set":18,"id":"3f79a3b5_e006f619","line":14,"range":{"start_line":14,"start_character":0,"end_line":14,"end_character":37},"in_reply_to":"3f79a3b5_a9b310eb","updated":"2018-11-19 20:54:47.000000000","message":"I think alembic, which generated that line, still does. :)","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"}],"placement/db/sqlalchemy/alembic/script.py.mako":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def downgrade():"},{"line_number":24,"context_line":"    ${downgrades if downgrades else \"pass\"}"}],"source_content_type":"application/octet-stream","patch_set":15,"id":"3f79a3b5_0a6e04ff","line":24,"range":{"start_line":24,"start_character":37,"end_line":24,"end_character":41},"updated":"2018-11-13 16:11:53.000000000","message":"Hmm, OK we don\u0027t support downgrades, so we should always pass on these, but we\u0027ll see what happens.\n\nAre you having to manually remove the downgrade() method in the generated migration scripts? If so, we should probably just remove it from the template here.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def downgrade():"},{"line_number":24,"context_line":"    ${downgrades if downgrades else \"pass\"}"}],"source_content_type":"application/octet-stream","patch_set":15,"id":"3f79a3b5_802e7359","line":24,"range":{"start_line":24,"start_character":37,"end_line":24,"end_character":41},"in_reply_to":"3f79a3b5_0a6e04ff","updated":"2018-11-13 16:46:56.000000000","message":"Downgrade is being used in the tests to reset to an empty database, which is the \"cleaner\" way to do what the reset stuff in nova does.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"def downgrade():"},{"line_number":24,"context_line":"    ${downgrades if downgrades else \"pass\"}"}],"source_content_type":"application/octet-stream","patch_set":15,"id":"3f79a3b5_206bdfee","line":24,"range":{"start_line":24,"start_character":37,"end_line":24,"end_character":41},"in_reply_to":"3f79a3b5_802e7359","updated":"2018-11-13 18:35:19.000000000","message":"Removed. I think that the reset() approach is better than downgrading a table at a time.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"}],"placement/db/sqlalchemy/alembic/versions/158782c7f38c_empty_placeholder.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"\"\"\"Empty placeholder"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Revision ID: 158782c7f38c"},{"line_number":17,"context_line":"Revises: b4ed3a175331"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_8a28d49e","line":14,"updated":"2018-11-13 16:11:53.000000000","message":"What is this for? Is this just to indicate the first migration since down_revision\u003dNone? If so, why not just make the first real migration the first one?","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"\"\"\"Empty placeholder"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Revision ID: 158782c7f38c"},{"line_number":17,"context_line":"Revises: b4ed3a175331"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_c04b0b27","line":14,"in_reply_to":"3f79a3b5_8a28d49e","updated":"2018-11-13 16:46:56.000000000","message":"Yes, it does need more information, but as said in the immediately prior comment, this is the \"reset to clear\" migration.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506deecf38a92ed172ed38b7746ffa0e2abb3e9f","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"\"\"\"Empty placeholder"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Revision ID: 158782c7f38c"},{"line_number":17,"context_line":"Revises: b4ed3a175331"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_32c7a369","line":14,"in_reply_to":"3f79a3b5_c04b0b27","updated":"2018-11-14 14:24:22.000000000","message":"Hmm, OK, weird, and I don\u0027t see something like that in neutron\n\nhttps://github.com/openstack/neutron/blob/master/neutron/db/migration/alembic_migrations/versions/kilo_initial.py\n\nor ironic:\n\nhttps://github.com/openstack/ironic/blob/master/ironic/db/sqlalchemy/alembic/versions/2581ebaf0cb2_initial_migration.py","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":14,"context_line":"\"\"\"Empty placeholder"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Revision ID: 158782c7f38c"},{"line_number":17,"context_line":"Revises: b4ed3a175331"},{"line_number":18,"context_line":"Create Date: 2018-11-02 20:38:37.645225"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"\"\"\""}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_664ed06e","line":17,"range":{"start_line":17,"start_character":9,"end_line":17,"end_character":21},"updated":"2018-11-13 18:35:19.000000000","message":"This is also out of order. It doesn\u0027t fail because it is just a comment, but I fixed it (and the other migration file) to match the information in the revisions below.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a80b7cc18b21b6fe5ab6f651c1fb75634ed44bc7","unresolved":false,"context_lines":[{"line_number":16,"context_line":"This is needed for the migration tests to run correctly, as it represents the"},{"line_number":17,"context_line":"\"cleared\" database state."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Revision ID: 158782c7f38c"},{"line_number":20,"context_line":"Revises:"},{"line_number":21,"context_line":"Create Date: 2018-11-02 20:38:37.645225"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_b2be537b","line":19,"updated":"2018-11-14 14:30:33.000000000","message":"I dropped this migration and everything was OK in tests except for the test_upgrade_twice test:\n\nplacement.tests.functional.db.test_migrations.TestMigrationsSQLite.test_upgrade_twice\n-------------------------------------------------------------------------------------\n\nCaptured traceback:\n~~~~~~~~~~~~~~~~~~~\n    Traceback (most recent call last):\n      File \"placement/tests/functional/db/test_migrations.py\", line 231, in test_upgrade_twice\n        self.migration_api.upgrade(\u0027158782c7f38c\u0027)\n      File \"placement/db/sqlalchemy/migration.py\", line 57, in upgrade\n        alembic.command.upgrade(config, revision)\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/command.py\", line 254, in upgrade\n        script.run_env()\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/script/base.py\", line 427, in run_env\n        util.load_python_file(self.dir, \u0027env.py\u0027)\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/util/pyfiles.py\", line 81, in load_python_file\n        module \u003d load_module_py(module_id, path)\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/util/compat.py\", line 135, in load_module_py\n        mod \u003d imp.load_source(module_id, path, fp)\n      File \"/home/osboxes/git/placement/placement/db/sqlalchemy/alembic/env.py\", line 94, in \u003cmodule\u003e\n        run_migrations_online()\n      File \"/home/osboxes/git/placement/placement/db/sqlalchemy/alembic/env.py\", line 89, in run_migrations_online\n        context.run_migrations()\n      File \"\u003cstring\u003e\", line 8, in run_migrations\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/runtime/environment.py\", line 836, in run_migrations\n        self.get_context().run_migrations(**kw)\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/runtime/migration.py\", line 321, in run_migrations\n        for step in self._migrations_fn(heads, self):\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/command.py\", line 243, in upgrade\n        return script._upgrade_revs(revision, rev)\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/script/base.py\", line 340, in _upgrade_revs\n        for script in reversed(list(revs))\n      File \"/usr/lib/python2.7/contextlib.py\", line 35, in __exit__\n        self.gen.throw(type, value, traceback)\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/script/base.py\", line 174, in _catch_revision_errors\n        compat.raise_from_cause(util.CommandError(resolution))\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/util/compat.py\", line 199, in raise_from_cause\n        reraise(type(exception), exception, tb\u003dexc_tb)\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/script/base.py\", line 143, in _catch_revision_errors\n        yield\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/script/base.py\", line 336, in _upgrade_revs\n        revs \u003d list(revs)\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/script/revision.py\", line 656, in _iterate_revisions\n        uppers \u003d util.dedupe_tuple(self.get_revisions(upper))\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/script/revision.py\", line 304, in get_revisions\n        for rev_id in resolved_id)\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/script/revision.py\", line 304, in \u003cgenexpr\u003e\n        for rev_id in resolved_id)\n      File \"/home/osboxes/git/placement/.tox/py27/local/lib/python2.7/site-packages/alembic/script/revision.py\", line 362, in _revision_for_ident\n        resolved_id)\n    alembic.util.exc.CommandError: Can\u0027t locate revision identified by \u0027158782c7f38c\u0027\n    \n\nCaptured stderr:\n~~~~~~~~~~~~~~~~\n    INFO  [alembic.runtime.migration] Context impl SQLiteImpl.\n    INFO  [alembic.runtime.migration] Will assume non-transactional DDL.\n\n\n--\n\nBut I\u0027m not exactly sure what that\u0027s trying to test - that we can run the upgrade multiple times and it\u0027s idempotent?","commit_id":"a1149a8b018a705e14561589e49fb935755029c1"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"006138d991d208ad275cf63815a81c73c48c17c7","unresolved":false,"context_lines":[{"line_number":16,"context_line":"This is needed for the migration tests to run correctly, as it represents the"},{"line_number":17,"context_line":"\"cleared\" database state."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Revision ID: 158782c7f38c"},{"line_number":20,"context_line":"Revises:"},{"line_number":21,"context_line":"Create Date: 2018-11-02 20:38:37.645225"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_923797fe","line":19,"in_reply_to":"3f79a3b5_b2be537b","updated":"2018-11-19 20:54:47.000000000","message":"As discussed on IRC, this failed because it was trying to upgrade the version that was deleted. Changed it to call `self.migration_api.upgrade(\u0027base\u0027)` and it is passing.","commit_id":"a1149a8b018a705e14561589e49fb935755029c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ccfd35855d590257594d5d9d5edcb05271c82325","unresolved":false,"context_lines":[{"line_number":16,"context_line":"This is needed for the migration tests to run correctly, as it represents the"},{"line_number":17,"context_line":"\"cleared\" database state."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Revision ID: 158782c7f38c"},{"line_number":20,"context_line":"Revises:"},{"line_number":21,"context_line":"Create Date: 2018-11-02 20:38:37.645225"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_d248af8a","line":19,"in_reply_to":"3f79a3b5_b2be537b","updated":"2018-11-14 14:39:21.000000000","message":"Got it working with Ed\u0027s help, this is what I have locally:\n\ndiff --git a/placement/db/sqlalchemy/alembic/versions/b4ed3a175331_initial.py b/placement/db/sqlalchemy/alembic/versions/b4ed3a175331_initial.py\nindex 3056a52..b05f21e 100644\n--- a/placement/db/sqlalchemy/alembic/versions/b4ed3a175331_initial.py\n+++ b/placement/db/sqlalchemy/alembic/versions/b4ed3a175331_initial.py\n@@ -14,7 +14,7 @@\n \"\"\"Initial\n \n Revision ID: b4ed3a175331\n-Revises: 158782c7f38c\n+Revises:\n Create Date: 2018-10-19 18:27:55.950383\n \n \"\"\"\n@@ -24,7 +24,7 @@ import sqlalchemy as sa\n \n # revision identifiers, used by Alembic.\n revision \u003d \u0027b4ed3a175331\u0027\n-down_revision \u003d \u0027158782c7f38c\u0027\n+down_revision \u003d None\n branch_labels \u003d None\n depends_on \u003d None\n \ndiff --git a/placement/tests/functional/db/test_migrations.py b/placement/tests/functional/db/test_migrations.py\nindex d0317f4..5cc2223 100644\n--- a/placement/tests/functional/db/test_migrations.py\n+++ b/placement/tests/functional/db/test_migrations.py\n@@ -227,8 +227,8 @@ class MigrationCheckersMixin(object):\n         self.assertIsNotNone(self.migration_api.version())\n \n     def test_upgrade_twice(self):\n-        # Start with the empty version\n-        self.migration_api.upgrade(\u0027158782c7f38c\u0027)\n+        # Start with the initial version\n+        self.migration_api.upgrade(\u0027base\u0027)\n         v1 \u003d self.migration_api.version()\n         # Now upgrade to head\n         self.migration_api.upgrade(\u0027head\u0027)\nosboxes@osboxes:~/git/placement$","commit_id":"a1149a8b018a705e14561589e49fb935755029c1"}],"placement/db/sqlalchemy/alembic/versions/b4ed3a175331_initial.py":[{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"d61cd986fb6023c9600efc31ead77a1e89bbb48d","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    sa.Column(\u0027uuid\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":56,"context_line":"    sa.Column(\u0027project_id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":57,"context_line":"    sa.Column(\u0027user_id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":58,"context_line":"    sa.Column(\u0027generation\u0027, sa.Integer(), server_default\u003d\u00270\u0027, nullable\u003dFalse),"},{"line_number":59,"context_line":"    sa.PrimaryKeyConstraint(\u0027id\u0027),"},{"line_number":60,"context_line":"    sa.UniqueConstraint(\u0027uuid\u0027, name\u003d\u0027uniq_consumers0uuid\u0027)"},{"line_number":61,"context_line":"    )"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_ff4a4c58","line":58,"updated":"2018-10-31 20:44:34.000000000","message":"I think you\u0027ll be better off writing these as:\n\n    sa.Column(\u0027generation\u0027, sa.Integer(), server_default\u003dsa.text(\u00270\u0027), nullable\u003dFalse),\n\nthat\u0027s how the test is set up for the fix for this in oslo.db: https://review.openstack.org/#/c/574818/7/oslo_db/tests/sqlalchemy/test_migrations.py","commit_id":"6ad4cb9a27efd6087a22f282be2c482795a5289e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":34,"context_line":"    op.create_table(\u0027allocations\u0027,"},{"line_number":35,"context_line":"    sa.Column(\u0027created_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":36,"context_line":"    sa.Column(\u0027updated_at\u0027, sa.DateTime(), nullable\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_6a10d859","line":33,"range":{"start_line":33,"start_character":4,"end_line":33,"end_character":65},"updated":"2018-11-13 16:11:53.000000000","message":"Should be able to remove this.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506deecf38a92ed172ed38b7746ffa0e2abb3e9f","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":34,"context_line":"    op.create_table(\u0027allocations\u0027,"},{"line_number":35,"context_line":"    sa.Column(\u0027created_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":36,"context_line":"    sa.Column(\u0027updated_at\u0027, sa.DateTime(), nullable\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_f295ab3f","line":33,"range":{"start_line":33,"start_character":4,"end_line":33,"end_character":65},"in_reply_to":"3f79a3b5_4635d4d2","updated":"2018-11-14 14:24:22.000000000","message":"Huh? What purpose does this comment serve? The migrations are generated from a tool using the mako template, right? The comment, to me, means this is generated and should be updated - which you\u0027ve done by filling it in.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":34,"context_line":"    op.create_table(\u0027allocations\u0027,"},{"line_number":35,"context_line":"    sa.Column(\u0027created_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":36,"context_line":"    sa.Column(\u0027updated_at\u0027, sa.DateTime(), nullable\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_4635d4d2","line":33,"range":{"start_line":33,"start_character":4,"end_line":33,"end_character":65},"in_reply_to":"3f79a3b5_6a10d859","updated":"2018-11-13 18:35:19.000000000","message":"I believe that this refers to the know limitations of alembic, and not to take the auto-generated commands as gospel truth.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":34,"context_line":"    op.create_table(\u0027allocations\u0027,"},{"line_number":35,"context_line":"    sa.Column(\u0027created_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":36,"context_line":"    sa.Column(\u0027updated_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":37,"context_line":"    sa.Column(\u0027id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":38,"context_line":"    sa.Column(\u0027resource_provider_id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":39,"context_line":"    sa.Column(\u0027consumer_id\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":40,"context_line":"    sa.Column(\u0027resource_class_id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":41,"context_line":"    sa.Column(\u0027used\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":42,"context_line":"    sa.PrimaryKeyConstraint(\u0027id\u0027),"},{"line_number":43,"context_line":"    )"},{"line_number":44,"context_line":"    op.create_index(\u0027allocations_resource_provider_class_used_idx\u0027,"},{"line_number":45,"context_line":"            \u0027allocations\u0027, [\u0027resource_provider_id\u0027, \u0027resource_class_id\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_2597713a","line":42,"range":{"start_line":35,"start_character":4,"end_line":42,"end_character":34},"updated":"2018-11-13 16:11:53.000000000","message":"Would be nice to indent within the create_table call here and below.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":34,"context_line":"    op.create_table(\u0027allocations\u0027,"},{"line_number":35,"context_line":"    sa.Column(\u0027created_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":36,"context_line":"    sa.Column(\u0027updated_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":37,"context_line":"    sa.Column(\u0027id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":38,"context_line":"    sa.Column(\u0027resource_provider_id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":39,"context_line":"    sa.Column(\u0027consumer_id\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":40,"context_line":"    sa.Column(\u0027resource_class_id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":41,"context_line":"    sa.Column(\u0027used\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":42,"context_line":"    sa.PrimaryKeyConstraint(\u0027id\u0027),"},{"line_number":43,"context_line":"    )"},{"line_number":44,"context_line":"    op.create_index(\u0027allocations_resource_provider_class_used_idx\u0027,"},{"line_number":45,"context_line":"            \u0027allocations\u0027, [\u0027resource_provider_id\u0027, \u0027resource_class_id\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_6056b7d0","line":42,"range":{"start_line":35,"start_character":4,"end_line":42,"end_character":34},"in_reply_to":"3f79a3b5_2597713a","updated":"2018-11-13 16:46:56.000000000","message":"I\u0027ve got mixed feelings on that (Ed has different ones from me). My feeling is that we should leave the auto generated stuff in its autogenerated form.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506deecf38a92ed172ed38b7746ffa0e2abb3e9f","unresolved":false,"context_lines":[{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":34,"context_line":"    op.create_table(\u0027allocations\u0027,"},{"line_number":35,"context_line":"    sa.Column(\u0027created_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":36,"context_line":"    sa.Column(\u0027updated_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":37,"context_line":"    sa.Column(\u0027id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":38,"context_line":"    sa.Column(\u0027resource_provider_id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":39,"context_line":"    sa.Column(\u0027consumer_id\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":40,"context_line":"    sa.Column(\u0027resource_class_id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":41,"context_line":"    sa.Column(\u0027used\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":42,"context_line":"    sa.PrimaryKeyConstraint(\u0027id\u0027),"},{"line_number":43,"context_line":"    )"},{"line_number":44,"context_line":"    op.create_index(\u0027allocations_resource_provider_class_used_idx\u0027,"},{"line_number":45,"context_line":"            \u0027allocations\u0027, [\u0027resource_provider_id\u0027, \u0027resource_class_id\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_727bdb2a","line":42,"range":{"start_line":35,"start_character":4,"end_line":42,"end_character":34},"in_reply_to":"3f79a3b5_465e3415","updated":"2018-11-14 14:24:22.000000000","message":"I didn\u0027t realize this was all generated - what is it generated from? The models?","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":34,"context_line":"    op.create_table(\u0027allocations\u0027,"},{"line_number":35,"context_line":"    sa.Column(\u0027created_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":36,"context_line":"    sa.Column(\u0027updated_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":37,"context_line":"    sa.Column(\u0027id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":38,"context_line":"    sa.Column(\u0027resource_provider_id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":39,"context_line":"    sa.Column(\u0027consumer_id\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":40,"context_line":"    sa.Column(\u0027resource_class_id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":41,"context_line":"    sa.Column(\u0027used\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":42,"context_line":"    sa.PrimaryKeyConstraint(\u0027id\u0027),"},{"line_number":43,"context_line":"    )"},{"line_number":44,"context_line":"    op.create_index(\u0027allocations_resource_provider_class_used_idx\u0027,"},{"line_number":45,"context_line":"            \u0027allocations\u0027, [\u0027resource_provider_id\u0027, \u0027resource_class_id\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_465e3415","line":42,"range":{"start_line":35,"start_character":4,"end_line":42,"end_character":34},"in_reply_to":"3f79a3b5_6056b7d0","updated":"2018-11-13 18:35:19.000000000","message":"I like to leave generated stuff as-is generally, but only in the case where it will likely be re-generated at some point. This is a one-shot generation, so there is no danger of alembic not being able to update it.\n\nI\u0027ve already modified it by adding the header and wrapping long lines to pass pep8, so I guess I could pretty it up the way Matt wants it.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"006138d991d208ad275cf63815a81c73c48c17c7","unresolved":false,"context_lines":[{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":34,"context_line":"    op.create_table(\u0027allocations\u0027,"},{"line_number":35,"context_line":"    sa.Column(\u0027created_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":36,"context_line":"    sa.Column(\u0027updated_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":37,"context_line":"    sa.Column(\u0027id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":38,"context_line":"    sa.Column(\u0027resource_provider_id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":39,"context_line":"    sa.Column(\u0027consumer_id\u0027, sa.String(length\u003d36), nullable\u003dFalse),"},{"line_number":40,"context_line":"    sa.Column(\u0027resource_class_id\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":41,"context_line":"    sa.Column(\u0027used\u0027, sa.Integer(), nullable\u003dFalse),"},{"line_number":42,"context_line":"    sa.PrimaryKeyConstraint(\u0027id\u0027),"},{"line_number":43,"context_line":"    )"},{"line_number":44,"context_line":"    op.create_index(\u0027allocations_resource_provider_class_used_idx\u0027,"},{"line_number":45,"context_line":"            \u0027allocations\u0027, [\u0027resource_provider_id\u0027, \u0027resource_class_id\u0027,"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_183409ab","line":42,"range":{"start_line":35,"start_character":4,"end_line":42,"end_character":34},"in_reply_to":"3f79a3b5_727bdb2a","updated":"2018-11-19 20:54:47.000000000","message":"Yes, the models. See the comment in the doc added in a later patch in this series.\n\nhttps://review.openstack.org/#/c/614024/16/doc/source/contributor/index.rst@436","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            [\u0027resource_class_id\u0027], unique\u003dFalse)"},{"line_number":49,"context_line":"    op.create_index(\u0027allocations_consumer_id_idx\u0027, \u0027allocations\u0027,"},{"line_number":50,"context_line":"            [\u0027consumer_id\u0027], unique\u003dFalse)"},{"line_number":51,"context_line":"    op.create_table(\u0027consumers\u0027,"},{"line_number":52,"context_line":"    sa.Column(\u0027created_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":53,"context_line":"    sa.Column(\u0027updated_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":54,"context_line":"    sa.Column(\u0027id\u0027, sa.Integer(), autoincrement\u003dTrue, nullable\u003dFalse),"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_a58b8114","line":51,"updated":"2018-11-13 16:11:53.000000000","message":"Please put newlines between the different create_table calls, otherwise this is hard to look at.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":48,"context_line":"            [\u0027resource_class_id\u0027], unique\u003dFalse)"},{"line_number":49,"context_line":"    op.create_index(\u0027allocations_consumer_id_idx\u0027, \u0027allocations\u0027,"},{"line_number":50,"context_line":"            [\u0027consumer_id\u0027], unique\u003dFalse)"},{"line_number":51,"context_line":"    op.create_table(\u0027consumers\u0027,"},{"line_number":52,"context_line":"    sa.Column(\u0027created_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":53,"context_line":"    sa.Column(\u0027updated_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":54,"context_line":"    sa.Column(\u0027id\u0027, sa.Integer(), autoincrement\u003dTrue, nullable\u003dFalse),"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_2068bf87","line":51,"in_reply_to":"3f79a3b5_a58b8114","updated":"2018-11-13 16:46:56.000000000","message":"see above","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":178,"context_line":"    # ### end Alembic commands ###"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"def downgrade():"},{"line_number":182,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":183,"context_line":"    op.drop_index(\u0027resource_provider_traits_resource_provider_trait_idx\u0027,"},{"line_number":184,"context_line":"            table_name\u003d\u0027resource_provider_traits\u0027)"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_850be57d","line":181,"updated":"2018-11-13 16:11:53.000000000","message":"OpenStack doesn\u0027t support downgrade(), there was a decision on that years ago, so I don\u0027t think we need to implement this. Can we just remove it (or pass)? I think removal is ideal since I think today if you try to downgrade nova db using sqla-migrate it just fails saying it\u0027s not supported.\n\nLooking at https://review.openstack.org/#/c/600161/38/placement/cmd/manage.py@28 we don\u0027t support downgrade in the CLI anyway so just drop this from here and the mako template.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":178,"context_line":"    # ### end Alembic commands ###"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"def downgrade():"},{"line_number":182,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":183,"context_line":"    op.drop_index(\u0027resource_provider_traits_resource_provider_trait_idx\u0027,"},{"line_number":184,"context_line":"            table_name\u003d\u0027resource_provider_traits\u0027)"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_c0646bb7","line":181,"in_reply_to":"3f79a3b5_850be57d","updated":"2018-11-13 16:46:56.000000000","message":"See my comment elsewhere.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":178,"context_line":"    # ### end Alembic commands ###"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"def downgrade():"},{"line_number":182,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":183,"context_line":"    op.drop_index(\u0027resource_provider_traits_resource_provider_trait_idx\u0027,"},{"line_number":184,"context_line":"            table_name\u003d\u0027resource_provider_traits\u0027)"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_e6d180fb","line":181,"in_reply_to":"3f79a3b5_c0646bb7","updated":"2018-11-13 18:35:19.000000000","message":"Changing the fixture to call reset() instead of downgrade() allows this method to be removed. Done.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506deecf38a92ed172ed38b7746ffa0e2abb3e9f","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":34,"context_line":"    op.create_table(\u0027allocations\u0027,"},{"line_number":35,"context_line":"            sa.Column(\u0027created_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":36,"context_line":"            sa.Column(\u0027updated_at\u0027, sa.DateTime(), nullable\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_1293875b","line":33,"updated":"2018-11-14 14:24:22.000000000","message":"Still don\u0027t see why we need this comment.","commit_id":"a1149a8b018a705e14561589e49fb935755029c1"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"006138d991d208ad275cf63815a81c73c48c17c7","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def upgrade():"},{"line_number":33,"context_line":"    # ### commands auto generated by Alembic - please adjust! ###"},{"line_number":34,"context_line":"    op.create_table(\u0027allocations\u0027,"},{"line_number":35,"context_line":"            sa.Column(\u0027created_at\u0027, sa.DateTime(), nullable\u003dTrue),"},{"line_number":36,"context_line":"            sa.Column(\u0027updated_at\u0027, sa.DateTime(), nullable\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":17,"id":"3f79a3b5_b2117362","line":33,"in_reply_to":"3f79a3b5_1293875b","updated":"2018-11-19 20:54:47.000000000","message":"Done","commit_id":"a1149a8b018a705e14561589e49fb935755029c1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4e09bac6a33292a1f35ba6578dc026e06959de7b","unresolved":false,"context_lines":[{"line_number":14,"context_line":"\"\"\"Initial"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Revision ID: b4ed3a175331"},{"line_number":17,"context_line":"Revises: 158782c7f38c"},{"line_number":18,"context_line":"Create Date: 2018-10-19 18:27:55.950383"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"\"\"\""}],"source_content_type":"text/x-python","patch_set":18,"id":"3f79a3b5_1b02c3ba","line":17,"range":{"start_line":17,"start_character":9,"end_line":17,"end_character":21},"updated":"2018-11-14 15:35:22.000000000","message":"remove this","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"}],"placement/db/sqlalchemy/api_models.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":2,"context_line":"#    not use this file except in compliance with the License. You may obtain"},{"line_number":3,"context_line":"#    a copy of the License at"},{"line_number":4,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_851f655c","side":"PARENT","line":1,"updated":"2018-11-13 16:11:53.000000000","message":"Did this just move to placement/db/sqlalchemy/models.py? Why not just rename it if so? I guess the idea is to drop the non-placement models as noted in the commit message.","commit_id":"6bb6c0bbdd6908cda1b9ba74d43b8538e82e2a1f"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":2,"context_line":"#    not use this file except in compliance with the License. You may obtain"},{"line_number":3,"context_line":"#    a copy of the License at"},{"line_number":4,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_a944bb4f","side":"PARENT","line":1,"in_reply_to":"3f79a3b5_851f655c","updated":"2018-11-13 18:35:19.000000000","message":"I did rename it, but with the other changes, git/gerrit sees them as two different files.","commit_id":"6bb6c0bbdd6908cda1b9ba74d43b8538e82e2a1f"}],"placement/db/sqlalchemy/migration.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    alembic.command.upgrade(config, revision)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def downgrade(revision, config\u003dNone):"},{"line_number":61,"context_line":"    \"\"\"Used for downgrading database."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    :param version: Desired database version"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_a5fb8112","line":60,"updated":"2018-11-13 16:11:53.000000000","message":"Not sure why we have this.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    alembic.command.upgrade(config, revision)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def downgrade(revision, config\u003dNone):"},{"line_number":61,"context_line":"    \"\"\"Used for downgrading database."},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    :param version: Desired database version"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_29c8ab4c","line":60,"in_reply_to":"3f79a3b5_a5fb8112","updated":"2018-11-13 18:35:19.000000000","message":"We needed it for the call in fixtures.py. If I replace that call with the call to reset() instead, this can be removed.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"}],"placement/db/sqlalchemy/models.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":29,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def MediumText():"},{"line_number":33,"context_line":"    return Text().with_variant(MEDIUMTEXT(), \u0027mysql\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_e50f39d2","line":32,"range":{"start_line":32,"start_character":4,"end_line":32,"end_character":14},"updated":"2018-11-13 16:11:53.000000000","message":"I don\u0027t see anything using this, looks like we can drop it.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":29,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def MediumText():"},{"line_number":33,"context_line":"    return Text().with_variant(MEDIUMTEXT(), \u0027mysql\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_e95ab31d","line":32,"range":{"start_line":32,"start_character":4,"end_line":32,"end_character":14},"in_reply_to":"3f79a3b5_e50f39d2","updated":"2018-11-13 18:35:19.000000000","message":"Done","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":235,"context_line":"    uuid \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":236,"context_line":"    project_id \u003d Column(Integer, nullable\u003dFalse)"},{"line_number":237,"context_line":"    user_id \u003d Column(Integer, nullable\u003dFalse)"},{"line_number":238,"context_line":"    # FIXME(mriedem): Change this to server_default\u003dtext(\"0\") to match the"},{"line_number":239,"context_line":"    # 059_add_consumer_generation script once bug 1776527 is fixed."},{"line_number":240,"context_line":"    generation \u003d Column(Integer, nullable\u003dFalse, server_default\u003d\"0\", default\u003d0)"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_c588fd6d","line":239,"range":{"start_line":238,"start_character":4,"end_line":239,"end_character":67},"updated":"2018-11-13 16:11:53.000000000","message":"This has lost some context now that we don\u0027t have 059_add_consumer_generation. Looking at bug 1776527 it says it\u0027s fixed, so maybe we can fix this now as well and remove the FIXME? Could also be done separately (preceding or follow up patch).","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":235,"context_line":"    uuid \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":236,"context_line":"    project_id \u003d Column(Integer, nullable\u003dFalse)"},{"line_number":237,"context_line":"    user_id \u003d Column(Integer, nullable\u003dFalse)"},{"line_number":238,"context_line":"    # FIXME(mriedem): Change this to server_default\u003dtext(\"0\") to match the"},{"line_number":239,"context_line":"    # 059_add_consumer_generation script once bug 1776527 is fixed."},{"line_number":240,"context_line":"    generation \u003d Column(Integer, nullable\u003dFalse, server_default\u003d\"0\", default\u003d0)"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_c997b79b","line":239,"range":{"start_line":238,"start_character":4,"end_line":239,"end_character":67},"in_reply_to":"3f79a3b5_20167ff5","updated":"2018-11-13 18:35:19.000000000","message":"Removed.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":235,"context_line":"    uuid \u003d Column(String(36), nullable\u003dFalse)"},{"line_number":236,"context_line":"    project_id \u003d Column(Integer, nullable\u003dFalse)"},{"line_number":237,"context_line":"    user_id \u003d Column(Integer, nullable\u003dFalse)"},{"line_number":238,"context_line":"    # FIXME(mriedem): Change this to server_default\u003dtext(\"0\") to match the"},{"line_number":239,"context_line":"    # 059_add_consumer_generation script once bug 1776527 is fixed."},{"line_number":240,"context_line":"    generation \u003d Column(Integer, nullable\u003dFalse, server_default\u003d\"0\", default\u003d0)"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_20167ff5","line":239,"range":{"start_line":238,"start_character":4,"end_line":239,"end_character":67},"in_reply_to":"3f79a3b5_c588fd6d","updated":"2018-11-13 16:46:56.000000000","message":"Probably just remove it. This is the form that will align with what alembic wants to see (see earlier patches for some discussion on that)","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4117000313189a19d0224c9cafdb4ec402967cbd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":18,"id":"3f79a3b5_29606038","updated":"2018-11-19 18:52:42.000000000","message":"Recommend git mv placement/db/sqlalchemy/models.py placement/db/models.py in a future patch. It\u0027s not like we\u0027re going to use something other than sqlalchemy for DB interaction.","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"006138d991d208ad275cf63815a81c73c48c17c7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":18,"id":"3f79a3b5_60498663","in_reply_to":"3f79a3b5_29606038","updated":"2018-11-19 20:54:47.000000000","message":"I *did* use git mv - see https://review.openstack.org/#/c/614350/15/placement/db/sqlalchemy/api_models.py@a1","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"46345d1f0a89e2ce5ae635120832acf4389cceaa","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":18,"id":"3f79a3b5_a0b31e35","in_reply_to":"3f79a3b5_60498663","updated":"2018-11-19 21:07:29.000000000","message":"No, I know you used git mv :) I was saying eventually remove the unnecessary /sqlalchemy part and just go with placement/db/models.py","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"}],"placement/db_api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":28,"context_line":"          LOG.warning)"},{"line_number":29,"context_line":"def configure(conf):"},{"line_number":30,"context_line":"    placement_context_manager.configure("},{"line_number":31,"context_line":"            **_get_db_conf(conf.placement_database))"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def get_placement_engine():"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_0542750f","line":31,"range":{"start_line":31,"start_character":8,"end_line":31,"end_character":12},"updated":"2018-11-13 16:11:53.000000000","message":"Unrelated Ed-ism.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":28,"context_line":"          LOG.warning)"},{"line_number":29,"context_line":"def configure(conf):"},{"line_number":30,"context_line":"    placement_context_manager.configure("},{"line_number":31,"context_line":"            **_get_db_conf(conf.placement_database))"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def get_placement_engine():"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_e9af13df","line":31,"range":{"start_line":31,"start_character":8,"end_line":31,"end_character":12},"in_reply_to":"3f79a3b5_0542750f","updated":"2018-11-13 18:35:19.000000000","message":"Done","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"}],"placement/tests/fixtures.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    global session_configured"},{"line_number":37,"context_line":"    session_configured \u003d False"},{"line_number":38,"context_line":"    placement_db.placement_context_manager.dispose_pool()"},{"line_number":39,"context_line":"    # TODO(cdent): Future handling in sqlalchemy may allow doing this"},{"line_number":40,"context_line":"    # in a less hacky way."},{"line_number":41,"context_line":"    placement_db.placement_context_manager._factory._started \u003d False"},{"line_number":42,"context_line":"    # Reset the run once decorator."}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_650b29d4","line":39,"range":{"start_line":39,"start_character":38,"end_line":39,"end_character":48},"updated":"2018-11-13 16:11:53.000000000","message":"Is this a sqlalchemy thing or an oslo.db thing? If oslo.db, seems they should have a factory fixture thing or something.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    global session_configured"},{"line_number":37,"context_line":"    session_configured \u003d False"},{"line_number":38,"context_line":"    placement_db.placement_context_manager.dispose_pool()"},{"line_number":39,"context_line":"    # TODO(cdent): Future handling in sqlalchemy may allow doing this"},{"line_number":40,"context_line":"    # in a less hacky way."},{"line_number":41,"context_line":"    placement_db.placement_context_manager._factory._started \u003d False"},{"line_number":42,"context_line":"    # Reset the run once decorator."}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_a0b84fe7","line":39,"range":{"start_line":39,"start_character":38,"end_line":39,"end_character":48},"in_reply_to":"3f79a3b5_650b29d4","updated":"2018-11-13 16:46:56.000000000","message":"Is sqla. The _started concept is in there. zzzeek has talked about making this tidier in sqla.\n\nThe problem this is addressing is that both sqla and oslo_db aren\u0027t happy with the way in which we\u0027d like to use postgresql, mysql, and sqlite3 all in the same process, so we need to do some relatively dirty messing about to allow that.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.addCleanup(self.cleanup)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def cleanup(self):"},{"line_number":68,"context_line":"        # TODO(edleafe): Not yet fully tested. Unclear if this really wipes"},{"line_number":69,"context_line":"        # things."},{"line_number":70,"context_line":"        migration.downgrade(\"base\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_a5862115","line":70,"range":{"start_line":68,"start_character":8,"end_line":70,"end_character":35},"updated":"2018-11-13 16:11:53.000000000","message":"Looking at the old cleanup method which called engine.dispose(), reset() also calls dispose_pool() so why doesn\u0027t this cleanup() method just call reset()?","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"006138d991d208ad275cf63815a81c73c48c17c7","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.addCleanup(self.cleanup)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def cleanup(self):"},{"line_number":68,"context_line":"        # TODO(edleafe): Not yet fully tested. Unclear if this really wipes"},{"line_number":69,"context_line":"        # things."},{"line_number":70,"context_line":"        migration.downgrade(\"base\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_384c653f","line":70,"range":{"start_line":68,"start_character":8,"end_line":70,"end_character":35},"in_reply_to":"3f79a3b5_126ce769","updated":"2018-11-19 20:54:47.000000000","message":"Yeah, with the changes made elsewhere, it has been removed.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.addCleanup(self.cleanup)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def cleanup(self):"},{"line_number":68,"context_line":"        # TODO(edleafe): Not yet fully tested. Unclear if this really wipes"},{"line_number":69,"context_line":"        # things."},{"line_number":70,"context_line":"        migration.downgrade(\"base\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_e9bcf3b7","line":70,"range":{"start_line":68,"start_character":8,"end_line":70,"end_character":35},"in_reply_to":"3f79a3b5_a5862115","updated":"2018-11-13 18:35:19.000000000","message":"Good suggestion. I replaced this with the call to reset(), and can now remove  the downgrade() methods from the migrations.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506deecf38a92ed172ed38b7746ffa0e2abb3e9f","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.addCleanup(self.cleanup)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def cleanup(self):"},{"line_number":68,"context_line":"        # TODO(edleafe): Not yet fully tested. Unclear if this really wipes"},{"line_number":69,"context_line":"        # things."},{"line_number":70,"context_line":"        migration.downgrade(\"base\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_126ce769","line":70,"range":{"start_line":68,"start_character":8,"end_line":70,"end_character":35},"in_reply_to":"3f79a3b5_e9bcf3b7","updated":"2018-11-14 14:24:22.000000000","message":"Can we also remove that initial empty placeholder migration?","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"51e02f4c42c7ea81dd023afbdcefbcc892caecb9","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        # The migration commands will look in alembic\u0027s env.py which itself"},{"line_number":62,"context_line":"        # has access to the oslo config for things like the database"},{"line_number":63,"context_line":"        # connection string."},{"line_number":64,"context_line":"        migration.upgrade(\"head\")"},{"line_number":65,"context_line":"        self.addCleanup(self.cleanup)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def cleanup(self):"}],"source_content_type":"text/x-python","patch_set":18,"id":"3f79a3b5_1c205df9","line":64,"updated":"2018-11-16 10:57:39.000000000","message":"By using migration.upgrade here we end up requiring all of placement conf to be processed, which leads to difficulties when using the placement fixture from nova because of duplicate option processing. I\u0027ve got some code further down the stack to try to deal with this, but it is likely there will be other issues like this because of global config...","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ed3e0172c10dee23a49b3fb438b28e7195a14859","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        # The migration commands will look in alembic\u0027s env.py which itself"},{"line_number":62,"context_line":"        # has access to the oslo config for things like the database"},{"line_number":63,"context_line":"        # connection string."},{"line_number":64,"context_line":"        migration.upgrade(\"head\")"},{"line_number":65,"context_line":"        self.addCleanup(self.cleanup)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def cleanup(self):"}],"source_content_type":"text/x-python","patch_set":18,"id":"3f79a3b5_9ffa020e","line":64,"in_reply_to":"3f79a3b5_09d324d6","updated":"2018-11-19 19:02:32.000000000","message":"I have a patch on the go which is going to set up a \"goals\" doc, and include \"use non-global conf\". At a different position in time, I\u0027d just do it rather than writing it down, but right now doesn\u0027t seem the right time and if someone else comes along and sees it as a goal, maybe they\u0027ll do it...","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"d1a04b4285943c65fa881e8b375f41aac688bd02","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        # The migration commands will look in alembic\u0027s env.py which itself"},{"line_number":62,"context_line":"        # has access to the oslo config for things like the database"},{"line_number":63,"context_line":"        # connection string."},{"line_number":64,"context_line":"        migration.upgrade(\"head\")"},{"line_number":65,"context_line":"        self.addCleanup(self.cleanup)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def cleanup(self):"}],"source_content_type":"text/x-python","patch_set":18,"id":"3f79a3b5_3fa2ebfa","line":64,"in_reply_to":"3f79a3b5_1c205df9","updated":"2018-11-16 11:39:17.000000000","message":"See the changes I\u0027ve made in https://review.openstack.org/#/c/617935/","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4117000313189a19d0224c9cafdb4ec402967cbd","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        # The migration commands will look in alembic\u0027s env.py which itself"},{"line_number":62,"context_line":"        # has access to the oslo config for things like the database"},{"line_number":63,"context_line":"        # connection string."},{"line_number":64,"context_line":"        migration.upgrade(\"head\")"},{"line_number":65,"context_line":"        self.addCleanup(self.cleanup)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def cleanup(self):"}],"source_content_type":"text/x-python","patch_set":18,"id":"3f79a3b5_09d324d6","line":64,"in_reply_to":"3f79a3b5_1c205df9","updated":"2018-11-19 18:52:42.000000000","message":"gotta love that oslo_config global state...","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"9e637e3d962c48eb379c6546818432cabd1b920f","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.addCleanup(self.cleanup)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def cleanup(self):"},{"line_number":68,"context_line":"        reset()"}],"source_content_type":"text/x-python","patch_set":18,"id":"3f79a3b5_bc29293a","line":68,"updated":"2018-11-16 10:41:40.000000000","message":"By calling reset (instead of the old self.reset) here the session_configured global is getting clobbered, which means we are doing a full reset and will need to migrations for every single test, which is not what the previous code did and something we wanted to avoid, I think.\n\nWe should either fix this now or at least remember to fix it later.","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ed3e0172c10dee23a49b3fb438b28e7195a14859","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.addCleanup(self.cleanup)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def cleanup(self):"},{"line_number":68,"context_line":"        reset()"}],"source_content_type":"text/x-python","patch_set":18,"id":"3f79a3b5_3f1ace6a","line":68,"in_reply_to":"3f79a3b5_29f7005e","updated":"2018-11-19 19:02:32.000000000","message":"That\u0027s the hope, yes. And for it to work properly whether we are doing \u0027normal\u0027 tests with fixtures per test or the gabbi way which manually starts and cleans the fixture per yaml file.","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4117000313189a19d0224c9cafdb4ec402967cbd","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        self.addCleanup(self.cleanup)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def cleanup(self):"},{"line_number":68,"context_line":"        reset()"}],"source_content_type":"text/x-python","patch_set":18,"id":"3f79a3b5_29f7005e","line":68,"in_reply_to":"3f79a3b5_bc29293a","updated":"2018-11-19 18:52:42.000000000","message":"So, is the plan eventually to have each Database fixture fully own and control/wipe a new database schema itself? In other words, full isolation of all functional DB interactions for the code that instantiates the Database fixture?","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"}],"placement/tests/functional/db/test_migrations.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"For the opportunistic testing you need to set up a db named \u0027openstack_citest\u0027"},{"line_number":20,"context_line":"with user \u0027openstack_citest\u0027 and password \u0027openstack_citest\u0027 on localhost."},{"line_number":21,"context_line":"The test will then use that db and u/p combo to run the tests."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"For postgres on Ubuntu this can be done with the following commands:"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_45538d6f","line":21,"range":{"start_line":21,"start_character":35,"end_line":21,"end_character":38},"updated":"2018-11-13 16:11:53.000000000","message":"What does u/p stand for?","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"For the opportunistic testing you need to set up a db named \u0027openstack_citest\u0027"},{"line_number":20,"context_line":"with user \u0027openstack_citest\u0027 and password \u0027openstack_citest\u0027 on localhost."},{"line_number":21,"context_line":"The test will then use that db and u/p combo to run the tests."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"For postgres on Ubuntu this can be done with the following commands:"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_69054368","line":21,"range":{"start_line":21,"start_character":35,"end_line":21,"end_character":38},"in_reply_to":"3f79a3b5_407b7b2a","updated":"2018-11-13 18:35:19.000000000","message":"Yes, I used their code as a starting point for our tests.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"For the opportunistic testing you need to set up a db named \u0027openstack_citest\u0027"},{"line_number":20,"context_line":"with user \u0027openstack_citest\u0027 and password \u0027openstack_citest\u0027 on localhost."},{"line_number":21,"context_line":"The test will then use that db and u/p combo to run the tests."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"For postgres on Ubuntu this can be done with the following commands:"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_407b7b2a","line":21,"range":{"start_line":21,"start_character":35,"end_line":21,"end_character":38},"in_reply_to":"3f79a3b5_45538d6f","updated":"2018-11-13 16:46:56.000000000","message":"User/password.\n\nThis is cargo copied from elsehwere (ironic I think, Ed?)","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":20,"context_line":"with user \u0027openstack_citest\u0027 and password \u0027openstack_citest\u0027 on localhost."},{"line_number":21,"context_line":"The test will then use that db and u/p combo to run the tests."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"For postgres on Ubuntu this can be done with the following commands:"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"::"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":" sudo -u postgres psql"},{"line_number":28,"context_line":" postgres\u003d# create user openstack_citest with createdb login password"},{"line_number":29,"context_line":"      \u0027openstack_citest\u0027;"},{"line_number":30,"context_line":" postgres\u003d# create database openstack_citest with owner openstack_citest;"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"If you are using MySQL/MariaDB, use the following commands:"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"::"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":" mysql -u root -p  # You will be prompted for your password"},{"line_number":37,"context_line":" MariaDB [(none)]\u003e CREATE DATABASE openstack_citest CHARACTER SET utf8 \\"},{"line_number":38,"context_line":"   COLLATE utf8_general_ci;"},{"line_number":39,"context_line":" MariaDB [(none)]\u003e CREATE USER \u0027openstack_citest\u0027@\u0027localhost\u0027 \\"},{"line_number":40,"context_line":"   IDENTIFIED BY \u0027openstack_citest\u0027;"},{"line_number":41,"context_line":" MariaDB [(none)]\u003e GRANT ALL PRIVILEGES ON openstack_citest.* TO \\"},{"line_number":42,"context_line":"   \u0027openstack_citest\u0027@\u0027localhost\u0027;"},{"line_number":43,"context_line":" MariaDB [(none)]\u003e FLUSH PRIVILEGES;"},{"line_number":44,"context_line":"\"\"\""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"import contextlib"},{"line_number":47,"context_line":"import functools"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_a5c38105","line":44,"range":{"start_line":23,"start_character":0,"end_line":44,"end_character":3},"updated":"2018-11-13 16:11:53.000000000","message":"Why not just say \"run the tools/test-setup.sh script\"?","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":20,"context_line":"with user \u0027openstack_citest\u0027 and password \u0027openstack_citest\u0027 on localhost."},{"line_number":21,"context_line":"The test will then use that db and u/p combo to run the tests."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"For postgres on Ubuntu this can be done with the following commands:"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"::"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":" sudo -u postgres psql"},{"line_number":28,"context_line":" postgres\u003d# create user openstack_citest with createdb login password"},{"line_number":29,"context_line":"      \u0027openstack_citest\u0027;"},{"line_number":30,"context_line":" postgres\u003d# create database openstack_citest with owner openstack_citest;"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"If you are using MySQL/MariaDB, use the following commands:"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"::"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":" mysql -u root -p  # You will be prompted for your password"},{"line_number":37,"context_line":" MariaDB [(none)]\u003e CREATE DATABASE openstack_citest CHARACTER SET utf8 \\"},{"line_number":38,"context_line":"   COLLATE utf8_general_ci;"},{"line_number":39,"context_line":" MariaDB [(none)]\u003e CREATE USER \u0027openstack_citest\u0027@\u0027localhost\u0027 \\"},{"line_number":40,"context_line":"   IDENTIFIED BY \u0027openstack_citest\u0027;"},{"line_number":41,"context_line":" MariaDB [(none)]\u003e GRANT ALL PRIVILEGES ON openstack_citest.* TO \\"},{"line_number":42,"context_line":"   \u0027openstack_citest\u0027@\u0027localhost\u0027;"},{"line_number":43,"context_line":" MariaDB [(none)]\u003e FLUSH PRIVILEGES;"},{"line_number":44,"context_line":"\"\"\""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"import contextlib"},{"line_number":47,"context_line":"import functools"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_29642b4e","line":44,"range":{"start_line":23,"start_character":0,"end_line":44,"end_character":3},"in_reply_to":"3f79a3b5_a5c38105","updated":"2018-11-13 18:35:19.000000000","message":"Ummm... cause I forgot about that script?  :)\n\nChanged.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":79,"context_line":"        yield"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"def configure(conf_fixture, url):"},{"line_number":83,"context_line":"    \"\"\"Set database and lockfile configuration.\"\"\""},{"line_number":84,"context_line":"    # Aggregate configure setting here, not done as a base class as"},{"line_number":85,"context_line":"    # the mess of mixins makes that inscrutable. So instead a nice"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_c5db1de9","line":82,"range":{"start_line":82,"start_character":28,"end_line":82,"end_character":31},"updated":"2018-11-13 16:11:53.000000000","message":"nit: rename as db_url","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    \"\"\"Set database and lockfile configuration.\"\"\""},{"line_number":84,"context_line":"    # Aggregate configure setting here, not done as a base class as"},{"line_number":85,"context_line":"    # the mess of mixins makes that inscrutable. So instead a nice"},{"line_number":86,"context_line":"    # simple functiona."},{"line_number":87,"context_line":"    conf_fixture.config(lock_path\u003dtempfile.gettempdir(),"},{"line_number":88,"context_line":"                        group\u003d\u0027oslo_concurrency\u0027)"},{"line_number":89,"context_line":"    conf_fixture.config(group\u003d\u0027placement_database\u0027, connection\u003durl)"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_65cd692e","line":86,"range":{"start_line":86,"start_character":21,"end_line":86,"end_character":22},"updated":"2018-11-13 16:11:53.000000000","message":"nit: nix","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":161,"context_line":"class TestWalkVersions(testtools.TestCase, WalkVersionsMixin):"},{"line_number":162,"context_line":"    def setUp(self):"},{"line_number":163,"context_line":"        super(TestWalkVersions, self).setUp()"},{"line_number":164,"context_line":"        self.migration_api \u003d mock.MagicMock()"},{"line_number":165,"context_line":"        self.engine \u003d mock.MagicMock()"},{"line_number":166,"context_line":"        self.config \u003d mock.MagicMock()"},{"line_number":167,"context_line":"        self.versions \u003d [mock.Mock(revision\u003d\u00272b2\u0027), mock.Mock(revision\u003d\u00271a1\u0027)]"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def test_migrate_up(self):"},{"line_number":170,"context_line":"        self.migration_api.version.return_value \u003d \u0027dsa123\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_4564ed20","line":167,"range":{"start_line":164,"start_character":8,"end_line":167,"end_character":78},"updated":"2018-11-13 16:11:53.000000000","message":"What\u0027s with the mocks in a functional test? Should at least add a comment about why we need these and how it\u0027s still OK (in other words, are we really creating the schema in a real database and running the migration?). Or is this just testing the mixin?","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":161,"context_line":"class TestWalkVersions(testtools.TestCase, WalkVersionsMixin):"},{"line_number":162,"context_line":"    def setUp(self):"},{"line_number":163,"context_line":"        super(TestWalkVersions, self).setUp()"},{"line_number":164,"context_line":"        self.migration_api \u003d mock.MagicMock()"},{"line_number":165,"context_line":"        self.engine \u003d mock.MagicMock()"},{"line_number":166,"context_line":"        self.config \u003d mock.MagicMock()"},{"line_number":167,"context_line":"        self.versions \u003d [mock.Mock(revision\u003d\u00272b2\u0027), mock.Mock(revision\u003d\u00271a1\u0027)]"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def test_migrate_up(self):"},{"line_number":170,"context_line":"        self.migration_api.version.return_value \u003d \u0027dsa123\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_6996a3f1","line":167,"range":{"start_line":164,"start_character":8,"end_line":167,"end_character":78},"in_reply_to":"3f79a3b5_20c0bf2c","updated":"2018-11-13 18:35:19.000000000","message":"Ironic doesn\u0027t use functional tests; this came from their unit tests. I guess there will be an opportunity in the future to revisit these and make them less unit-y.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":161,"context_line":"class TestWalkVersions(testtools.TestCase, WalkVersionsMixin):"},{"line_number":162,"context_line":"    def setUp(self):"},{"line_number":163,"context_line":"        super(TestWalkVersions, self).setUp()"},{"line_number":164,"context_line":"        self.migration_api \u003d mock.MagicMock()"},{"line_number":165,"context_line":"        self.engine \u003d mock.MagicMock()"},{"line_number":166,"context_line":"        self.config \u003d mock.MagicMock()"},{"line_number":167,"context_line":"        self.versions \u003d [mock.Mock(revision\u003d\u00272b2\u0027), mock.Mock(revision\u003d\u00271a1\u0027)]"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def test_migrate_up(self):"},{"line_number":170,"context_line":"        self.migration_api.version.return_value \u003d \u0027dsa123\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_20c0bf2c","line":167,"range":{"start_line":164,"start_character":8,"end_line":167,"end_character":78},"in_reply_to":"3f79a3b5_4564ed20","updated":"2018-11-13 16:46:56.000000000","message":"This class is effectively a unit test, but because it uses the mixin, and is mostly testing that, it\u0027s in here.\n\nThe place where this came from (again, Ed will know more) had this in \u0027unit\u0027 and we moved it wholesale into functional because for the most part that is what it is.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506deecf38a92ed172ed38b7746ffa0e2abb3e9f","unresolved":false,"context_lines":[{"line_number":161,"context_line":"class TestWalkVersions(testtools.TestCase, WalkVersionsMixin):"},{"line_number":162,"context_line":"    def setUp(self):"},{"line_number":163,"context_line":"        super(TestWalkVersions, self).setUp()"},{"line_number":164,"context_line":"        self.migration_api \u003d mock.MagicMock()"},{"line_number":165,"context_line":"        self.engine \u003d mock.MagicMock()"},{"line_number":166,"context_line":"        self.config \u003d mock.MagicMock()"},{"line_number":167,"context_line":"        self.versions \u003d [mock.Mock(revision\u003d\u00272b2\u0027), mock.Mock(revision\u003d\u00271a1\u0027)]"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def test_migrate_up(self):"},{"line_number":170,"context_line":"        self.migration_api.version.return_value \u003d \u0027dsa123\u0027"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_92fc7772","line":167,"range":{"start_line":164,"start_character":8,"end_line":167,"end_character":78},"in_reply_to":"3f79a3b5_6996a3f1","updated":"2018-11-14 14:24:22.000000000","message":"FWIW, I also noticed some mocks in the nova db migrations tests so I guess it\u0027s normal:\n\nhttps://github.com/openstack/nova/blob/f180025669257ed209959d5a95ddb3c0efac0165/nova/tests/unit/db/test_migrations.py#L144","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":232,"context_line":"        self.config \u003d migration._alembic_config()"},{"line_number":233,"context_line":"        self.migration_api \u003d migration"},{"line_number":234,"context_line":"        super(MigrationCheckersMixin, self).setUp()"},{"line_number":235,"context_line":"        backend \u003d provision.Backend(self.engine.name, self.engine.url)"},{"line_number":236,"context_line":"        self.addCleanup("},{"line_number":237,"context_line":"            functools.partial(backend.drop_all_objects, self.engine))"},{"line_number":238,"context_line":"        self.addCleanup(self.engine.dispose)"},{"line_number":239,"context_line":"        # This is required to prevent the global opportunistic db settings"},{"line_number":240,"context_line":"        # leaking into other tests."},{"line_number":241,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_8528c59e","line":238,"range":{"start_line":235,"start_character":8,"end_line":238,"end_character":44},"updated":"2018-11-13 16:11:53.000000000","message":"Why don\u0027t we do this stuff in the db fixture itself?","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":232,"context_line":"        self.config \u003d migration._alembic_config()"},{"line_number":233,"context_line":"        self.migration_api \u003d migration"},{"line_number":234,"context_line":"        super(MigrationCheckersMixin, self).setUp()"},{"line_number":235,"context_line":"        backend \u003d provision.Backend(self.engine.name, self.engine.url)"},{"line_number":236,"context_line":"        self.addCleanup("},{"line_number":237,"context_line":"            functools.partial(backend.drop_all_objects, self.engine))"},{"line_number":238,"context_line":"        self.addCleanup(self.engine.dispose)"},{"line_number":239,"context_line":"        # This is required to prevent the global opportunistic db settings"},{"line_number":240,"context_line":"        # leaking into other tests."},{"line_number":241,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_c0d1cbfb","line":238,"range":{"start_line":235,"start_character":8,"end_line":238,"end_character":44},"in_reply_to":"3f79a3b5_8528c59e","updated":"2018-11-13 16:46:56.000000000","message":"Because it is overkill for the ram-based-db tests.\n\nSee some of the interaction between Mike and I earlier in the discussion.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"506deecf38a92ed172ed38b7746ffa0e2abb3e9f","unresolved":false,"context_lines":[{"line_number":232,"context_line":"        self.config \u003d migration._alembic_config()"},{"line_number":233,"context_line":"        self.migration_api \u003d migration"},{"line_number":234,"context_line":"        super(MigrationCheckersMixin, self).setUp()"},{"line_number":235,"context_line":"        backend \u003d provision.Backend(self.engine.name, self.engine.url)"},{"line_number":236,"context_line":"        self.addCleanup("},{"line_number":237,"context_line":"            functools.partial(backend.drop_all_objects, self.engine))"},{"line_number":238,"context_line":"        self.addCleanup(self.engine.dispose)"},{"line_number":239,"context_line":"        # This is required to prevent the global opportunistic db settings"},{"line_number":240,"context_line":"        # leaking into other tests."},{"line_number":241,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_52eedfb6","line":238,"range":{"start_line":235,"start_character":8,"end_line":238,"end_character":44},"in_reply_to":"3f79a3b5_c0d1cbfb","updated":"2018-11-14 14:24:22.000000000","message":"OK, comments in code would always be nice if a long discussion happened in review and resulted in good reasons why we\u0027re doing something.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0fd443c3b7ec8e9075a7f5b858abef67c7a8b90e","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    DRIVER \u003d \u0027postgresql\u0027"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"class ModelsMigrationSyncMixin(object):"},{"line_number":280,"context_line":"    def setUp(self):"},{"line_number":281,"context_line":"        url \u003d generate_url(self.DRIVER)"},{"line_number":282,"context_line":"        conf_fixture \u003d self.useFixture(config_fixture.Config(CONF))"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_4067fbed","line":279,"range":{"start_line":279,"start_character":6,"end_line":279,"end_character":30},"updated":"2018-11-13 16:16:33.000000000","message":"Hmm, so I did this:\n\ndiff --git a/placement/db/sqlalchemy/models.py b/placement/db/sqlalchemy/models.py\nindex 87cfd81..676af68 100644\n--- a/placement/db/sqlalchemy/models.py\n+++ b/placement/db/sqlalchemy/models.py\n@@ -49,6 +49,7 @@ class ResourceClass(BASE):\n \n     id \u003d Column(Integer, primary_key\u003dTrue, nullable\u003dFalse)\n     name \u003d Column(String(255), nullable\u003dFalse)\n+    invalid \u003d Column(String(3), nullable\u003dTrue)\n \n \n class ResourceProvider(BASE):\n\n\nAnd nothing failed in these db functional tests. Is that because I\u0027m only using sqlite?","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    DRIVER \u003d \u0027postgresql\u0027"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"class ModelsMigrationSyncMixin(object):"},{"line_number":280,"context_line":"    def setUp(self):"},{"line_number":281,"context_line":"        url \u003d generate_url(self.DRIVER)"},{"line_number":282,"context_line":"        conf_fixture \u003d self.useFixture(config_fixture.Config(CONF))"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_402cdbff","line":279,"range":{"start_line":279,"start_character":6,"end_line":279,"end_character":30},"in_reply_to":"3f79a3b5_00a6e30f","updated":"2018-11-13 16:46:56.000000000","message":"These tests don\u0027t (currently) run if you are using sqlite. I\u0027ll try adding a subclass for that to see if it can work.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"98f626e6e6186a9bcca38c6c1e830bb425b05c9a","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    DRIVER \u003d \u0027postgresql\u0027"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"class ModelsMigrationSyncMixin(object):"},{"line_number":280,"context_line":"    def setUp(self):"},{"line_number":281,"context_line":"        url \u003d generate_url(self.DRIVER)"},{"line_number":282,"context_line":"        conf_fixture \u003d self.useFixture(config_fixture.Config(CONF))"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_8042ec66","line":279,"range":{"start_line":279,"start_character":6,"end_line":279,"end_character":30},"in_reply_to":"3f79a3b5_1a0acb1e","updated":"2018-11-14 02:49:32.000000000","message":"If you look at https://review.openstack.org/#/c/614025/, where I add a migration without changing the models, you\u0027ll see that it fails the functional test for that exact reason.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"86bf9d28129d671de2a71b83daf3ce0c05d39c1f","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    DRIVER \u003d \u0027postgresql\u0027"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"class ModelsMigrationSyncMixin(object):"},{"line_number":280,"context_line":"    def setUp(self):"},{"line_number":281,"context_line":"        url \u003d generate_url(self.DRIVER)"},{"line_number":282,"context_line":"        conf_fixture \u003d self.useFixture(config_fixture.Config(CONF))"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_497de7c1","line":279,"range":{"start_line":279,"start_character":6,"end_line":279,"end_character":30},"in_reply_to":"3f79a3b5_402cdbff","updated":"2018-11-13 18:35:19.000000000","message":"Sqlite doesn\u0027t let you modify columns, so the tests are skipped when running under sqlite.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5e5cee07dd436f9ec33b2a3431436404eea1bf89","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    DRIVER \u003d \u0027postgresql\u0027"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"class ModelsMigrationSyncMixin(object):"},{"line_number":280,"context_line":"    def setUp(self):"},{"line_number":281,"context_line":"        url \u003d generate_url(self.DRIVER)"},{"line_number":282,"context_line":"        conf_fixture \u003d self.useFixture(config_fixture.Config(CONF))"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_00a6e30f","line":279,"range":{"start_line":279,"start_character":6,"end_line":279,"end_character":30},"in_reply_to":"3f79a3b5_4067fbed","updated":"2018-11-13 16:18:36.000000000","message":"Same issue if I change the alembic migration to add a column that\u0027s not in the model, it doesn\u0027t fail (at least with sqlite).","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7de57bb5ca8b07f768c94d537540a2f57371eba1","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    DRIVER \u003d \u0027postgresql\u0027"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"class ModelsMigrationSyncMixin(object):"},{"line_number":280,"context_line":"    def setUp(self):"},{"line_number":281,"context_line":"        url \u003d generate_url(self.DRIVER)"},{"line_number":282,"context_line":"        conf_fixture \u003d self.useFixture(config_fixture.Config(CONF))"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_4f540724","line":279,"range":{"start_line":279,"start_character":6,"end_line":279,"end_character":30},"in_reply_to":"3f79a3b5_497de7c1","updated":"2018-11-13 21:00:36.000000000","message":"I\u0027m pretty sure that nova has model sync tests that fail with sqlite (because I don\u0027t have mysql or postgresql on my dev vm) if you change the model/schema and don\u0027t mirror it in the other place. I haven\u0027t dug into what, if anything, nova does differently with sqlite for those tests though.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"eb349ddef6a142c4a1c1e7e762baca2cda8b9362","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    DRIVER \u003d \u0027postgresql\u0027"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"class ModelsMigrationSyncMixin(object):"},{"line_number":280,"context_line":"    def setUp(self):"},{"line_number":281,"context_line":"        url \u003d generate_url(self.DRIVER)"},{"line_number":282,"context_line":"        conf_fixture \u003d self.useFixture(config_fixture.Config(CONF))"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_1a0acb1e","line":279,"range":{"start_line":279,"start_character":6,"end_line":279,"end_character":30},"in_reply_to":"3f79a3b5_4f540724","updated":"2018-11-13 21:06:50.000000000","message":"We can probably do a reflection of the sqlite generated actual db compare that with the models, if we feel that\u0027s necessary.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"a1803dcd36c2d41f733430b2f0fc94cd1f24c332","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    DRIVER \u003d \u0027postgresql\u0027"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"class ModelsMigrationSyncMixin(object):"},{"line_number":280,"context_line":"    def setUp(self):"},{"line_number":281,"context_line":"        url \u003d generate_url(self.DRIVER)"},{"line_number":282,"context_line":"        conf_fixture \u003d self.useFixture(config_fixture.Config(CONF))"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_8d0b042c","line":279,"range":{"start_line":279,"start_character":6,"end_line":279,"end_character":30},"in_reply_to":"3f79a3b5_8042ec66","updated":"2018-11-14 07:48:50.000000000","message":"If I understood correctly, I think the point that Matt was trying to make was that if you changed either a model or a migration and then ran the test_migration tests in isolation, there is no failure if you\u0027re on a machine where you\u0027re just doing sqlite (common for a human dev box). I\u0027ve just confirmed this to be the case.\n\nHowever, in both cases, if you run all the functional tests, I was able to get lots of failures in other tests by changing a model or changing a migration but only on some tables: Changing resource classes, failures on both sides. Changing allocations, only when changing the model, not when changing a migration.\n\nSo we probably need something.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5e16eff2aacfae8a6c445a90ca79c1c44b47c07e","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    DRIVER \u003d \u0027postgresql\u0027"},{"line_number":277,"context_line":""},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"class ModelsMigrationSyncMixin(object):"},{"line_number":280,"context_line":"    def setUp(self):"},{"line_number":281,"context_line":"        url \u003d generate_url(self.DRIVER)"},{"line_number":282,"context_line":"        conf_fixture \u003d self.useFixture(config_fixture.Config(CONF))"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_bc114c62","line":279,"range":{"start_line":279,"start_character":6,"end_line":279,"end_character":30},"in_reply_to":"3f79a3b5_8d0b042c","updated":"2018-11-14 13:01:41.000000000","message":"Yes Chris understands the issue I\u0027m raising.\n\nThis is the nova models sync unit test class for sqlite:\n\nhttps://github.com/openstack/nova/blob/5adfb64c6c6a212db93988da11469f77ed3ac87c/nova/tests/unit/db/test_migrations.py#L1018\n\nIt looks like the major difference is the nova tests are extending oslo.db test classes, which is naughty (see the TODO from sdague at the top of that file). We should be using fixtures from oslo.db but I haven\u0027t looked at how to make those work (I think I did at one point and got lost).","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d7d77289e05766b251f1fac1b57d45a4fa73e716","unresolved":false,"context_lines":[{"line_number":285,"context_line":"        db_fixture.reset()"},{"line_number":286,"context_line":"        db_api.configure(CONF)"},{"line_number":287,"context_line":"        super(ModelsMigrationSyncMixin, self).setUp()"},{"line_number":288,"context_line":"        # This is required to prevent the global opportunistic db settings"},{"line_number":289,"context_line":"        # leaking into other tests."},{"line_number":290,"context_line":"        self.addCleanup(db_fixture.reset)"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"    def get_metadata(self):"},{"line_number":293,"context_line":"        return models.BASE.metadata"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_a5162157","line":290,"range":{"start_line":288,"start_character":8,"end_line":290,"end_character":41},"updated":"2018-11-13 16:11:53.000000000","message":"Will all tests that use the db fixture need this?","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8b47dbdeab5afcd9275404b0be212cadac4640c5","unresolved":false,"context_lines":[{"line_number":285,"context_line":"        db_fixture.reset()"},{"line_number":286,"context_line":"        db_api.configure(CONF)"},{"line_number":287,"context_line":"        super(ModelsMigrationSyncMixin, self).setUp()"},{"line_number":288,"context_line":"        # This is required to prevent the global opportunistic db settings"},{"line_number":289,"context_line":"        # leaking into other tests."},{"line_number":290,"context_line":"        self.addCleanup(db_fixture.reset)"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"    def get_metadata(self):"},{"line_number":293,"context_line":"        return models.BASE.metadata"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f79a3b5_80e753af","line":290,"range":{"start_line":288,"start_character":8,"end_line":290,"end_character":41},"in_reply_to":"3f79a3b5_a5162157","updated":"2018-11-13 16:46:56.000000000","message":"No, in fact these tests don\u0027t use the actual fixture from db_fixture. That module is being used as a place to host the reset function because I figured we might want other non-migration opportunistic tests at some point.","commit_id":"bead41e7300c5a37f14dce443491c4fa25db61ed"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"eef4bec6166a36a5218f0fd8ead8e81fcee1289d","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    conf_fixture.config(lock_path\u003dtempfile.gettempdir(),"},{"line_number":68,"context_line":"                        group\u003d\u0027oslo_concurrency\u0027)"},{"line_number":69,"context_line":"    conf_fixture.config(group\u003d\u0027placement_database\u0027, connection\u003ddb_url)"},{"line_number":70,"context_line":"    # We need to retry at least once (and quickly) otherwise the the connection"},{"line_number":71,"context_line":"    # test routines in oslo_db do not run, and the exception handling for"},{"line_number":72,"context_line":"    # determining if an opportunistic database is presents gets more"},{"line_number":73,"context_line":"    # complicated."}],"source_content_type":"text/x-python","patch_set":16,"id":"3f79a3b5_af111b62","line":70,"range":{"start_line":70,"start_character":61,"end_line":70,"end_character":68},"updated":"2018-11-13 21:05:09.000000000","message":"oh, look what I did, what a surprise","commit_id":"86f319644ffabf66bf6e67452cb1705e4628087a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4117000313189a19d0224c9cafdb4ec402967cbd","unresolved":false,"context_lines":[{"line_number":224,"context_line":"#        col_names \u003d [column.name for column in nodes_tbl.c]"},{"line_number":225,"context_line":"#        self.assertIn(\u0027fault\u0027, col_names)"},{"line_number":226,"context_line":"#        self.assertIsInstance(nodes_tbl.c.fault.type,"},{"line_number":227,"context_line":"#                              sqlalchemy.types.String)"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"    def test_upgrade_and_version(self):"},{"line_number":230,"context_line":"        self.migration_api.upgrade(\u0027head\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"3f79a3b5_049b0965","line":227,"updated":"2018-11-19 18:52:42.000000000","message":"cool, thanks.","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"}],"tools/test-setup.sh":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4117000313189a19d0224c9cafdb4ec402967cbd","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"# Now create our database."},{"line_number":30,"context_line":"mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e \""},{"line_number":31,"context_line":"    SET default_storage_engine\u003dMYISAM;"},{"line_number":32,"context_line":"    DROP DATABASE IF EXISTS openstack_citest;"},{"line_number":33,"context_line":"    CREATE DATABASE openstack_citest CHARACTER SET utf8;\""},{"line_number":34,"context_line":""}],"source_content_type":"text/x-sh","patch_set":18,"id":"3f79a3b5_c4a3d143","line":31,"range":{"start_line":31,"start_character":4,"end_line":31,"end_character":38},"updated":"2018-11-19 18:52:42.000000000","message":"not sure why this was done. MyISAM doesn\u0027t support transactions, is often slower the InnoDB for the types of workloads we use the RDBMS for, and has been deprecated in MySQL 8.0.\n\nAlso, SET default_storage_engine\u003dMYISAM only affects the session, not globally, so I\u0027m not entirely sure if this has any impact whatsoever.\n\nBut we can remove in a later patch.","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"966836ac0f8fe20249af4dc9f8b31e1df098247b","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"# Now create our database."},{"line_number":30,"context_line":"mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e \""},{"line_number":31,"context_line":"    SET default_storage_engine\u003dMYISAM;"},{"line_number":32,"context_line":"    DROP DATABASE IF EXISTS openstack_citest;"},{"line_number":33,"context_line":"    CREATE DATABASE openstack_citest CHARACTER SET utf8;\""},{"line_number":34,"context_line":""}],"source_content_type":"text/x-sh","patch_set":18,"id":"3f79a3b5_0069b2be","line":31,"range":{"start_line":31,"start_character":4,"end_line":31,"end_character":38},"in_reply_to":"3f79a3b5_9f48c261","updated":"2018-11-19 20:58:56.000000000","message":"And it\u0027s copied across all projects that have opportunistic tests like this, you\u0027d have to ask AJaeger.\n\nhttp://codesearch.openstack.org/?q\u003d%23%20This%20script%20will%20be%20run%20by%20OpenStack%20CI%20before%20unit%20tests%20are%20run%2C\u0026i\u003dnope\u0026files\u003d\u0026repos\u003d","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"ed3e0172c10dee23a49b3fb438b28e7195a14859","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"# Now create our database."},{"line_number":30,"context_line":"mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e \""},{"line_number":31,"context_line":"    SET default_storage_engine\u003dMYISAM;"},{"line_number":32,"context_line":"    DROP DATABASE IF EXISTS openstack_citest;"},{"line_number":33,"context_line":"    CREATE DATABASE openstack_citest CHARACTER SET utf8;\""},{"line_number":34,"context_line":""}],"source_content_type":"text/x-sh","patch_set":18,"id":"3f79a3b5_9f48c261","line":31,"range":{"start_line":31,"start_character":4,"end_line":31,"end_character":38},"in_reply_to":"3f79a3b5_c4a3d143","updated":"2018-11-19 19:02:32.000000000","message":"Is a pasto, effectively. This file is copied straight out of something else, either Ironic or nova.","commit_id":"c8ab9ff9066a55e57b0705b283adb110ef279d59"}]}
