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

Allows tasks to block dispatch #15040

Closed
wants to merge 16 commits into from
Closed

Conversation

lomky
Copy link
Contributor

@lomky lomky commented Aug 21, 2020

Resolves #14056

Part 1 of the stack:

Part 1: this PR
Part 2: #15041
Part 3: #15042

Description

Renames 'blocking?' to 'blocking_distribution?'
Implements 'blocking_dispatch' and applies it to appropriate tasks

Acceptance Criteria

  • Full Stack: @lomky and @hschallhorn have doublechecked our enable reasoning
  • Tests pass!
  • Code compiles correctly
  • Certain tasks will have the ability to block dispatch
    • CongressionalInterestMailTask
    • FoiaRequestMailTask
    • PrivacyActRequestMailTask
    • PrivacyComplaintMailTask
    • FoiaColocatedTask
    • FoiaTask
    • PrivacyActTask
  • (Stack 2) These task should be created under RootTask* or BvaDispatchTask (Stack 2)
  • (Stack 3) BvaDispatch tasks are not created when tasks that block dispatch are still open (Stack 3)
  • (Stack 3) BvaDispatchTask is created when all tasks that block dispatch are closed (Stack 3)

Testing Plan

  1. Load up the console!
  2. Create a direct review appeal at ready for distribution
  3. Create Tasks of the types listed in the AC - the should not be created under the DistributionTask
    • Dispatch blocking tasks do not block Distribution
  4. Create a few tasks that should still block distribution - the should be created under the Distribution Task
    • Distribution blocking tasks block Distribution
  • Spend a bit of time grepping through the codebase with various permutations of the word 'blocking'
    • places that say 'blocking' now specify 'blocking distribution' or 'blocking dispatch'
    • places testing for blocking distribution properly invoke a task that still blocks distribution

Renames 'blocking?' to 'blocking_distribution?'
Implements 'blocking_dispatch' and applies it to appropriate tasks
 - CongressionalInterestMailTask
 - FoiaRequestMailTask
 - PrivacyActRequestMailTask
 - PrivacyComplaintMailTask
 - FoiaColocatedTask
 - FoiaTask
 - PrivacyActTask
@lomky lomky self-assigned this Aug 21, 2020
it "only returns active appeals that meet both of these conditions:
it has at least one Distribution Task with status assigned
AND
it doesn't have any blocking Mail Tasks." do
it "only returns active appeals that have at least one Distribution Task with status assigned" do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Semi-unrelated cleanup. The behavior that considered mail tasks here was fully removed in #14939

@codeclimate
Copy link

codeclimate bot commented Aug 21, 2020

Code Climate has analyzed commit eebdad9 and detected 0 issues on this pull request.

View more on Code Climate.

Comment on lines 606 to 609
def blocking_dispatch?
self.class.blocking_dispatch?
end

Copy link
Contributor Author

@lomky lomky Aug 21, 2020

Choose a reason for hiding this comment

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

Core of the new behavior is this file and all the subclasses that define blocking_dispatch?

@lomky lomky mentioned this pull request Aug 21, 2020
13 tasks
@lomky lomky marked this pull request as ready for review August 24, 2020 14:35
app/models/tasks/congressional_interest_mail_task.rb Outdated Show resolved Hide resolved
app/models/tasks/mail_task.rb Outdated Show resolved Hide resolved
spec/models/task_spec.rb Show resolved Hide resolved
app/models/tasks/foia_task.rb Show resolved Hide resolved
* Teaches BVA Dispatching Tasks to actually block

* Renames dispatch parent hook

* Apply suggestions from code review

Co-authored-by: Yoom Lam <[email protected]>

* Missed some names

* Applys code review suggestions

 Co-authored-by: Yoom Lam <[email protected]>

* Unblocks tasks preceeding BVA Dispatch

* Update spec/models/task_spec.rb

Co-authored-by: Yoom Lam <[email protected]>

* Update spec/models/task_spec.rb

Co-authored-by: Yoom Lam <[email protected]>

* Adds safe call

* Teaches BVA Dispatch blocking tasks to invoke Dispatch on close (#15042)

* Teaches BVA Dispatch blocking tasks to invoke Dispatch on close

When a task that blocks BVA Dispatch is closed, it evaluates the state of the appeal and attempts to create a BVA Dispatch Task if the appeal is otherwise ready

Teaches BvaDispatchTask to refuse to create if there open dispatch_blocking? tasks

* Enables the feature

* Updates Privacy Task messaging to VLJ Support

* Adds messaging for FOIA ama task assignment

Co-authored-by: Yoom Lam <[email protected]>
@lomky lomky changed the title Teaches tasks to Block Dispatch Allows tasks to block dispatch Aug 28, 2020
@va-bot
Copy link
Collaborator

va-bot commented Aug 28, 2020

1 Warning
⚠️ This PR modifies React components — consider adding/updating corresponding Storybook file

Generated by 🚫 Danger

@lomky lomky changed the base branch from master to develop December 18, 2020 20:15
@lomky lomky changed the base branch from develop to master January 4, 2021 21:48
@lomky lomky closed this Jul 7, 2021
@zurbergram zurbergram deleted the kat/14056_blocking_dispatch_stack_1 branch March 9, 2023 15:55
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.

Allow tasks to block dispatch
3 participants