Skip to content
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

Update dependencies (backend) #5642

Merged
merged 15 commits into from
May 23, 2023
Merged

Update dependencies (backend) #5642

merged 15 commits into from
May 23, 2023

Conversation

tsmock
Copy link
Contributor

@tsmock tsmock commented Mar 22, 2023

This PR intends to make the TM compatible with the defaults of Debian Bookworm. This means that the backend needs to be compatible with Python 3.11.

In general, the code changes are intended to be limited to compatibility changes. In the event that there needs to be a reformat due to formatting tool updates, those will be in separate commits (to make rebasing onto a new develop HEAD easier).

This PR replaces backend PRs #5649, #5629, #5591, #5590, #5563, #5480, #5457, #5420, #5385, #5348, #4591, and #4588.
EDIT: Additional backend PRs that are replaced are: #5770, #5761 (1.26.9 -> 1.26.15; sentry-sdk does not support 2.x), #5777, and #5747.

I highly recommend using the Hide Whitespace option in the Diff view settings.

EDIT: This also fixes #4906 and #5483 (see the Fix gevent warning when run with gunicorn commit).

This was referenced Mar 22, 2023
@github-actions github-actions bot added scope: frontend dependencies Pull requests that update a dependency file labels Mar 28, 2023
tsmock added 14 commits May 22, 2023 12:02
Signed-off-by: Taylor Smock <[email protected]>
The primary change required was wrapping direct SQL commands with
sqlalchemy.text (written as "sa.text"). Most of these could be converted
to be not be written as direct SQL commands.

Signed-off-by: Taylor Smock <[email protected]>
Signed-off-by: Taylor Smock <[email protected]>
This is largely paginate changes, along query methodology updates, and
db execution method updates.

There is also a change in backend/services/organisation_service.py that
fixes a test failure (`datetime.today()` -> `func.now()`).

Signed-off-by: Taylor Smock <[email protected]>
Signed-off-by: Taylor Smock <[email protected]>
Also, add debug output for exception

Signed-off-by: Taylor Smock <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented May 22, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@tsmock
Copy link
Contributor Author

tsmock commented May 22, 2023

Can someone check and see if c3bd7b8 is needed for other people? It might just be a configuration issue on the CI end (from docs/sysadmins/ci-cd.md, "[each] environment has its own set of environment variables which are stored as secrets in the CircleCI Organization Settings under Contexts.")

@eternaltyro
Copy link
Collaborator

Can someone check and see if c3bd7b8 is needed for other people? It might just be a configuration issue on the CI end (from docs/sysadmins/ci-cd.md, "[each] environment has its own set of environment variables which are stored as secrets in the CircleCI Organization Settings under Contexts.")

I'm not sure. I'll find out. Is that what was causing the backend test failures?

@eternaltyro eternaltyro merged commit c4e0719 into hotosm:develop May 23, 2023
@eternaltyro
Copy link
Collaborator

Merged. The changes will be deployed to staging. I'll report back if there are any problems.

@eternaltyro
Copy link
Collaborator

FWIW, CircleCI is all green -

image

@eternaltyro
Copy link
Collaborator

eternaltyro commented May 23, 2023

We need newrelic==8.8.0 for our deployments - introduced again here: 85dc839

Edit: This change is more recent - d1237ee

@tsmock
Copy link
Contributor Author

tsmock commented May 23, 2023

I'm not sure. I'll find out. Is that what was causing the backend test failures?

Yes, that is what was causing the most persistent backend test failure, and it was a pain to track down since it would pass if ORG_NAME or ORG_CODE was set in an environment file (which was set in my standard dev environment via a tasking-manager.env file).

We need newrelic==8.8.0 for our deployments

I probably would have done the newrelic install at https://github.com/hotosm/tasking-manager/blob/develop/scripts/aws/cloudformation/tasking-manager.template.js#LL383C21-L383C23 instead of adding it as a dependency in the pyproject.toml file.

@eternaltyro
Copy link
Collaborator

eternaltyro commented May 31, 2023

I probably would have done the newrelic install at https://github.com/hotosm/tasking-manager/blob/develop/scripts/aws/cloudformation/tasking-manager.template.js#LL383C21-L383C23 instead of adding it as a dependency in the pyproject.toml file.

That's fair. I'll make the change.

Edit to add: #5854

@eternaltyro
Copy link
Collaborator

Sentry SDK now supports urllib3 >= 2.x https://github.com/getsentry/sentry-python/releases/tag/1.25.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use Docker due to tzlocal.utils.ZoneInfoNotFoundError
5 participants