dbt-labs / dbt-rpc

A server that can compile and run queries in the context of a dbt project. Additionally, it provides methods that can be used to list and terminate running processes.
https://docs.getdbt.com/reference/commands/rpc
Apache License 2.0
19 stars 7 forks source link

[Bug] --fail-fast not supported in RPC server #65

Closed joellabes closed 2 years ago

joellabes commented 2 years ago

Is there an existing feature request for this?

Describe the Feature

--fail-fast cancels a dbt run if any model has an issue. This flag should also be supported for dbt test (I thought it already was, and told a community member to use this).

It's as relevant for a failing test in a CI environment to cancel a run.

Describe alternatives you've considered

I don't think there is an alternative right now

Who will this benefit?

CI users who want a failing test to cancel the rest of the run

Are you interested in contributing this feature?

Yeah go on!

Anything else?

jtcohen6 commented 2 years ago

@joellabes This is a sly one, and I believe it boils down to: The dbt-rpc server doesn't support --fail-fast.

Within dbt Core, not counting the RPC server, the --fail-fast, -x flag/setting is indeed supported for dbt test and dbt build as well as dbt run. Starting in v1, "fail fast" has even been upgraded to a "global config," meaning it can be set for all commands as:

But I'm realizing that --fail-fast has never really been supported for dbt-rpc. That means that it's not currently supported in the dbt Cloud IDE, which is at issue in the linked slack thread.

For the time being, I'm going to transfer this issue to the dbt-rpc repo, mostly to document this as a known limitation. I think it's unlikely we invest the resources to fixing it there, however. The good news is, I believe the new dbt Server will be architected in a way that it will be able to support --fail-fast for all tasks.

joellabes commented 2 years ago

Thanks @jtcohen6! I'll open an equivalent docs issue to get that info onto build and test as well

github-actions[bot] commented 2 years ago

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days.