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): preserve SAO field values on CI/Merge jobs to match plan
CI on PR #670 caught a plan/apply consistency failure in
TestAccDbtCloudJobCIWithCostOptimizationFeatures:
.cost_optimization_features: planned set element
cty.StringVal("state_aware_orchestration") does not correlate
with any element in actual.
The previous commit correctly skipped the SAO fields at the API
boundary for CI/Merge job types (to avoid the 405), but then still
overwrote plan.CostOptimizationFeatures from the API response. The
API doesn't store the field for those job types, so it derives back
to empty — but the user's plan still says ["state_aware_orchestration"],
which the framework flags as inconsistent.
Fix: for CI/Merge jobs, preserve whatever the user planned for
force_node_selection and cost_optimization_features rather than
deriving from the API response. The user's value is benign (we
never POST it for those job types) and keeps plan==apply consistent.
For all other job types the API response is still authoritative.
Apply the same logic in Read so that subsequent plans don't show
perpetual drift, with a fallback to empty/null on fresh imports so
ImportStateVerify still round-trips cleanly.
Verified locally with TF_ACC=1 against the dbt Cloud test account:
- TestAccDbtCloudJobCIWithCostOptimizationFeatures: PASS
- TestAccDbtCloudJobCIWithDeferringEnvironment: PASS
- TestAccDbtCloudJobMergeWithDeferringEnvironment: PASS
- TestAccDbtCloudJobCostOptimizationFeatures: SKIP (as designed)
- TestAccDbtCloudJobResource, JobCISettings, JobResourceIntervalCron,
JobResourceJobTypeAndCompareChanges, JobResourceExecuteStepsValid: PASS
Co-authored-by: Cursor <cursoragent@cursor.com>
0 commit comments