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

fix FactoryBot's creation of parent tasks assigned to different appeal #13130

Closed
yoomlam opened this issue Jan 10, 2020 · 2 comments
Closed

fix FactoryBot's creation of parent tasks assigned to different appeal #13130

yoomlam opened this issue Jan 10, 2020 · 2 comments
Assignees
Labels
Eng: Backend Work Group backend engineering task Priority: Medium Blocking issue w/workaround, or "second in" priority for new work. Product: caseflow-queue Stakeholder: BVA Functionality associated with the Board of Veterans' Appeals workflows/feature requests Team: Echo 🐬 Type: Tech-Improvement

Comments

@yoomlam
Copy link
Contributor

yoomlam commented Jan 10, 2020

Description

In many cases, FactoryBot indirectly creates parent tasks when a test wants to create a particular task. However, the appeal for the parent task is not specified during creation, so the parent task is assigned to a new appeal when it should be assigned to the same appeal as the child task.

Technical notes

Child tasks whose parents are in a different appeal in lines like:

parent { create(:ama_judge_decision_review_task) }
, 408, 414, and maybe 427, 433, 105, and 109.

Solution: Add a , appeal: appeal parameter when creating parent or associated tasks.
Try applying the fix a few lines at a time to see if any tests fail.

Hunter has another idea: https://dsva.slack.com/archives/CQCUMFA0H/p1578610726034800?thread_ts=1578607111.032400&cid=CQCUMFA0H

@yoomlam
Copy link
Contributor Author

yoomlam commented Jan 10, 2020

Also highly related is invocations like create(:ama_attorney_task, appeal: appeal), which doesn't set the parent task. For example, in

let(:task1) { create(:ama_attorney_task, appeal: appeal) }
, if you insert puts appeal.structure_render within the it block, the tasks don't print because a parent task was not set to the root_task of the appeal (Tomas will work on a fix for this). appeal.tree will show the 2 AttorneyTask.

@yoomlam yoomlam mentioned this issue Jan 10, 2020
1 task
@hschallhorn
Copy link
Contributor

What is this graph?

1 | 
2 | |||||
3 | |||||||||
5 | |
8 |  

Could be a 2 because optimism! Echo team is pretty smart tbh. Any issue in tests will be a similar fix everywhere. May break a lot of tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Eng: Backend Work Group backend engineering task Priority: Medium Blocking issue w/workaround, or "second in" priority for new work. Product: caseflow-queue Stakeholder: BVA Functionality associated with the Board of Veterans' Appeals workflows/feature requests Team: Echo 🐬 Type: Tech-Improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants