I’ve been moving my CI/CD pipelines and Fauna management to FSL, but I’m running into issues with using the schema commands of fauna-shell in a CI/CD environment. I’m trying to achieve the following deployment pipeline for Fauna:
run fauna schema push to stage the newly committed schema.
run fauna schema status to poll for the index build status and wait until the schema is ready to commit, or if the build fails or otherwise doesn’t complete, run fauna schema abandon to abandon the schema changes and fail the pipeline.
run fauna schema commit to commit the changes. run fauna schema abandon if the commit fails and fail the pipeline.
deploy other code changes.
I’m running into issues with this because fauna-shell does not provide a machine readable output format for its commands to key off of in automation. This is leading me to hack together status checks by greping the output of the command for specific strings. This is brittle and prone to error as the command text output is meant for humans and not intended to be a stable machine interface.
Please consider adding a machine readable output format flag to dump the output in a stable JSON format. This can be easily read in CI/CD using something like jq, and would allow easier integration of the fauna schema suite of commands into CI/CD. I would recommend enabling this output format for all commands, not just the fauna schema ones.
Thanks for your input here. It’s a great suggestion. Making the output of the CLI easily machine readible is important, and we’ll factor that into our development plans for the CLI.