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

feat(core): add support for dependsOn on input (#3610) #4972

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

fhussonnois
Copy link
Member

This commits adds:

  • support for dependsOn field in flow's inputs
  • support for expression on input of type SELECT, MULTISELECT
  • new REST API to validate inputs for an execution
  • some code cleanup, and method renaming

Fix: #3610

@fhussonnois fhussonnois force-pushed the fix/gh-3610 branch 8 times, most recently from de6fa8a to 728a232 Compare September 20, 2024 12:54
This commits adds:
- support for dependsOn field in flow's inputs
- support for expression on input of type SELECT, MULTISELECT
- new REST API to validate inputs for an execution
- some code cleanup, and method renaming

Fix: #3610
@fhussonnois fhussonnois changed the title WIP feat(core): add support for dependsOn on input (#3610) feat(core): add support for dependsOn on input (#3610) Sep 20, 2024
Copy link

sonarcloud bot commented Sep 20, 2024

Copy link
Member

@anna-geller anna-geller left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Can you add some flow examples so we can document it the right way?

@fhussonnois
Copy link
Member Author

@anna-geller : here is the example :

id: example_conditional_inputs
namespace: io.kestra
inputs:
  - id: "cloud_providers"
    type: SELECT
    expression: "{{ kv('cloud_providers') }}"

  - id: "aws_credential"
    type: SELECT
    values:
      - ENV
      - SECRETS
    dependsOn: 
      inputs: [ cloud_providers ]
      condition: "{{ inputs.cloud_providers equals 'AWS' }}"

  - id: "aws_access_key"
    type: STRING
    dependsOn: 
      inputs: [ aws_credential ]
      condition: "{{ inputs.aws_credential equals 'SECRETS' }}"

  - id: "aws_secret_key"
    type: STRING
    dependsOn: 
      inputs: [ aws_credential ]
      condition: "{{ inputs.aws_credential equals 'SECRETS' }}"

  - id: "azure_connection"
    type: STRING
    dependsOn: 
      inputs: [ cloud_providers ]
      condition: "{{ inputs.cloud_providers equals 'AZURE' }}"

tasks:
  - id: data
    type: io.kestra.plugin.core.debug.Return
    format: "SUCCESS"
    allowFailure: true

  - id: pause
    type: io.kestra.plugin.core.flow.Pause
    onResume:
      - id: "s3-bucket"
        type: STRING
        required: true
        dependsOn:
         inputs:
            - "cloud_provider"
         condition: "{{ outputs.data.value equals 'SUCCESS' }}"

@fhussonnois fhussonnois merged commit dc57546 into develop Sep 23, 2024
9 checks passed
@fhussonnois fhussonnois deleted the fix/gh-3610 branch September 23, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants