Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLI flag to toggle warnings as errors #1243

Closed
kingfink opened this issue Jan 16, 2019 · 2 comments
Closed

Add CLI flag to toggle warnings as errors #1243

kingfink opened this issue Jan 16, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@kingfink
Copy link
Contributor

Feature

Feature description

We're running dbt compile as part of our CI process. Unfortunately when we get WARNINGs (i.e. schema test can't find the model), they are ignored. Users should be able to add a CLI flag to count warnings as errors (i.e. -werror here)

To get around this today, we run a bash script that contains:

#!/bin/sh

n=`grep 'WARNING' /app/dbt/logs/dbt.log | wc -l`

if [ $n -gt 0 ]
then
    echo $n compile warnings
    exit 1
fi

Who will this benefit?

This would benefit anyone who wants to run checks as part of their dbt CI process. Helps ensure tests in production are being run.

@clausherther
Copy link
Contributor

clausherther commented Jan 21, 2019

This would also be great to have exposed in dbt Cloud, so jobs don't "fail" silently when there's nothing to do. This is sometimes the case after well-meant reorg efforts that change model locations and leave -m model filters grabbing empties.

We recently moved a lot of models into a new/better folder structure. However, one of our dbt Cloud job that runs only a subset of the models via the -m folder syntax wasn't updated. As a result the job was running and completing successfully, without actually running any models. Since there is no failure and this was not the main data pipeline, we didn't notice for a few days.

It'd be great if the dbt Cloud job could be configured to either ignore warning or fail on warnings or otherwise had a way to configure failure levels.

@drewbanin
Copy link
Contributor

drewbanin commented Jan 21, 2019

@clausherther yeah, i picture this being a CLI flag (just like -werror as shown above). This would make the behavior consistent across local development, dbt cloud, or any other deployments of dbt.

I think we'll need to do some find/replace to make sure we catch all of the warnings, but I don't think this will be too gnarly a change to make

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants