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

PROD-2058 implement endpoints for property specific messaging #4983

Merged
merged 21 commits into from
Jun 18, 2024

Conversation

eastandwestwind
Copy link
Contributor

@eastandwestwind eastandwestwind commented Jun 13, 2024

Closes https://ethyca.atlassian.net/browse/PROD-2058

Description Of Changes

Implements API endpoints for property-specific messaging. The following new endpoints were added:

  • GET /messaging/templates/summary- get paginated list of all templates
  • GET /messaging/templates/default/{template_type}- get the default messaging template by type. This is not dependent on the DB at all, rather hard-coded in the BE.
  • POST /messaging/templates/{template_type}- create a new messaging template . Use req body formatted like:
content: Dict[str, Any]
properties: Optional[List[str]]
is_enabled: bool
  • PUT /messaging/templates/{id}- update an existing messaging template. Use req body formatted like:
content: Dict[str, Any]
properties: Optional[List[str]]
is_enabled: bool
  • PATCH /messaging/templates/{id}- update an existing messaging template. Use req body formatted like:
content: Optional[Dict[str, Any]]
properties: Optional[List[str]]
is_enabled: Optional[bool]
  • GET /messaging/templates/{id}- get an existing messaging template by id
  • DELETE /messaging/templates/{id} - delete a messaging template by id

Code Changes

  • Adds new endpoints to support property-specific messaging
  • Adds endpoint tests

Steps to Confirm

  • Attempt to add / edit / create /delete messaging templates via endpoints. See endpoint tests in ops/api/v1/endpoints/test_messaging_endpoints.py for details of how the endpoints should function.

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Documentation:
    • documentation complete, PR opened in fidesdocs
    • documentation issue created in fidesdocs
    • if there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
  • Issue Requirements are Met
  • Relevant Follow-Up Issues Created
  • Update CHANGELOG.md
  • For API changes, the Postman collection has been updated
  • If there are any database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!

Copy link

vercel bot commented Jun 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Jun 18, 2024 11:03am

@eastandwestwind eastandwestwind force-pushed the PROD-2058-endpoints-property-specific-messaging branch from 05bdb13 to 37c4f59 Compare June 13, 2024 16:11
Copy link

cypress bot commented Jun 13, 2024

Passing run #8366 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge dfa3ae6 into 29305c1...
Project: fides Commit: 1f377f4b18 ℹ️
Status: Passed Duration: 00:35 💡
Started: Jun 18, 2024 11:15 AM Ended: Jun 18, 2024 11:15 AM

Review all test suite changes for PR #4983 ↗︎

@eastandwestwind eastandwestwind force-pushed the PROD-2058-endpoints-property-specific-messaging branch from 5c46156 to dec5f1d Compare June 14, 2024 12:56
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.59%. Comparing base (29305c1) to head (dfa3ae6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4983      +/-   ##
==========================================
+ Coverage   86.54%   86.59%   +0.04%     
==========================================
  Files         351      351              
  Lines       21739    21818      +79     
  Branches     2878     2881       +3     
==========================================
+ Hits        18814    18893      +79     
  Misses       2420     2420              
  Partials      505      505              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eastandwestwind eastandwestwind requested a review from galvana June 17, 2024 16:54
@eastandwestwind
Copy link
Contributor Author

Pipeline failures dependent on #4993 being merged

Copy link
Contributor

@galvana galvana left a comment

Choose a reason for hiding this comment

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

Very straightforward set of endpoints to manage all of these templates! Everything worked as expected so feel free to address my comments only if time permits. The two things that stuck out to me were:

  • Having these endpoints in fides, in my opinion, since they are for plus functionality, the endpoints should be defined in fidesplus
  • Using a more constrained enum instead of MessagingActionType for the GET/POST /api/v1/messaging/templates/{template_type} endpoints

src/fides/api/common_exceptions.py Outdated Show resolved Hide resolved
src/fides/api/schemas/messaging/messaging.py Outdated Show resolved Hide resolved
tests/ops/api/v1/endpoints/test_messaging_endpoints.py Outdated Show resolved Hide resolved
@eastandwestwind
Copy link
Contributor Author

Ticket to move endpoints to plus as a follow-up: https://ethyca.atlassian.net/browse/PROD-2211

@eastandwestwind eastandwestwind merged commit c2bfdbe into main Jun 18, 2024
42 checks passed
@eastandwestwind eastandwestwind deleted the PROD-2058-endpoints-property-specific-messaging branch June 18, 2024 12:17
Copy link

cypress bot commented Jun 18, 2024

Passing run #8367 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

PROD-2058 implement endpoints for property specific messaging (#4983)
Project: fides Commit: c2bfdbe899
Status: Passed Duration: 00:34 💡
Started: Jun 18, 2024 12:28 PM Ended: Jun 18, 2024 12:29 PM

Review all test suite changes for PR #4983 ↗︎

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

Successfully merging this pull request may close these issues.

2 participants