ManageIQ / floe

Floe is a runner for Amazon States Language workflows
Apache License 2.0
0 stars 6 forks source link

Fix issues with exe/floe and various combinations of workflow and input #174

Closed Fryguy closed 6 months ago

Fryguy commented 6 months ago

This commit cleans up the exe/floe interface for bare workflow/input pairs when passed in combination with --workflow and --input. This commit also makes the --workflow and --input params no longer legacy but supported.

The following are now all accepted ways to pass these parameters:

# Single workflow
exe/floe workflow1.asl
exe/floe workflow1.asl '{"input":1}'
exe/floe workflow1.asl --input '{"input":1}'
exe/floe --workflow workflow1.asl --input '{"input":1}'

# Multiple workflows
exe/floe workflow1.asl '{"input":1}' workflow2.asl '{"input":2}'
exe/floe workflow1.asl workflow2.asl --input '{"input":1}' # input is dup'd for each workflow

The following will raise errors:

exe/floe workflow1.asl workflow2.asl               # ambiguous as to workflow/input pair or 2 workflows, and so requires input
exe/floe workflow1.asl --workflow workflow2.asl    # invalid mixing of bare workflows and parameter
exe/floe workflow1.asl workflow2.asl '{"input":1}' # mismatched workflow/input pairs
exe/floe --input '{"input":1}'                     # missing workflow
exe/floe                                           # no parameters
kbrock commented 6 months ago

also, can we drop --input and --workflow? I left them in when introducing ARGV, but think it is time to drop them.

Don't see any reason to support multiple ways to specify these values.

Thoughts?

Fryguy commented 6 months ago

No this PR makes them a) permanent (I use them personally and prefer them) and b) input, specifically, is useful for multiple workflows that take the same input cause you only need to specify it once

Fryguy commented 6 months ago

I could see maybe removing --workflow in a future PR, but --input has a use case.

miq-bot commented 6 months ago

Checked commit https://github.com/Fryguy/floe/commit/7ecc3c730aae1b3982ca24716dbe6943424e7d06 with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint 2 files checked, 0 offenses detected Everything looks fine. :star: