department-of-veterans-affairs / notification-api

Notification API
MIT License
16 stars 9 forks source link

IIR - Integrate permission check into contact info lookup #1953

Closed stevelong00 closed 2 months ago

stevelong00 commented 3 months ago

User Story - Business Need

Companion Ticket from VA-IIR Team

Currently we have two celery tasks, one for looking up contact info and one for looking up communication permissions. We want to move the permissions check into the contact info lookup so that both can use a single call to Profile API.

User Story(ies)

As a software developer working on the notifications-api repository I want to integrate permission check into contact info lookup So that I can both can use a single call to Profile API

Additional Info and Resources

Currently we have two celery tasks, contact_information_tasks.py and lookup_recipient_communication_permissions_task.py.

We want to combine these into a single task, which makes a single call to Profile API. The simplest way to do this is to integrate the permission check into the contact info lookup, so that contact info is returned only when it both exists and has permissions enabled.

Acceptance Criteria

QA Considerations

All business logic should be the same as before. The only difference with these changes should be that the permission check now happens within the same task as the phone or email lookup.

Potential Dependencies

Out of Scope

cris-oddball commented 2 months ago

PR is approved and merged. There is follow-up work. The Prod feature flag in this PR is set to False, meaning it is off and using the default code in Prod. Will hold this ticket open for QA testing.

cris-oddball commented 2 months ago

PR approved and merged after the revert earlier this week. Currently deployed to Perf. Will begin manual testing for edge cases next week.

cris-oddball commented 2 months ago

Edge cases so far:

Test case failures:

cris-oddball commented 2 months ago

I went back to the original tickets for the explicit send feature and don't really see any other edge cases.

Kyle and Evan have been working on a fix for the 'stuck in created' issue, expect to see a PR 'soon'. They are also looking at that deceased veteran hard bounce vs delivered issue.

cris-oddball commented 2 months ago

A fix is up. That fix has been deployed to Perf and Staging PERF: Feature flag is enabled | True STAGING: Feature flag is disabled | False

Now have a known good deceased PID for perf/staging, will test with that one.

will retest things Tuesday morning.

cris-oddball commented 2 months ago

QA PASSED

PERF - ENABLED Has feature flag set to True (enabled, will use V3) Callback: /internal/qa-staging-automation-callback Both sms and email tested

STAGING - DISABLED Has feature flag set to False (disabled, does not use V3) Callback: /internal/qa-staging-automation-callback Both sms and email tested

AdamKing0126 commented 2 months ago

Thanks for the update, Cris.

Can you help me understand how to reproduce these errors, and maybe write tests against the functionality? Are there any tests in the repo that I can look at, which we have not covered in the v3 functionality?

AdamKing0126 commented 2 months ago

Oh! The checkboxes are filled in now! Maybe I spoke too soon?

cris-oddball commented 2 months ago

@AdamKing0126 you can refer to the PR hotfix that Evan and Kyle worked on and discuss with Evan if you have any questions.

k-macmillan commented 2 months ago

PR has been merged.

cris-oddball commented 2 months ago

This is going straight up to Prod. Closing ticket.