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.
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
Add InvokeAIAppConfig schema migration system #6243
Add InvokeAIAppConfig schema migration system #6243
Changes from 10 commits
6ad1948
36495b7
b612c73
e39f035
aca9e44
6f128c8
5d411e4
d12fb7d
984dd93
ab9ebef
6eaed9a
048306b
ab086a7
8144a26
d248775
d852ca7
59deef9
36b1434
d5aee87
a48abfa
2bba7f3
2dd42d0
31f6302
fc23b16
6946a38
18b5aaf
4c081d5
d487102
7d8b011
964adb8
00ccd73
6e40142
8b76d11
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this class is a stateful singleton, testing is difficult. Right now, during tests, this class has all migrations registered in the "live" app. Test failures could possibly pop up over time as more migrations are registered.
Making this an instanced class would mitigate those issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
ConfigMigrator
is now an instanced class, andtest_config.py
creates new instances of the migrator for testing decorator functionality, and continuity checking.The migration steps themselves have been moved into their own module now:
invokeai.app.services.config.migrations
.I also relocated
get_config()
intoinvokeai.app.services.config.config_migrate
, and changed all places that are importingconfig_default
to import frominvokeai.app.services.config
instead (get_config()
is reexported from__init__.py
) . This avoided circular import problems and makesconfig_default.py
cleaner looking overall.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the added strictness for contiguous migrations, this should probably raise when either
from_version
orto_version
already have a registered migration.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.