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

PORTAL-2480 - creates migration to add expected_cadence to promoted_templates #2121

Merged
merged 3 commits into from
Nov 15, 2024

Conversation

MarchandMD
Copy link

@MarchandMD MarchandMD commented Nov 13, 2024

Description

Adds the expected_cadence text field to the promoted_templates table

issue 2480 of the notification-portal

How Has This Been Tested?

ran flask db upgrade and then flask db downgrade locally

deploy to dev - api action run successful - verifies migration run successfully
DB downgrade action run successful - verifies migration rollback successful

Checklist

  • I have assigned myself to this PR
  • PR has an appropriate title: #9999 - What the thing does
  • PR has a detailed description, including links to specific documentation
  • I have added the appropriate labels to the PR.
  • I did not remove any parts of the template, such as checkboxes even if they are not used
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to any documentation
  • My changes generate no new warnings
  • [na] I have added tests that prove my fix is effective or that my feature works. Testing guidelines
  • I have ensured the latest main is merged into my branch and all checks are green prior to review
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • [na] The ticket was moved into the DEV test column when I began testing this change

@MarchandMD MarchandMD self-assigned this Nov 13, 2024
@MarchandMD MarchandMD requested a review from a team as a code owner November 13, 2024 21:10
@ianperera
Copy link

ianperera commented Nov 13, 2024

Looks good so far,

  1. What do you think about adding an Index for it?
  2. Making it enum type instead of text?

@MarchandMD
Copy link
Author

  1. I don't believe the promoted_templates table will be queried frequently enough to necessitate this index, though I'd listen to arguments in favor of one
  2. Considering the values will be similar to: daily, weekly, monthly, etc, I feel like integers wouldn't be appropriate.

@ianperera

@ianperera
Copy link

  1. I don't believe the promoted_templates table will be queried frequently enough to necessitate this index, though I'd listen to arguments in favor of one
  2. Considering the values will be similar to: daily, weekly, monthly, etc, I feel like integers wouldn't be appropriate.

@ianperera

typo, I meant enum.

@MarchandMD
Copy link
Author

Enum would be an unnecessary obfuscation, IMO. The idea of an "expected cadence" is already somewhat opaque, and considering all the potential values (daily, weekly, monthly, quarterly, one-time, adhoc, etc) the most informative and simplest way to store this information for each record is it's actual text value, as opposed to a representation of its value. The reason being, if an expected cadence for a single record is needed, we as engineers would be able to observe a single record and determine its expected cadence without needing to reference the base model to decipher its value from an enum key. IMO.

ianperera
ianperera previously approved these changes Nov 14, 2024
@cris-oddball
Copy link

@MarchandMD before you ask for more approvals, please update the title to follow this convention (necessary for the release notes): PORTAL-2480 - blah blah

Also, this needs to be deployed to Dev to be able to merge (please use the branch name for both the 'workflow' and the 'branch name' in the action, so that the deploy properly links back to this PR) and then run the DB downgrade action, and both of those runs linked in your testing notes. Happy to help if that's unclear. Thank you!

@ianperera
Copy link

Enum would be an unnecessary obfuscation, IMO. The idea of an "expected cadence" is already somewhat opaque, and considering all the potential values (daily, weekly, monthly, quarterly, one-time, adhoc, etc) the most informative and simplest way to store this information for each record is it's actual text value, as opposed to a representation of its value. The reason being, if an expected cadence for a single record is needed, we as engineers would be able to observe a single record and determine its expected cadence without needing to reference the base model to decipher its value from an enum key. IMO.

as engineers, if we document the enum values clearly, it would be easy to understand.

@MarchandMD MarchandMD changed the title 2480: creates migration to add expected_cadence to promoted_templates PORTAL-2480 - creates migration to add expected_cadence to promoted_templates Nov 14, 2024
@MarchandMD
Copy link
Author

@cris-oddball With the help of you and Evan I was able to successfully perform both actions.

The PR description has been updated with links to both of those runs.

Please LMK if there's anything else I can do to expedite this PR! Thank you!

@cris-oddball
Copy link

@MarchandMD thank you! If you want the llamas to review, you'll need to ask for that review. I think both Ian and Nathan are in our engineering channel and they can ask for you - see what they say?

EvanParish
EvanParish previously approved these changes Nov 14, 2024
Copy link
Member

@kalbfled kalbfled left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be corresponding changes in app/models.py::PromotedTemplate.

@MarchandMD MarchandMD dismissed stale reviews from EvanParish and ianperera via 54d6a5d November 14, 2024 21:14
Copy link

@ianperera ianperera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MarchandMD MarchandMD merged commit 432011a into main Nov 15, 2024
14 checks passed
@MarchandMD MarchandMD deleted the mm/2480-v1 branch November 15, 2024 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants