-
Notifications
You must be signed in to change notification settings - Fork 18
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 feedback_reason
column to the notification table
#2443
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
""" | ||
|
||
Revision ID: 0474_add_feedback_reason_column | ||
Revises: 0473_change_pt_support_email | ||
Create Date: 2025-02-05 14:40:00 EST | ||
|
||
""" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
revision = "0474_add_feedback_reason_column" | ||
down_revision = "0473_change_pt_support_email" | ||
|
||
new_notification_status = "pinpoint-failure" | ||
|
||
|
||
def upgrade(): | ||
op.add_column("notifications", sa.Column("feedback_reason", sa.String(length=255), nullable=True)) | ||
op.add_column("notification_history", sa.Column("feedback_reason", sa.String(length=255), nullable=True)) | ||
|
||
op.create_index( | ||
op.f("ix_notifications_feedback_reason"), | ||
"notifications", | ||
["feedback_reason"], | ||
) | ||
op.create_index( | ||
op.f("ix_notification_history_feedback_reason"), | ||
"notification_history", | ||
["feedback_reason"], | ||
) | ||
|
||
op.execute("INSERT INTO notification_status_types (name) VALUES ('{}')".format(new_notification_status)) | ||
|
||
|
||
def downgrade(): | ||
op.drop_index(op.f("ix_notifications_feedback_reason"), table_name="notifications") | ||
op.drop_index(op.f("ix_notification_history_feedback_reason"), table_name="notification_history") | ||
op.drop_column("notifications", "feedback_reason") | ||
op.drop_column("notification_history", "feedback_reason") | ||
op.execute("DELETE FROM notification_status_types WHERE name = '{}'".format(new_notification_status)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
Let's name the status to untie from a specific technology. We could go back to AWS SES or we could support Twilio as well and other providers. Is there a way to name this without depending on the implementation (and extend the model on an abstract name)?
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.
Currently all the failures are SES related. This is now Piinpoint related and we wanted to store that and make it obv. I think as we grow and add more providers/ clients/ - we should add failures according to those implementations so we might know exactly where the failure came from and not have to traceback through logs
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.
I agree with not tying statuses to functionality or vendor specific terminology. That said, properly achieving vendor agnostic terminology for statuses, while still improving observability would take some effort.
Since we're handling a conflict between a Request -
send to intl. #
, and the configuration of the target provider resource -pinpoint not configured for intl. sending
, we could use something more generic like:PROVIDER_FAILURE
PROVIDER_CONFLICT_FAILURE
PROVIDER_VALIDATION_FAILURE
Then capture the vendor specific info + failure reason in the
feedback_reason
. To Jumana's point - the current solution does provide added observability while requiring minimal changes to existing infrastructure for the time being.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.
Hey I missed these replies. I am not big on tying our implementations with vendor specific names, especially when changing that to be generic would have been minimal effort IMO. We are starting a technical debt here that could have been avoided easily. This breaks abstractions and good design in general. I would bring this to the code review sessions.