phac-nml / irida-next

IRIDA Next
https://phac-nml.github.io/irida-next/
Apache License 2.0
8 stars 2 forks source link

Automated Workflow Execution launching #574

Closed ericenns closed 2 months ago

ericenns commented 2 months ago

What does this PR do and why?

Describe in detail what your merge request does and why.

This PR adds in AutomatedWorkflowExecution launching upon upload of pair end data to a Sample in a Project that has AutomatedWorkflowExecutions configured.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other pull requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Launch server using bin/dev
  2. Login as user1@email.com
  3. Create a personal project named test awe
  4. Launch rails console (bin/rails c) and execute the following to add an automated workflow execution:
    AutomatedWorkflowExecutions::CreateService.new(User.find_by(email: 'user1@email.com'), { namespace: Namespaces::ProjectNamespace.find_by_full_path('user1_at_email.com/test-awe'), metadata: { workflow_name: 'phac-nml/iridanextexample', workflow_version: '1.0.2' },
    workflow_params: { assembler: 'stub' }, email_notification: false, update_samples: true }).execute
  5. In Project test awe create a new sample named test001
  6. Upload pair end data to test001
  7. Confirm in rails console that 1 WorfklowExecution was created
    WorkflowExecution.where(submitter: Project.last.namespace.automation_bot).count
  8. Upload 2 sets of pair end data to test001
  9. Confirm in rails console that only 1 WorkflowExecution was created
    WorkflowExecution.where(submitter: Project.last.namespace.automation_bot).count

PR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

github-actions[bot] commented 2 months ago

Simplecov Report

Covered Threshold
92.29% 90%