Skip to content

Commit d7010ff

Browse files
authored
Move default queueing to resource_mutators (#4393)
## Changes Moving this mutator to the list of default values. The `dyn.Value` is used because `dyn.SetByPath` can't create intermediate nodes, so we create the whole object as the default ## Why For visual authoring, we need special handling for these CLI-based defaults so keeping then in one place so later they can be imported in config-remote-sync code ## Tests Existing tests capture outbound requests with `queue: { enabled: true }` <!-- If your PR needs to be included in the release notes for next release, add a separate entry in NEXT_CHANGELOG.md as part of your PR. -->
1 parent 078e184 commit d7010ff

File tree

3 files changed

+6
-143
lines changed

3 files changed

+6
-143
lines changed

bundle/config/mutator/resourcemutator/default_queueing.go

Lines changed: 0 additions & 35 deletions
This file was deleted.

bundle/config/mutator/resourcemutator/default_queueing_test.go

Lines changed: 0 additions & 103 deletions
This file was deleted.

bundle/config/mutator/resourcemutator/resource_mutator.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ func applyInitializeMutators(ctx context.Context, b *bundle.Bundle) {
6666
{"resources.jobs.*.trigger.pause_status", "UNPAUSED"},
6767
{"resources.jobs.*.continuous.pause_status", "UNPAUSED"},
6868

69+
// Enable queueing for jobs by default, following the behavior from API 2.2+.
70+
// As of 2024-04, we're still using API 2.1 which has queueing disabled by default.
71+
{"resources.jobs.*.queue", map[string]dyn.Value{
72+
"enabled": dyn.V(true),
73+
}},
74+
6975
// This is converted from single-task to multi-task
7076
{"resources.jobs.*.task[*].dbt_task.schema", "default"},
7177
{"resources.jobs.*.task[*].for_each_task.task.dbt_task.schema", "default"},
@@ -104,11 +110,6 @@ func applyInitializeMutators(ctx context.Context, b *bundle.Bundle) {
104110
}
105111

106112
bundle.ApplySeqContext(ctx, b,
107-
// Reads (typed): b.Config.Resources.Jobs (checks job configurations)
108-
// Updates (typed): b.Config.Resources.Jobs[].Queue (sets Queue.Enabled to true for jobs without queue settings)
109-
// Enable queueing for jobs by default, following the behavior from API 2.2+.
110-
DefaultQueueing(),
111-
112113
// Reads (typed): b.Config.Resources.Dashboards (checks dashboard configurations)
113114
// Updates (typed): b.Config.Resources.Dashboards[].ParentPath (ensures /Workspace prefix is present)
114115
// Ensures dashboard parent paths have the required /Workspace prefix

0 commit comments

Comments
 (0)