Skip to content

Run workflow and composite commands #1

@rsenden

Description

@rsenden

This issue holds ideas and proposals for running workflows and composite commands.

  • Investigate possibility to run multiple subcommands in one go:
    • For example: fcli login ssc --url ... get applications -o applications.json get versions -o versions.json logout ssc
    • See picocli subcommandsRepeatable = true configuration option
  • Allow shell-based chaining of commands by providing suitable output and functionality for parsing input; some examples:
    • FCLI_FMT=json fcli create ssc version app/version … | fcli … --someOption=${{ stdin.json.project.id }}
    • for v in $(fcli get versions); do fcli download ssc artifact --from ${v}

Idea for workflow syntax:

# Define environment variables for use during workflow run, inheriting from parent environment
env:    
  name: value

# Should we have a separate element for logging in? This would open transient session and would auto-logout
# after workflow completion 
login:   
  ssc:
    url: ...

steps:
  - id: <id used for referencing output of this step in other steps>
    name: Name to display when running this step
    if: ${{ steps.previousStepId.output.json.criticalIssueCount > 0 }}
    forEach: ${{ steps.previousStepId.output.json.data[].id }}
    fcli: <fcli command to run>
    composite:
      async: true|false # Run each step in a separate thread, for example allowing to spawn both sast and dast scans
      maxThreads: 5   # Maximum number of threads to spawn
      joinThreads: true|false # If async==true, wait until all steps defined below have completed
      steps:
        - id, name, fcli, ...

Regarding the fcli: entry:

  • Can use expressions like ${{ env.xyz }}, ${{ steps.abc.output.plain }}, ${{ steps.abc.output.json.someProperty}}, ...
  • Can use run cmd subcommand to run arbitrary commands (run cmd should be disabled by default for security reasons, can be enabled through fcli config run-cmd enabled true|false or something similar
  • Can use run workflow to run other workflows

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort:highLot of effort needed to implement/fixideaprio:highHigh priority; important new feature or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions