Skip to content

Commit

Permalink
Reduce time until the prompt is shown for bundle run (#1727)
Browse files Browse the repository at this point in the history
## Summary

Makes the `databricks bundle run` command use local state before showing
the menu prompt, which makes it show more quickly. For large/busy
workspaces this means the prompt can show 2-3 seconds earlier.
  • Loading branch information
lennartkats-db committed Sep 21, 2024
1 parent cf989a7 commit 6c57683
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions cmd/bundle/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ task or a Python wheel task, the second example applies.
return diags.Error()
}

diags = bundle.Apply(ctx, b, bundle.Seq(
phases.Initialize(),
terraform.Interpolate(),
terraform.Write(),
terraform.StatePull(),
terraform.Load(terraform.ErrorOnEmptyState),
))
diags = bundle.Apply(ctx, b, phases.Initialize())
if err := diags.Error(); err != nil {
return err
}
Expand All @@ -84,6 +78,16 @@ task or a Python wheel task, the second example applies.
return fmt.Errorf("expected a KEY of the resource to run")
}

diags = bundle.Apply(ctx, b, bundle.Seq(
terraform.Interpolate(),
terraform.Write(),
terraform.StatePull(),
terraform.Load(terraform.ErrorOnEmptyState),
))
if err := diags.Error(); err != nil {
return err
}

runner, err := run.Find(b, args[0])
if err != nil {
return err
Expand Down

0 comments on commit 6c57683

Please sign in to comment.