Skip to content

Update Marshmallow and SQLAlchemy dependencies #1678

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

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

ccostino
Copy link
Contributor

@ccostino ccostino commented Apr 29, 2025

A note to PR reviewers: it may be helpful to review our code review documentation to know what to keep in mind while reviewing pull requests.

SPECIAL NOTE

There are quite a few things with this PR that will need to be investigated, researched, and addressed; this isn't a simple matter of "fix a bunch of broken tests" - we have to make sure the app itself is still working properly, including in the way it's handling data and passing it around and externally to the Admin app.

Already this has required debugging the tests and stepping through the running code with the debugger to go up and down the call stack to see what's calling what, what's referencing what, and what's being expected vs. what's actually flowing through.

Case in point: I uncovered the issue with how the enums were being serialized by inspecting the data and seeing that the value being used was an enum's name versus it's actual value; e.g., serializing TemplateType.SMS was returning SMS (the name of the enum property) instead of its actual string value, which is sms. Once I figured that piece out, that led me to looking through a host of changelog information and finally tracking down what was likely doing it, a change with marshmallow-sqlalchemy 1.3.0: https://marshmallow-sqlalchemy.readthedocs.io/en/latest/changelog.html#id5 - this changed how enums were being serialized, and I had to enforce it to go by value (literally an argument in a field type, by_value=True) as that change was in conjunction with a marshmallow 4.0.0 change of no longer defining fields implicitly.

To accomplish this, the easiest thing to do is to run the tests directly with a few different options: poetry run pytest --pdb -x - that'll cause the tests to stop and open Python's debugger (pdb) at the point of a failure/error being thrown so you can start debugging, and once you're done it'll stop running the tests immediately. I created a separate make command called make test-debug to provide a shortcut for that command in this PR, too.

I've also kept the PR up-to-date with the main branch, so this is working off of the latest code. We'll have to be methodical in how we approach this and make sure we're accounting for all possible changes and breaks that need to be addressed. To help, these are some places to start looking and checking on:

Description

This changeset gets all of our Marshmallow and SQLAlchemy dependencies updated and accounts for recent major version changes.

TODO (optional)

  • Fix test errors
  • Fix the application based on the necessary required upgrades with the updated libraries
  • Address any other issues

Security Considerations

  • Keeping our dependencies up-to-date helps us avoid security vulnerabilities and helps maintain software stability.

This changeset gets all of our Marshmallow and SQLAlchemy dependencies updated and accounts for recent major version changes.

Signed-off-by: Carlo Costino <[email protected]>
@ccostino ccostino added engineering dependencies Pull requests that update a dependency file labels Apr 29, 2025
@ccostino ccostino self-assigned this Apr 29, 2025
@ccostino ccostino marked this pull request as draft April 29, 2025 16:11
@ccostino ccostino moved this from Issue Backlog to 🏗 In progress (WIP: ≤ 3 per person) in Notify.gov product board Apr 29, 2025
Signed-off-by: Carlo Costino <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file engineering
Projects
Status: 🏗 In progress (WIP: ≤ 3 per person)
Development

Successfully merging this pull request may close these issues.

1 participant