awslabs / amplify-video

An open source Category Plugin for the AWS Amplify-CLI that makes it easy to deploy live and file based streaming video services and integrate them into your Amplify applications.
https://www.npmjs.com/package/amplify-category-video
Apache License 2.0
267 stars 56 forks source link

Automate generation of all possible answer path for each service's questions #194

Open spaniernathan opened 3 years ago

spaniernathan commented 3 years ago

Is your feature request related to a problem? Please describe. For now, we are writing each permutation of ressource deployment for tests and we want to automate this process.

For example on the IVS service, those are all the questions permutation the user can do:

Screenshot 2021-02-04 at 15 08 19

And those kind of shell scripts are written for each paths permutations:

#!/bin/bash
set -e
IFS='|'
PERMUTATION="{\
\"service\":\"video\",\
\"serviceType\":\"ivs\",\
\"providerName\":\"awscloudformation\",\
\"resourceName\":\"std-low\",\
\"channelQuality\":\"STANDARD\",\
\"channelLatency\":\"LOW\",\
...
}"
amplify video add --payload $PERMUTATION

I would like to automate this kind of process

Describe the solution you'd like A script that will go through a specific file (called helper file for now) containing the relations between questions asked to the user, A script that will go through every provider-utils/{}-questions.json files then build a graph of all the possible paths the CLI user can go through when creating a ressource and then go all over that graph to generate all the possible cases. Automate the generation of all possible cloudformation templates a user can generate with amplify video add.

Describe alternatives you've considered

Additional context For some of the paths, we might not be able to automatically generate the possible permutations because some logic is implemented between certain question (for example in VOD serviceType) some of the paths are programatically implemented (for example if on question 10 the user says 'yes' it goes to question 11 and if he says 'no' it goes on question 14). If we want to be able to fully automate the generation, we might need to change how the questions files are formatted (maybe add relation between questions)

Related to: https://github.com/awslabs/amplify-video/issues/186