dbt-labs / terraform-provider-dbtcloud

dbt Cloud Terraform Provider
https://registry.terraform.io/providers/dbt-labs/dbtcloud
MIT License
82 stars 19 forks source link

git_clone_strategy = "github_app" not supported #105

Closed MarthaScheffler closed 1 year ago

MarthaScheffler commented 1 year ago

Hi, we are running a dbtCloud - Snowflake - GitHub - Terraform setup, and are really happy about this provider. Thanks a lot for all the work that has been put into it! We are experiencing trouble when connecting to our GitHub repo, as the git_clone_strategy = "github_app" for some reason doesn't work. Instead, the repo gets connected with git_clone_strategy = "deploy_key". Unfortunately, that means that we can't set CICD up for any of the jobs. However, if we connect the GitHub repo directly in dbtCloud, we can without any trouble setup a job with"github_webhook" : true via terraform. not sure if this is a bug that can easily be solved, but would be great to get rid of that manual step in between! I'm happy to provide more details, if needed.

PS: Same seems to hold true for the option of custom branches in resource dbt_cloud_environment: use_custom_branch = true doesn't work until set manually in dbtCloud.

ernestoongaro commented 1 year ago

@MarthaScheffler it would be helpful to get the network request that dbtCloud creates when you do this manually, for example for deploy_key you can see it here: https://documenter.getpostman.com/view/14183654/UyxohieD#24ab6246-bd09-4cc1-b096-4f4c3fdc20b0

Usually I capture these by opening Chrome console, and seeing the POST API request that the dbt Cloud client makes

MarthaScheffler commented 1 year ago

like this? @ernestoongaro

Header Request URL: https://emea.dbt.com/api/v3/accounts/_our-account-id_/projects/_our-project-id_/repositories/ Request Method: POST Status Code: 201 Remote Address: 35.157.10.87:443 Referrer Policy: strict-origin-when-cross-origin

Payload account_id: our-account-id project_id: our-project-id remote_url: "git://github.com/our-github-repo"