Files
tacker/tox.ini
Yasufumi Ogawa 3aaa63e0c7 Quick fix to migrate to SQLAlchemy 2.0
It's just a quick fix and intended to be not a drastic or complete
update but step-by-step.

Since the recent update of versions of sqlalchemy[1], several util
features such as autocommit or subtransaction have been dropped, or
some functions and attributes in alembic migration scripts called
from `tacker-db-manage` haven't work anymore.

All the things should be updated are described in the migration
guide[2] and will completed later.

This update is for following fixes, and including a fix of CI's
update [3] which is required to this update.

* Remove 'subtransaction=True' in `context.session.begin()`, or
  replace with 'nested=True' for subtransaction part itself.

* Remove autocommit in `context_manager` and get_session().

* Add `commit()` to all sessions explicitly instead of dropping
  autocommit. `flush()` is also replaced with `commit()`.

* In alembic migration scripts, change a way of creating session
  in a manner of SQLAlchemy 2.0.

* Update `TackerBase` to add `__allow_unmapped__`.

* Replace argument of `joinedload()` from string to model object
  because it's not supported in SQLAlchemy 2.0 anymore.

* Reemove argument table's `insert()`.

* Update usage of `orm.query.Query.join()` for SQLAlchemy 2.0.

* Move to non-voting for unknown failures emerged recently.
  * tacker-functional-devstack-multinode-sol-vnflcm
  * tacker-functional-devstack-multinode-sol-kubernetes
  * tacker-functional-devstack-multinode-sol-v2-vnflcm

* Skip functions for some failure of timeout cannot find out the
  cause and fix.
  * test_subscription_functionality in the job
    tacker-functional-devstack-multinode-sol-multi-tenant
  * test_inst_heal_term in the job
    tacker-functional-devstack-multinode-sol-separated-nfvo

* Divide test scenarios under 'tacker/tests/functional/sol' and
  'tacker/tests/functional/sol_v2' because the total time has become
  over the limitation.

* Revise logging for better analysis.

[1] https://review.opendev.org/c/openstack/requirements/+/879743
[2] https://docs.sqlalchemy.org/en/20/changelog/migration_20.html
[3] https://review.opendev.org/c/openstack/tacker/+/921528

Closes-Bug: #2066047
Change-Id: I8aec097da27b1c30f1291e5d10878ea07d26d007
2024-07-26 16:50:16 +00:00

8.5 KiB