StackStorm / orquestaconvert

Converts Mistral workflows into Orchestra workflows
Apache License 2.0
13 stars 7 forks source link

Add validate and verbose flags #13

Closed blag closed 6 years ago

blag commented 6 years ago

TODO:

This PR adds a --validate flag to validate a workflow file against the Orquesta spec. It silently returns/exits with 0 exit code if the workflow validates, and otherwise errors out. I also add -v/--verbose flag, which causes the validate method to explicitly print a successful validation message and is ignored for all other actions.

These options, along with the --force flag, are intended to make it easier for users to manually convert workflows that cannot fully be automatically converted. I imagine the user would:

  1. Run orquestaconvert-pack.sh to automatically convert as many options as possible. Any workflows that cannot be converted, and the errors/reasons they cannot be automatically converted summarized for the user (this last part should be possible/done once I port orquestaconvert-pack.sh to Python).
  2. Commit changes.
  3. Run orquestaconvert.sh --force to forcefully convert a remaining Mistral workflow.
  4. Manually convert the remaining pieces of the workflow.
  5. Run orquestaconvert.sh --validate to validate manual workflow conversion.
  6. Commit changes.

Note that just because this script validates a workflow does not mean that the workflow will execute successfully. Some validation checks must be run online.

codecov-io commented 6 years ago

Codecov Report

Merging #13 into master will increase coverage by 0.08%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #13      +/-   ##
==========================================
+ Coverage   98.16%   98.24%   +0.08%     
==========================================
  Files          11       11              
  Lines         436      457      +21     
==========================================
+ Hits          428      449      +21     
  Misses          8        8
Impacted Files Coverage Δ
orquestaconvert/pack_client.py 92.47% <100%> (+0.9%) :arrow_up:
orquestaconvert/client.py 97.95% <100%> (+0.59%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c70569a...075faba. Read the comment docs.

nmaludy commented 6 years ago

@blag These look really useful! Might be good to add examples to the README.