Skip to content

Commit

Permalink
KAZOO-4786: callflow validation during Pivot, auto-generation of call…
Browse files Browse the repository at this point in the history
…flow action schemas (2600hz#2271)

* KAZOO-4786: validate pivot callflow json

* KAZOO-4786: missing callflow schemas

* KAZOO-4786: check for missing callflow schema docs

* KAZOO-4786: introduce behaviour for callflow actions

* KAZOO-4786: add properties to cf_devices schema

* KAZOO-4786: formatting and naming

* KAZOO-4786: start a parser for callflow actions

* KAZOO-4786: process all callflow modules

* KAZOO-4786: add behaviour

ignore modules when not using Data

* KAZOO-4786: more AST forms

* KAZOO-4786: track action as behaviour

* KAZOO-4786: refactor data usage collection

* KAZOO-4786: process list of keys

* KAZOO-4786: add behaviour

* KAZOO-4786: handle more expressions

* KAZOO-4786: add behaviour

* KAZOO-4786: add behaviour

* KAZOO-4786: handle catch expressions

* KAZOO-4786: handle matching records

* KAZOO-4786: handle anon funs

* KAZOO-4786: add OP (andalso/orelse) checking

* KAZOO-4786: generic match handling

* KAZOO-4786: handle list, data, atom

* KAZOO-4786: handle more record fields

* KAZOO-4786: more intricate descending

* KAZOO-4786: refactor to avoid endless recursion

* KAZOO-4786: add behaviour

* KAZOO-4786: handle more OPs, guess data index

* KAZOO-4786: move logging to macro

* KAZOO-4786: add behaviour, refactor a bit

* KAZOO-4786: skip variable Keys

* KAZOO-4786: add behaviour

* KAZOO-4786: only ignore kz_json

* KAZOO-4786: add behaviour

* KAZOO-4786: defeat recursion! more LC parsing

* KAZOO-4786: add behaviour, refactor loops

* KAZOO-4786: use module name only

* KAZOO-4786: add behaviour

* KAZOO-4786: add behaviour

* KAZOO-4786: refactor arg list processing

* KAZOO-4786: add behaviour

* KAZOO-4786: find when kz_json:set_value is used as arg

* KAZOO-4786: add behaviour

* KAZOO-4786: format empty json object

* KAZOO-4786: add behaviour

* KAZOO-4786: continue processing args

* KAZOO-4786: add behaviour

* KAZOO-4786: add behaviour, fix unhandled type

* KAZOO-4786: handle merge_recursive

* KAZOO-4786: add behaviour, formatting

* KAZOO-4786: refactor to remove anon fun

* KAZOO-4786: add behaviour

* KAZOO-4786: handle when Data is in list of JObjs

* KAZOO-4786: add behaviour

* KAZOO-4786: handle mfa

* KAZOO-4786: no need to spawn, and add behaviour

* KAZOO-4786: process dynamically dispatched mfas

* KAZOO-4786: take processed action to schema doc

* KAZOO-4786: more guessing, logging

* KAZOO-4786: update accessors for type guessing

* KAZOO-4786: auto-gen schema!

* KAZOO-4786: another guess

* KAZOO-4786: accessors for guessing types

* KAZOO-4786: fix schemas

* KAZOO-4786: more cleanup of schema generating

* KAZOO-4786: stub cf acdc agent schema

* KAZOO-4786: set type on parent if needed

* KAZOO-4786: cf acdc member schema

* KAZOO-4786: auto-gen schema updates

* KAZOO-4786: better default handling

* KAZOO-4786: handle atom keys (var names)

* KAZOO-4786: auto-gen schema

* KAZOO-4786: better object/array defaults

* KAZOO-4786: auto-gen schema

* KAZOO-4786: update formatting

* KAZOO-4786: fix dialyzer complaints

* KAZOO-4786: call proper function

* KAZOO-4786: fix dialyzer complaints

* KAZOO-4786: fetch just the modules

* KAZOO-4786: move callflow schema gen to makefile

* KAZOO-4786: fix formatting

* KAZOO-4786: fix tests

* KAZOO-4786: ignore TAGS file
  • Loading branch information
jamesaimonetti authored and fenollp committed Jul 14, 2016
1 parent d918a6e commit 184b16f
Show file tree
Hide file tree
Showing 161 changed files with 3,502 additions and 1,002 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ core/kazoo_number_manager/dialcodes.json
core/kazoo_number_manager/src/knm_iso3166a2_itu.erl

make/erlang-formatter-master/
/TAGS
5 changes: 4 additions & 1 deletion applications/callflow/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ROOT = ../..
PROJECT = callflow

all: compile
all: schemas compile

schemas:
@bash priv/scripts/check-schemas.bash

include $(ROOT)/make/kz.mk
38 changes: 38 additions & 0 deletions applications/callflow/priv/scripts/check-schemas.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

pushd $(dirname $0) > /dev/null

RAW_ROOT=$(pwd -P)/../..
CF_ROOT=$(realpath $RAW_ROOT)

function create_stub_schema {
CF=$1
SCHEMA=$2

SKEL="$CF_ROOT/../crossbar/priv/couchdb/schemas/callflows.skel.json"
$(cp -a $SKEL $SCHEMA)
$(sed -i "s/skel/$CF/g" $SCHEMA)
echo " created stub for $SCHEMA"
}

function check_callflow_schema {
CF=$(basename $1)
CF=${CF#cf_}
CF=${CF%.erl}
SCHEMA="$CF_ROOT/../crossbar/priv/couchdb/schemas/callflows.$CF.json"

if [ ! -f $SCHEMA ]; then
create_stub_schema $CF $SCHEMA
fi
}

function check_callflow_schemas {
CALLFLOWS=$(ls $CF_ROOT/src/module/*.erl | grep -v skel)
for CALLFLOW in $CALLFLOWS; do
check_callflow_schema $CALLFLOW
done
}

check_callflow_schemas

popd > /dev/null
Loading

0 comments on commit 184b16f

Please sign in to comment.