-
Notifications
You must be signed in to change notification settings - Fork 74
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
22948 - update emailer to use new db versioning #3092
22948 - update emailer to use new db versioning #3092
Conversation
…switching for emailer
@@ -67,7 +67,7 @@ rsa==4.7.2 | |||
semver==2.13.0 | |||
sentry-sdk==1.20.0 | |||
six==1.15.0 | |||
SQLAlchemy==1.3.24 | |||
SQLAlchemy==1.4.44 |
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.
update the SQLAlchemy version to make it compatible with the custom sql-versioning
# install updated legal-api from feature branch for development, | ||
# TODO - change it back when the db versioning feature branch merged to main | ||
git+https://github.com/bcgov/lear.git@feature-db-versioning#egg=legal_api&subdirectory=legal-api | ||
# git+https://github.com/bcgov/lear.git#egg=legal_api&subdirectory=legal-api |
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.
@leodube-aot how about the legal-api package, installing from the feature branch?
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.
Yup we'll be installing the legal-api package from the feature branch
Quality Gate passedIssues Measures |
@@ -34,7 +34,7 @@ | |||
from entity_queue_common.service import QueueServiceManager | |||
from entity_queue_common.service_utils import EmailException, QueueException, logger | |||
from flask import Flask | |||
from legal_api import db | |||
from legal_api import db, init_db # noqa:F401,I001;pylint:disable=unused-import; |
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.
Didn't remove the db
as in test when mocking, the db attribute is needed for worker. As experimented, removing it caused unit-tests initialization errors. https://github.com/bcgov/lear/blob/feature-db-versioning/queue_services/entity-emailer/tests/conftest.py#L322C1-L322C42
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.
What's interesting is that you can remove this unused db
import along with the monkeypatch.setattr(worker, 'db', db)
line, and the unit tests work fine again. I think we should leave it as is for now. It's been in the code for 3+ years to no ill effect, and we want to limit the number of changes we merge back into main.
|
||
|
||
# used to identify versioning flag | ||
SERVICE_NAME = 'emailer' |
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.
As per discussion using flag emailer
for the tracker. #3092 (comment)
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.
LGTM(^-^) Thanks for sharing the detailed test screenshots
Issue #: /bcgov/entity#22948
Description of changes:
feature branch
Running Emailer when flag is on
Running Emailer when flag is off
Unit Tests Results with various combination of flags on / off (legal-api, emailer)
All flags - on
All flags - off
Legal-API - on & Emailer - off
Legal-API - off & Emailer - on
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).