You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(job): use real SAO API value state_aware_orchestration; stop posting cost_optimization_features
The previous bridge used the invented value "node_selection" for
cost_optimization_features and serialized that field to the dbt Cloud API.
Two real bugs fell out of this:
1. "node_selection" is not in CostOptimizationFeature in dbt-cloud
(sinter/common/constants/jobs.py). The valid value is
"state_aware_orchestration". On Fusion-capable accounts the API
rejects the create with 405 "node_selection are not valid features."
On non-Fusion accounts (dbt_version != "latest-fusion") the API
silently drops the field, which is why this only failed for some
reviewers but not the original author.
2. The Create/Update bridge mapped ["node_selection"] to
force_node_selection = true. That is the inverse of what SAO means:
force_node_selection = false is SAO enabled
(≡ cost_optimization_features = ["state_aware_orchestration"]).
See sinter/api/v2/views/jobs.py and sinter/mappers/job_definition.py
in dbt-cloud. Any user opting into the new attribute was getting the
opposite of the intended behavior.
This commit:
- Renames the only valid value to "state_aware_orchestration" in the
schema description, bridge, Read-derivation, acceptance tests, and
regenerated docs.
- Inverts the bridge so ["state_aware_orchestration"] →
force_node_selection = false and an empty/unset set →
force_node_selection = true.
- Marks Job.CostOptimizationFeatures as json:"-" so the provider only
POSTs force_node_selection. The dbt Cloud API derives the new-style
presentation from that bool, so we avoid double-writing contradictory
fields and avoid 405s on Fusion accounts.
- Extends the CI/Merge SAO skip from Update into Create. The API
rejects force_node_selection on CI/Merge job types; Create now
infers the effective type from explicit job_type or triggers and
drops SAO fields before calling the API.
- Removes the unreachable sliceStringToTypesSet helper that was
flagged in review.
- Skips TestAccDbtCloudJobCostOptimizationFeatures with a clear note
that it requires either account-level SAO enforcement or
dbt_version = "latest-fusion" with SAO available. The default test
account/version cannot satisfy either condition, so the test was
failing for reviewers running the suite locally.
- Restores the dbt_version description that was inadvertently shortened.
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: docs/resources/job.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -218,8 +218,8 @@ An example can be found [in this GitHub issue](https://github.com/dbt-labs/terra
218
218
### Optional
219
219
220
220
-`compare_changes_flags` (String) The model selector for checking changes in the compare changes Advanced CI feature
221
-
-`cost_optimization_features` (Set of String) List of cost optimization features to enable for this job. Replaces the deprecated `force_node_selection`. Valid values: `node_selection`.
222
-
-`dbt_version` (String) Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions
221
+
-`cost_optimization_features` (Set of String) List of cost optimization features enabled for this job. Replaces the deprecated `force_node_selection`. Valid values: `state_aware_orchestration`. When `state_aware_orchestration` is included, SAO is enabled (equivalent to `force_node_selection = false`); when empty or unset, SAO is disabled (equivalent to `force_node_selection = true`). Requires `dbt_version = "latest-fusion"` and an account with State-Aware Orchestration available.
222
+
-`dbt_version` (String) Version number of dbt to use in this job. It needs to be in the format `major.minor.0-latest` (e.g. `1.5.0-latest`), `major.minor.0-pre`, `compatible`, `extended`, `versionless`, `latest` or `latest-fusion`. While `versionless` is still supported, using `latest` is recommended. If not set, the `dbt_version` configured on the environment is used.
223
223
-`deferring_environment_id` (Number) Environment identifier that this job defers to (new deferring approach)
224
224
-`deferring_job_id` (Number) Job identifier that this job defers to (legacy deferring approach)
t.Skip("Skipping: cost_optimization_features requires either account-level SAO enforcement or dbt_version=latest-fusion with SAO enabled. Run manually against a Fusion-capable account.")
Copy file name to clipboardExpand all lines: pkg/framework/objects/job/schema.go
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -466,7 +466,7 @@ func (j *jobResource) Schema(
466
466
},
467
467
"dbt_version": resource_schema.StringAttribute{
468
468
Optional: true,
469
-
Description: "Version number of dbt to use in this job, usually in the format 1.2.0-latest rather than core versions",
469
+
Description: "Version number of dbt to use in this job. It needs to be in the format `major.minor.0-latest` (e.g. `1.5.0-latest`), `major.minor.0-pre`, `compatible`, `extended`, `versionless`, `latest` or `latest-fusion`. While `versionless` is still supported, using `latest` is recommended. If not set, the `dbt_version` configured on the environment is used.",
Description: "List of cost optimization features to enable for this job. Replaces the deprecated `force_node_selection`. Valid values: `node_selection`.",
486
+
Description: "List of cost optimization features enabled for this job. Replaces the deprecated `force_node_selection`. Valid values: `state_aware_orchestration`. When `state_aware_orchestration` is included, SAO is enabled (equivalent to `force_node_selection = false`); when empty or unset, SAO is disabled (equivalent to `force_node_selection = true`). Requires `dbt_version = \"latest-fusion\"` and an account with State-Aware Orchestration available.",
0 commit comments