phac-nml / irida-next

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

Workflow Executions: Sanitize Workflow Params #518

Closed ericenns closed 6 months ago

ericenns commented 6 months ago

What does this PR do and why?

Describe in detail what your merge request does and why.

Updates the WorkflowExecutions::CreateService to sanitize workflow params. E.g. remove blank values and convert integers and numbers to the correct format

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. Submit a workflow and empty out a value
  2. In rails console query for that workflow execution and check that the param is not present
    irb(main):001> WorkflowExecution.last.workflow_params
    WorkflowExecution Load (0.8ms)  SELECT "workflow_executions"."metadata", "workflow_executions"."workflow_params", "workflow_executions"."workflow_type", "workflow_executions"."workflow_type_version", "workflow_executions"."tags", "workflow_executions"."workflow_engine", "workflow_executions"."workflow_engine_version", "workflow_executions"."workflow_engine_parameters", "workflow_executions"."workflow_url", "workflow_executions"."run_id", "workflow_executions"."state", "workflow_executions"."deleted_at", "workflow_executions"."created_at", "workflow_executions"."updated_at", "workflow_executions"."id", "workflow_executions"."submitter_id", "workflow_executions"."attachments_updated_at", "workflow_executions"."blob_run_directory" FROM "workflow_executions" WHERE "workflow_executions"."deleted_at" IS NULL ORDER BY "workflow_executions"."created_at" DESC, "workflow_executions"."id" DESC LIMIT $1  [["LIMIT", 1]]
    => {"--input"=>"/home/eenns/irida-next-core/storage/60/so/60soetnkta3z4v8vgxg1z4zczuwa/samplesheet.csv", "--outdir"=>"/home/eenns/irida-next-core/storage/60/so/60soetnkta3z4v8vgxg1z4zczuwa/output/", "--assembler"=>"stub", "--project_name"=>"assembly"}

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 6 months ago

Simplecov Report

Covered Threshold
92.32% 90%