Skip to content

Commit 43f5cae

Browse files
authored
#524 Job Resource is_active enforced as true on creation + docs (#562)
* Job Resource is_active enforced as true on creation + docs * changie
1 parent 53c99d4 commit 43f5cae

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Changes
2+
body: Job is_active field enforced to be true on resource creation
3+
time: 2025-11-20T15:09:29.039013+02:00

docs/resources/job.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ An example can be found [in this GitHub issue](https://github.com/dbt-labs/terra
215215
- `errors_on_lint_failure` (Boolean) Whether the CI job should fail when a lint error is found. Only used when `run_lint` is set to `true`. Defaults to `true`.
216216
- `force_node_selection` (Boolean) Whether to force node selection (SAO - Select All Optimizations) for the job. If `dbt_version` is not set to `latest-fusion`, this must be set to `true` when specified.
217217
- `generate_docs` (Boolean) Flag for whether the job should generate documentation
218-
- `is_active` (Boolean) Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the `triggers` config.
218+
- `is_active` (Boolean) Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the `triggers` config. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true.
219219
- `job_completion_trigger_condition` (Block List) Which other job should trigger this job when it finishes, and on which conditions (sometimes referred as 'job chaining'). (see [below for nested schema](#nestedblock--job_completion_trigger_condition))
220220
- `job_type` (String) Can be used to enforce the job type betwen `ci`, `merge` and `scheduled`. Without this value the job type is inferred from the triggers configured
221221
- `num_threads` (Number) Number of threads to use in the job

pkg/framework/objects/job/resource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (j *jobResource) Create(ctx context.Context, req resource.CreateRequest, re
125125
dbtVersion = &dbtVersionValue
126126
}
127127

128-
isActive := plan.IsActive.ValueBool()
128+
isActive := true // when being created, the job should be active by default
129129
triggers := map[string]any{
130130
"github_webhook": plan.Triggers.GithubWebhook.ValueBool(),
131131
"git_provider_webhook": plan.Triggers.GitProviderWebhook.ValueBool(),

pkg/framework/objects/job/schema.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ func (j *jobResource) Schema(
488488
Optional: true,
489489
Computed: true,
490490
Default: booldefault.StaticBool(true),
491-
Description: "Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the `triggers` config.",
491+
Description: "Should always be set to true as setting it to false is the same as creating a job in a deleted state. To create/keep a job in a 'deactivated' state, check the `triggers` config. Setting it to false essentially deletes the job. On resource creation, this field is enforced to be true.",
492492
},
493493
"triggers": resource_schema.SingleNestedAttribute{
494494
Required: true,

0 commit comments

Comments
 (0)