-
Notifications
You must be signed in to change notification settings - Fork 9
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
Upgrade SQLAlchemy to v2 #1225
Comments
Hey team! Please add your planning poker estimate with Zenhub @cris-oddball @justaskdavidb2 @k-macmillan @kalbfled @ldraney @nikolai-efimov |
Please add your planning poker estimate with Zenhub @edDocMe360 |
Please add your planning poker estimate with Zenhub @EvanParish |
Dave brought up that there may be implications here when moving to AWS. |
Was an 8. Going to break out query updates and repoint when ready. |
@k-macmillan While revising this and creating #1648, I removed your legacy syntax "straggler" because there are actually more than one still on app/. #1648 should remove all of them and provides a grep statement to find them. |
After meeting with Kyle yesterday and discussing this, there's a little more complexity than we had hoped. I'm still working on getting the app running locally. It looks like I might have to manually define the history tables. |
I created a PR for the progress so far and will have a discussion with @mchlwellman when he's ready to pick up this ticket. |
Just getting going on this, I have spoken with Evan. I'll have more of an update tomorrow once I look more in depth. |
I am still resolving errors, the current one that is taking some time is this -
|
I'm picking up this ticket because Michael is out today. |
I am using these versions of libs -
This error is still occurring - |
I upgraded SQLAlchemy to v2 and upgrade related packages to their newest versions. I have been converting model declarations to the SQLAlchemy v2 "Declarative" syntax and removing inputs to schemas' "exclude" attribute in app/schema.py. I should know some time Monday if this is going to get the app in a runnable condition. |
I managed to run the app on my branch (draft PR), but there are many errors:
This branch does not include the recently merged Poetry changes. I don't want to mess with that until all the tests pass. I suspect that I need to continue updating model definitions in models.py to use the newer syntax. |
I updated models.py to the newer declarative format, but that didn't change the test results. Error messages suggest that I need to update how models relationships (foreign keys, etc.) are defined. I'm going to try to troubleshoot by running a specific test |
After discussion with @k-macmillan and @mchlwellman, we have decided to pause work on this ticket and #1224, which is part of the same task. I do not have any new tests passing compared to what I posted yesterday. I began updating relationships in app/models.py and app/models/user.py because I was seeing many test errors related to foreign keys, but that work is tedious because doing it right requires knowing the intent behind the code. Is the relationship 1-to-many? Many-to-many? Etc.? Once the intent is understood by exploring how the relationship attributes are actually used in the code, we can update the syntax using the appropriate declarative relationship definition. We discussed that completing the tickets that remove unused tables before returning to this ticket might be the best course of action. A draft PR exists with the work Michael and I have completed thus far. I have not incorporated the Poetry implementation yet. Below are the big picture steps I took to get the app and unit tests to run. See the PR for details. All steps other than altering model/table definitions are necessary to get the application to run locally or, once running, to run the tests. Michael pushed changes to upgrade migration code, which also needs to change to use SQLAlchemy v2.
|
Leaving for now. |
User Story - Business Need
Upgrade SQLAlchemy from v1.4.x to the latest 2.x version.
User Story(ies)
As a VA Notify developer
I want to upgrade SQLAlchemy
So that we minimize vulnerabilities and future upgrade pains.
Additional Info and Resources
Engineering Checklist
Acceptance Criteria
QA Considerations
Potential Dependencies
Leave blank if n/a
Out of Scope
Do not upgrade Celery, marshmallow, or marshmallow-sqlalchemy. Separate tickets exist for those upgrades.
The text was updated successfully, but these errors were encountered: