Skip to content

Commit

Permalink
feat: add extra-deploy rule (#449)
Browse files Browse the repository at this point in the history
Co-authored-by: Jesús Arroyo Torrens <[email protected]>
  • Loading branch information
jgoizueta and Jesus89 authored Oct 23, 2023
1 parent f3c4cdd commit 4d5de7c
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clouds/bigquery/common/.sqlfluff
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ templater = jinja
# Comma separated list of rules to check, default to all
rules = all
# Comma separated list of rules to exclude, or None
exclude_rules = L016,L025,L031,L032,L029,L022,L036,L003,L064,L061,L027,L017,L049
exclude_rules = L016,L025,L031,L032,L029,L022,L036,L003,L064,L061,L027,L017,L049,L044
# The depth to recursively parse to (0 for unlimited)
recurse = 0
# Below controls SQLFluff output, see max_line_length for SQL output
Expand Down
2 changes: 1 addition & 1 deletion clouds/bigquery/common/build_modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ functionsFilter.forEach(f => {
if (!nodeps) {
functions.forEach(mainFunction => {
functions.forEach(depFunction => {
if (mainFunction.name != depFunction.name) {
if (mainFunction.name != depFunction.name && depFunction.name !== 'SETUP') {
const depFunctionMatches = [];
depFunctionMatches.push(...depFunction.content.replace(/(\r\n|\n|\r)/gm,' ').matchAll(new RegExp('(?<=(?<!TEMP )FUNCTION)(.*?)(?=AS |RETURNS)','g')));
depFunctionMatches.push(...depFunction.content.replace(/(\r\n|\n|\r)/gm,' ').matchAll(new RegExp('(?<=PROCEDURE)(.*?)(?=BEGIN)','g')));
Expand Down
3 changes: 3 additions & 0 deletions clouds/bigquery/modules/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ endif
ifdef BQ_PERMISSIONS_GROUP
BQ_PERMISSIONS_TARGET_DATASET=$(BQ_DEPLOY_DATASET) $(COMMON_DIR)/set_module_permissions_group.sh
endif
$(MAKE) extra-deploy

extra-deploy::

dataset-create:
$(BQ) show $(BQ_DEPLOY_DATASET) 2>/dev/null 1>/dev/null || \
Expand Down
3 changes: 3 additions & 0 deletions clouds/databricks/modules/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ deploy: check build
$(VENV3_BIN)/python $(COMMON_DIR)/python_utils/run_query.py "CREATE SCHEMA IF NOT EXISTS $(DB_SCHEMA);"
$(MAKE) upload-sql
$(MAKE) create-udfs
$(MAKE) extra-deploy

extra-deploy::

upload-sql:
echo "- Installing create functions"
Expand Down
3 changes: 3 additions & 0 deletions clouds/postgres/modules/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ deploy: check venv3 build
echo "Deploying modules..."
$(VENV3_BIN)/python $(COMMON_DIR)/run_query.py "CREATE SCHEMA IF NOT EXISTS $(PG_SCHEMA);"
$(VENV3_BIN)/python $(COMMON_DIR)/run_script.py $(BUILD_DIR)/modules.sql
$(MAKE) extra-deploy

extra-deploy::

test: check venv3 $(NODE_MODULES_DEV)
echo "Testing modules..."
Expand Down
3 changes: 3 additions & 0 deletions clouds/redshift/modules/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ deploy: check venv3 build
echo "Deploying modules..."
$(VENV3_BIN)/python $(COMMON_DIR)/run_query.py "CREATE SCHEMA IF NOT EXISTS $(RS_SCHEMA);"
$(VENV3_BIN)/python $(COMMON_DIR)/run_script.py $(BUILD_DIR)/modules.sql
$(MAKE) extra-deploy

extra-deploy::

test: check venv3 $(NODE_MODULES_DEV)
echo "Testing modules..."
Expand Down
3 changes: 3 additions & 0 deletions clouds/snowflake/modules/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ deploy: check build
echo "Deploying modules..."
$(COMMON_DIR)/run-query.js "CREATE SCHEMA IF NOT EXISTS $(SF_SCHEMA);"
$(COMMON_DIR)/run-script.js $(BUILD_DIR)/modules.sql
$(MAKE) extra-deploy

extra-deploy::

deploy-share: check build-share
echo "Deploying share..."
Expand Down

0 comments on commit 4d5de7c

Please sign in to comment.