dbt-coverage icon indicating copy to clipboard operation
dbt-coverage copied to clipboard

Does it work with dbt cloud?

Open abdel-87 opened this issue 3 years ago • 8 comments

Hi,

does this package work with dbt cloud?

abdel-87 avatar Jul 05 '22 17:07 abdel-87

Hi @abdel-87,

We are not aware of anyone trying this within the dbt cloud but if you do, please let us know how it went!

mrshu avatar Jul 05 '22 19:07 mrshu

Hi, i was evaluating to use dbt-coverage in our ci/cd pipeline (with dbt cloud) and it's possible without too much pain. In fact the only constraints bring by dbt-coverage current implementation is to have manifest.jsonand catalog.json located under targetdirectory. Those files which are "run artifacts" that can be retrieved using dbt cloud api using the following endpoint : https://cloud.getdbt.com/api/v2/accounts/{accountId}/runs/{runId}/artifacts/{path}. The only requirement is to first make call to run a job which perform a dbt doc generate and grab the runId.

Suggestion

One idea that can give more flexibility to any dbt cloud user and avoid him to create a useless target directory in its ci/cd pipeline would be to add an optional parameter to the cli run_artifacts_path and use it in load_manifest and load_catalog. In case it's unset, use the default behavior of the current implementation

Is there any contribution guide, or can I propose an implementation ?

Fszta avatar Jul 13 '22 13:07 Fszta

@Fszta feel free to put together a PR -- I am pretty sure we (with @sweco) would be happy to take a look!

mrshu avatar Jul 29 '22 14:07 mrshu

@Fszta here is to hoping it's gotten much easier to run dbt-coverage with DBT Cloud for you 🙂

In fact, if you'd be up for it, I believe it would make sense to add a quick section on how to set it up in the README -- feel free to send a PR and I'd be very happy to merge it in!

mrshu avatar Nov 17 '22 17:11 mrshu

HI @Fszta!

We also have a high interest in how to integrate this into our current pipeline (with dbt cloud). Would it be possible to share your implementation experience?

Thanks!

WeihaoLiTW avatar Jul 26 '23 03:07 WeihaoLiTW

We also have a high interest in how to integrate this into our current pipeline (with dbt cloud).

Same here, would love some pointers for this! We tried developing a Github workflow action but not sure how to go about comparing artifacts from the last master branch merge with the artifacts from the slim CI run.

raphaelvarieras avatar Jul 29 '23 14:07 raphaelvarieras

not sure how to go about comparing artifacts from the last master branch merge with the artifacts from the slim CI run

@raphaelvarieras the way we went around it was to save the artifacts from the master branch merge to some long-term storage (such as S3) and then do the comparison against that. I am not sure if something like that would be an option in your case but this sort of a setup works pretty well for us.

mrshu avatar Aug 09 '23 10:08 mrshu

That might work! Would you mind sharing more details of how you implemented, by any chance?

raphaelvarieras avatar Aug 09 '23 12:08 raphaelvarieras