-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Alembic #12869
Closed
Closed
[WIP] Alembic #12869
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jdavcs
added
status/WIP
area/documentation
area/testing
kind/feature
area/database
Galaxy's database or data access layer
area/scripts
area/configuration
Galaxy's configuration system
labels
Nov 8, 2021
jdavcs
force-pushed
the
dev_alembic12
branch
2 times, most recently
from
November 9, 2021 00:24
928434a
to
5ce4492
Compare
3 tasks
jdavcs
force-pushed
the
dev_alembic12
branch
6 times, most recently
from
November 30, 2021 20:33
652d2e4
to
ac37bd9
Compare
jdavcs
force-pushed
the
dev_alembic12
branch
7 times, most recently
from
December 7, 2021 15:22
d77f287
to
c181ef1
Compare
Non-top-level pytest plugins deprecated https://docs.pytest.org/en/stable/deprecations.html#pytest-plugins-in-non-top-level-conftest-files
No longer needed with current implementation.
This tests sqlalchemy migrate which is being replaced.
This is expected behavior. Normally we won't try to add or delete the same object to/from the same database. The migrate_version table is an exception: it exists in both models: galaxy and install model. When dropping it, we drop it from both schemas - so we have 2 revisions defined, and if the database is combined (as it is in at least one test), the revisions with the same operations will be applied to the same database. We catch and ignore SQLAlchemy's InvalidRequstError: this handles both sqlite and postgres use cases (OperationalError will only handle sqlite).
2 tests expose a bug that is not fixed yet.
Also, do not call private method of DatabaseVerifier, even in tests: now it will break because it's supposed to work only AFTER the db state has been loaded - which is loaded lazily and only after verify() has been called. Instead, add a helper method to the test module + a test for the helper.
No idea whatsoever what's causing mypy to complain: - calling the method fixes the error - inlining exactly the same stmt, causes an 'incompatible' mypy error. Digging in.....
jdavcs
force-pushed
the
dev_alembic12
branch
from
December 21, 2021 19:57
c181ef1
to
515b786
Compare
This is how the current codebase works. If the database is combined, we only store the galaxy version in the migrate_version table But if we have 2 separate databases, we store 2 different versions (currently, 179 for galaxy and 17 for install). This commit adjusts the tests to test for this case; it also fixes the error that prevented an upgrade from proceeding with separate databases and automigrate set.
jdavcs
force-pushed
the
dev_alembic12
branch
from
December 30, 2021 21:27
040f475
to
73cb41b
Compare
5 tasks
Closing (final version in #13108) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/configuration
Galaxy's configuration system
area/database
Galaxy's database or data access layer
area/documentation
area/scripts
area/testing
kind/feature
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
UPDATE 12/30/21: everything works, tests pass. I'll open this for review after some minor cleanup and adding a few missing tests.
Ref #10369
Supersedes #11060.
To do:
conftest.py
)env.py
raises the error, path to test version locations resolved incorrectly; also ignore alembic directory when collecting tests)(e.g. sqlite handles dropping nonexistant db objects differently 66b2c83; automatically creates new db from path)
config
migrate/
(must be removed before we can remove themigrate
directory)model/triggers
manage_db.[sh|py]
)Nest steps (not this PR):
How to test the changes?
(Select all options that apply)
License