keystone/keystone/common
Stephen Finucane f174b4fa7c sql: Integrate alembic
Switch to alembic for real by integrating it into the 'db sync' command
flow. From a user-facing perspective, things should remain pretty much
the same as before, with the key difference being that version
information (i.e. what's shown by 'keystone-manage db_sync --check' or
'keystone-manage db_version') will now take the form of a hash rather
than an integer. There are a few differences for contributors however.
The changes are described in the included release note and
documentation.

Note that there are a couple of important design decisions here that are
worth examining:

- We drop the idea of the 'data_migration' branch entirely and the
  'keystone-manage db_sync --migrate' command is now a no-op. Neutron
  doesn't do data migrations like we do and yet they manage just fine.
  Dropping this gets us closer to neutron's behavior, which is a good
  thing for users.

- We haven't re-added the ability to specify a version when doing
  'db_sync'. Neutron has this, but the logic needed to get this working
  is complex and of questionable value. We've managed without the
  ability to sync to a version since Newton and can continue to do so
  until someone asks for it (and does the work).

- sqlalchemy-migrate is not removed entirely. Instead, upon doing a
  'db_sync' we will apply all sqlalchemy-migrate migrations up to the
  final '079_expand_update_local_id_limit' migration and dummy apply the
  initial alembic migration, after which we will switch over to alembic.
  In a future release we can remove the sqlalchemy-migrate migrations
  and rely entirely on alembic. Until then, keeping this allows fast
  forward upgrades to continue as a thing.

- Related to the above, we always apply *all* sqlalchemy-migrate
  migrations when calling 'db_sync', even if this command is called with
  e.g. '--expand' (meaning only apply the expand branch). This is
  because there is at most one "real" migration to apply, the Xena-era
  '079_expand_update_local_id_limit' migration, which is an expand-only
  migration. There is no risk to applying the empty "data_migration" and
  "contract" parts of this migration, and applying everything in one go
  results in *much* simpler logic.

Future changes will update documentation and add developer tooling for
(auto-)generating new migrations, a la 'neutron-db-manage revision'.

Change-Id: Ia376cb87f5159a4e79e2cfbab8442b6bcead708f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-06-20 13:29:58 +01:00
..
cache using standard library secrets function token_bytes to replace os.urandom 2022-01-03 19:16:29 +08:00
policies Merge "Fix typo in identity provider policies" 2021-10-06 23:35:30 +00:00
rbac_enforcer [goal] Deprecate the JSON formatted policy file 2021-02-01 17:36:29 +00:00
resource_options Remove six usage 2020-01-30 06:06:51 +00:00
sql sql: Integrate alembic 2022-06-20 13:29:58 +01:00
validation Update hacking for Python3 2020-04-15 07:17:58 +02:00
__init__.py establish basic structure 2012-01-18 20:06:27 -08:00
authorization.py Add access rules to token validation 2019-09-14 03:14:36 -07:00
context.py Pass context objects to policy enforcement 2018-11-26 19:48:10 +00:00
driver_hints.py Drop type in filters 2017-01-13 14:19:11 +03:00
fernet_utils.py Properly instantiate FernetUtils 2022-02-04 16:38:09 +01:00
json_home.py Expose access rules as its own API 2019-09-14 03:14:20 -07:00
jwt_utils.py Add keystone-manage create_jws_keypair functionality 2019-01-31 19:41:25 +00:00
manager.py Remove six usage 2020-01-30 06:06:51 +00:00
password_hashing.py nit: remove some useless code 2019-07-08 19:41:16 +00:00
profiler.py Remove log translations in keystone 2017-03-25 18:17:15 +00:00
provider_api.py Fix RBACEnforcer get_member_from_driver mechanism 2018-09-10 13:32:14 -07:00
render_token.py Add access rules to token validation 2019-09-14 03:14:36 -07:00
tokenless_auth.py Fixes incorrect params 2019-02-08 17:12:21 -08:00
utils.py sql: Vendor 'oslo_db.sqlalchemy.migration' 2022-01-24 16:03:44 +00:00