-
Notifications
You must be signed in to change notification settings - Fork 69
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
Toggle to call Form526ConfirmationEmailJob in poll_form526_pdf #19478
Conversation
submission: #{submission_id} from poll_form526_pdf") | ||
params = submission.personalization_parameters(first_name) | ||
Form526ConfirmationEmailJob.perform_async(params) | ||
end |
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.
Looks great! Just wondering what you think about pulling lines 100-106 out into a send_received_email
method?
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'll do this as well with some fixes, once I'm able to
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!
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.
the feature looks good. just a comment about the testing strategy
subject { create(:form526_submission, :with_multiple_succesful_jobs) } | ||
|
||
before do | ||
Flipper.enable(:disability_526_call_received_email_from_polling) |
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.
feature flags in the test environment are automatically enabled.
did we mean to disable at the start, enable here, then disable in an after
clause for the next tests to isolate these unit tests?
that's the usual pattern we follow.
and that may be why the tests are failing. i haven't looked at the details, but that seems like a solid guess 🤣
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.
Ah, actually I think you're right! Will try it out and make the adjustment
|
||
context 'with disability_526_call_received_email_from_polling enabled' do | ||
before do | ||
Flipper.enable(:disability_526_call_received_email_from_polling) |
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.
same for this
… into separate function
@rmtolmach It seems the change is causing some flakiness with other tests we have that don't mock the Flipper call. In the interest of getting this feature toggle shipped, can we merge it with the previous changes, and I can make a follow-up ticket for my team to resolve the rest of the tests? In the short term, this shouldn't cause any issues as my team is the only one that will be toggling and working with this flag |
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 think we can fix this easily. give it a whirl!
@@ -1282,7 +1282,17 @@ def expect_no_max_cfi_logged(diagnostic_code) | |||
context 'with submission confirmation email when successful job statuses' do | |||
subject { create(:form526_submission, :with_multiple_succesful_jobs) } | |||
|
|||
it 'returns one job triggered' do | |||
it 'does not trigger job when disability_526_call_received_email_from_polling enabled' do | |||
allow(Flipper).to receive(:enabled?).with(:disability_526_call_received_email_from_polling, |
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 Mark, the tests are now failing because someone added a Flipper called saved_claim_schema_validation_disable
which is called in this call chain, i'm guessing when the form526 submission record is created on line 1283, which requires a saved_claim.
all we have to do is add this line above where we're calling the Flipper mock.
allow(Flipper).to receive(:enabled?).with(:saved_claim_schema_validation_disable).and_return(false)
i think that should work.
be sure to pull latest from master as that flag looks pretty new!
end | ||
|
||
it 'returns one job triggered when disability_526_call_received_email_from_polling disabled' do | ||
allow(Flipper).to receive(:enabled?).with(:disability_526_call_received_email_from_polling, |
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.
here too!
allow(Flipper).to receive(:enabled?).with(:saved_claim_schema_validation_disable).and_return(false)
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.
Thanks! I'll put the same thoughts I had in our channel here, but the implications of having more and more mocked flags needing to reference each other in order to prevent flakiness concerns me, especially when these threads are owned by different teams. We could certainly solve this for our team's unit tests, but @rmtolmach maybe this is worth revisiting later?
Anyways, I've made the changes for the short term, hopefully that's the only dependency for now
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.
hm, that is odd. I'll bring that up with the backend CoP
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.
👍 specs passing
Backend-review-group approval confirmed. |
Note: Delete the description statements, complete each step. None are optional, but can be justified as to why they cannot be completed as written. Provide known gaps to testing that may raise the risk of merging to production.
Summary
*This work is behind a feature toggle (flipper): YES
(Summarize the changes that have been made to the platform)
Add a feature toggle to call
Form526ConfirmationEmailJob
in our polling job(If bug, how to reproduce)
(What is the solution, why is this the solution?)
(Which team do you work for, does your team own the maintenance of this component?)
(If introducing a flipper, what is the success criteria being targeted?)
Control the availability of the new Received email so that Veterans do not experience a degraded or otherwise non-functional submission experience. A received email exists today, so it’s important that we maintain this
Related issue(s)
Testing done
Screenshots
Note: Optional
What areas of the site does it impact?
(Describe what parts of the site are impacted andifcode touched other areas)
Acceptance criteria
Requested Feedback
(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?