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 Lint Capabilities to the dbtcloud_job resource #310

Open
SteveFrensch opened this issue Oct 25, 2024 · 3 comments
Open

Add Lint Capabilities to the dbtcloud_job resource #310

SteveFrensch opened this issue Oct 25, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@SteveFrensch
Copy link

Is your feature request related to a problem? Please describe.

There is a new DBT Cloud feature where sqlfluff linting that can be added to CI jobs (https://docs.getdbt.com/docs/deploy/continuous-integration#sql-linting)

They have updated the create_job API with two new boolean fields to manage this:

  "run_lint": true,
  "errors_on_lint_failure": true,

It would be great if the dbtcloud_job resource was able to mange these fields.

Describe the solution you'd like

Maybe we can add the fields to the resource like:

  run_lint: true,
  errors_on_lint_failure: true,

i.e.

resource "dbtcloud_job" "sample CI Job" {
  environment_id = dbtcloud_environment.ci_environment.environment_id
   execute_steps = [
    "dbt build --warn-error -s state:modified+ --fail-fast"
  ]
  generate_docs        = false
  name                 = "CI JOB"
  num_threads          = 32
  project_id           = dbtcloud_project.data_engineering_project.id
  run_generate_sources = false
  run_lint           = true,
  errors_on_lint_failure   =  true,
  target_name          = "prod"
   ...
}
@SteveFrensch SteveFrensch added the enhancement New feature or request label Oct 25, 2024
@SteveFrensch
Copy link
Author

Just noticed this is still in beta and not yet widely available, so may be premature for inclusion.

@SteveFrensch SteveFrensch closed this as not planned Won't fix, can't repro, duplicate, stale Oct 25, 2024
@b-per
Copy link
Collaborator

b-per commented Oct 25, 2024

I can do some testing. If I can add it to TF without breaking it for users who don't have access to the Beta, I might still be able to do it.

@b-per b-per reopened this Dec 16, 2024
@b-per
Copy link
Collaborator

b-per commented Dec 16, 2024

Notes for the implementation.

We should be adding 2 fields to the dbtcloud_jobs resource:

  • run_lint (bool)
  • errors_on_lint_failure (bool)

And both should be defaulting to false

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

2 participants