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

Graphql: Submit Workflow Execution #838

Open
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

JeffreyThiessen
Copy link
Member

@JeffreyThiessen JeffreyThiessen commented Nov 7, 2024

What does this PR do and why?

Describe in detail what your merge request does and why.

  • Added new graphql mutation SubmitWorkflowExecution which submits a workflow execution / pipeline.
  • Added a new Validator for WorkflowExecution objects, which ensures samplesheet params attachments are formatted correctly.
    • This is not an issue when workflow executions are submitted via the Web UI, but graphql accepts any text so an invalid attachment could cause problems in the pipeline if not validated beforehand.

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.

Get some data to use in a submission

query getProject{
  project(fullPath: "bacillus/bacillus-anthracis/outbreak-2022") {
    id
    name
    path
    samples(first:1){
      nodes{
        name
        id
        puid
        attachments{
          nodes{
            filename
            id
          }
        }
      }
    }
  }
}

Use the data returned from the previous step to populate the following submission mutation

mutation submitWE {
  submitWorkflowExecution (input:{
    name:"My Workflow from graphql 5"
    projectId: "gid://irida/Project/13d4c370-c707-4afa-8fe2-a26719508c02"
    updateSamples: false
    emailNotification: false
    workflowName: "phac-nml/iridanextexample"
    workflowVersion:"1.0.3"
    workflowParams: {
      assembler: "stub",
      random_seed: 1,
      project_name: "assembly"
    }
    workflowType: "NFL"
    workflowTypeVersion:"DSL2"
    workflowEngine:"nextflow"
    workflowEngineVersion: "23.10.0"
    workflowEngineParameters: [
      {
        key:"-r",
        value:"1.0.3"
      }
    ]
    workflowUrl: "https://github.com/phac-nml/iridanextexample"
    samplesWorkflowExecutionsAttributes:[
      {
        sample_id:"gid://irida/Sample/e978e898-f5f6-44a1-934a-418392d4c532"
        samplesheet_params:{
          sample: "INXT_SAM_AYMK34F2FG",
          fastq_1:"gid://irida/Attachment/dd4470cb-71b2-4d75-accf-f6954cc4c922",
          fastq_2:"gid://irida/Attachment/8299fc62-66fc-4915-959e-f4f97d51b061"
        }
      }
    ]
  }){
    workflowExecution{
      name
      id
    }
    errors{
      message
      path
    }
  }
}

PR acceptance checklist

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

@JeffreyThiessen JeffreyThiessen force-pushed the graphql/submit_workflow_execution branch from eb52de5 to 815d739 Compare December 10, 2024 20:34
@JeffreyThiessen JeffreyThiessen changed the base branch from main to graphql/workflow_execution_type December 10, 2024 20:34
@JeffreyThiessen JeffreyThiessen force-pushed the graphql/workflow_execution_type branch from 0230b2e to 6f79351 Compare December 18, 2024 16:39
@JeffreyThiessen JeffreyThiessen force-pushed the graphql/submit_workflow_execution branch 2 times, most recently from ce227e4 to abd7c59 Compare December 19, 2024 16:31
Base automatically changed from graphql/workflow_execution_type to main December 19, 2024 17:03
@JeffreyThiessen JeffreyThiessen force-pushed the graphql/submit_workflow_execution branch from abd7c59 to f463a13 Compare December 19, 2024 17:17
@JeffreyThiessen JeffreyThiessen marked this pull request as ready for review December 19, 2024 17:27
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.

1 participant