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

Override pipeline default values #975

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

Conversation

deepsidhu85
Copy link
Contributor

@deepsidhu85 deepsidhu85 commented Mar 11, 2025

What does this PR do and why?

Describe in detail what your merge request does and why.

This PR updates the pipeline.rb file to set two new hashes default_params which contains the default params formerly in the workflow executions create service and a default_workflow_params hash which contains any of the defaults required for the workflow.

Screenshots or screen recordings

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

These screenshots display the transformation type that the workflow execution ran with (removed hidden from property transformation for the pipelines for screenshot purposes)

image

image

How to set up and validate locally

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

  1. Update pipelines.json to include the following pipelines (remove the hidden:true from the transformation properties for both pipelines so that you can view which transformation type was set for the workflow execution in the UI )
{
    "url": "https://github.com/phac-nml/metadatatransformation",
    "name": "Lock Metadata",
    "description": "Locks sample metadata.",
    "overrides": {
      "definitions": {
        "input_output_options": {
          "description": "The metadata to lock. "
        },
        "transformation_options": {
          "properties": {
            "transformation": {
              "enum": ["lock"],
              "default": "lock",
              "hidden": true
            },
            "age_header": {
              "hidden": true
            }
          }
        },
        "metadata": {
          "properties": {
            "metadata_1_header": {
              "description": "The column header name associated with the 1st column. If the header remains the same, it will lock the metadata. If the header is changed, it will copy it and lock it."
            },
            "metadata_2_header": {
              "description": "The column header name associated with the 2nd column. If the header remains the same, it will lock the metadata. If the header is changed, it will copy it and lock it."
            },
            "metadata_3_header": {
              "description": "The column header name associated with the 3rd column. If the header remains the same, it will lock the metadata. If the header is changed, it will copy it and lock it."
            },
            "metadata_4_header": {
              "description": "The column header name associated with the 4th column. If the header remains the same, it will lock the metadata. If the header is changed, it will copy it and lock it."
            },
            "metadata_5_header": {
             "description": "The column header name associated with the 5th column. If the header remains the same, it will lock the metadata. If the header is changed, it will copy it and lock it."
            },
            "metadata_6_header": {
              "description": "The column header name associated with the 6th column. If the header remains the same, it will lock the metadata. If the header is changed, it will copy it and lock it."
            },
            "metadata_7_header": {
              "description": "The column header name associated with the 7th column. If the header remains the same, it will lock the metadata. If the header is changed, it will copy it and lock it."
            },
            "metadata_8_header": {
              "description": "The column header name associated with the 8th column. If the header remains the same, it will lock the metadata. If the header is changed, it will copy it and lock it."
            }
          }
        }
      }
    },
    "versions": [
      {
        "name": "dev",
        "executable": true
      }
    ]
  },
  {
    "url": "https://github.com/phac-nml/metadatatransformation",
    "name": "Calculate Age",
    "description": "Calculates the age between two dates.",
    "overrides": {
      "definitions": {
        "input_output_options": {
          "description": "The first metadata column is understood as the date of birth and the second column is understood as the date at which to calculate the age. All other metadata columns will be ignored."
        },
        "transformation_options": {
          "properties": {
            "transformation": {
              "enum": ["age"],
              "default": "age",
              "hidden": true
            },
            "age_header": {
              "description": "The column header name for the calculated age. "
            }
          }
        },
        "metadata": {
          "properties": {
            "metadata_1_header": {
              "description": "The column header name associated with the first column (the date of birth)."
            },
            "metadata_2_header": {
              "description": "The column header name associated with the second column (the date at which to calculate the age)."
            },
            "metadata_3_header": {
              "hidden": true
            },
            "metadata_4_header": {
              "hidden": true
            },
            "metadata_5_header": {
              "hidden": true
            },
            "metadata_6_header": {
              "hidden": true
            },
            "metadata_7_header": {
              "hidden": true
            },
            "metadata_8_header": {
              "hidden": true
            }
          }
        }
      }
    },
    "versions": [
      {
        "name": "dev",
        "executable": true
      }
    ]
  }
  1. Create a project, add new sample, upload a paired-end dataset, and add some metadata to the sample
  2. Select the sample from the Samples table and select the rocket icon
  3. Select the Calculate Age pipeline and select the metadata fields and click Submit
  4. Repeat steps 3 and 4 for but in step 4 select Lock Metadata
  5. View the Parameters tab for the workflow executions launched above
  6. Verify the correct transformation type is shown for each of the workflow executions

PR acceptance checklist

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

…e to pipeline.rb and added new hash default_params which will contain these params and any other default values in the pipelines config

This comment has been minimized.

@deepsidhu85 deepsidhu85 self-assigned this Mar 11, 2025
@deepsidhu85 deepsidhu85 requested a review from ericenns March 11, 2025 17:44

This comment has been minimized.

@deepsidhu85 deepsidhu85 marked this pull request as ready for review March 11, 2025 17:47
Copy link

Code Metrics Report

Coverage Test Execution Time
94.5% 11m2s

Code coverage of files in pull request scope (25.6%)

Files Coverage
app/services/workflow_executions/create_service.rb 92.5%
lib/irida/pipeline.rb 0.0%

Reported by octocov

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