-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not execute build on bundle destroy #1882
Conversation
Thanks! Can you double check there is no impact on this: Lines 94 to 97 in 26afab2
Since it writes out a TF config (necessary or not?), it is possible that artifact variable references are not resolved. |
@pietern I brought back resolving artifacts variables just in case for backward comatibility |
phases.Build(), | ||
mutator.ResolveVariableReferences( | ||
"artifacts", | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if this is necessary. I was asking because there may be a subtle dependency we're missing, and I was wondering if you did the analysis on this. If it is necessary, then please include a comment to capture the nuance, otherwise we can skip this altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to skip this since terraform destroy
depends entirely on the id
stored in the state (IIRC). The configuration we write to bundle.tf.json
should be irrelevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If artifact variable is used in some resource, let's say in job name, the destroy will fail with the following error if variables not resolved
my_job:
name: My Job at ${artifacts.test.path}
ndrew.nester@HFW9Y94129 wheel % databricks bundle destroy -p u2m
Error: exit status 1
Error: Reference to undeclared resource
on bundle.tf.json line 45, in resource.databricks_job.my_job:
45: "name": "My Job ${artifacts.test.path}",
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true only if we write bundle.tf.json
with all resources prior to destroying.
I suspect we can write an empty bundle.tf.json
(with only the provider definition) and sidestep the issue.
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
Test Details: go/deco-tests/11691811235 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the comment inline. The interpolation can be removed if other changes are made to the definition of destroy and how we write the TF configuration.
Can be done in a later PR.
phases.Build(), | ||
mutator.ResolveVariableReferences( | ||
"artifacts", | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true only if we write bundle.tf.json
with all resources prior to destroying.
I suspect we can write an empty bundle.tf.json
(with only the provider definition) and sidestep the issue.
Bundles: * Do not execute build on bundle destroy ([#1882](#1882)). * Add support for non-Python ipynb notebooks to DABs ([#1827](#1827)). API Changes: * Added `databricks credentials` command group. * Changed `databricks genie execute-message-query` command to type `databricks genie execute-message-query` command. * Changed `databricks lakeview create` command with new required argument order. * Added `databricks aibi-dashboard-embedding-access-policy` command group. * Added `databricks aibi-dashboard-embedding-approved-domains` command group. * Removed `databricks clean-rooms` command group. OpenAPI commit d25296d2f4aa7bd6195c816fdf82e0f960f775da (2024-11-07) Dependency updates: * Upgrade TF provider to 1.58.0 ([#1900](#1900)). * Bump golang.org/x/sync from 0.8.0 to 0.9.0 ([#1892](#1892)). * Bump golang.org/x/text from 0.19.0 to 0.20.0 ([#1893](#1893)). * Bump golang.org/x/mod from 0.21.0 to 0.22.0 ([#1895](#1895)). * Bump golang.org/x/oauth2 from 0.23.0 to 0.24.0 ([#1894](#1894)). * Bump github.com/databricks/databricks-sdk-go from 0.49.0 to 0.51.0 ([#1878](#1878)).
Bundles: * Do not execute build on bundle destroy ([#1882](#1882)). * Add support for non-Python ipynb notebooks to DABs ([#1827](#1827)). API Changes: * Added `databricks credentials` command group. * Changed `databricks lakeview create` command with new required argument order. OpenAPI commit d25296d2f4aa7bd6195c816fdf82e0f960f775da (2024-11-07) Dependency updates: * Upgrade TF provider to 1.58.0 ([#1900](#1900)). * Bump golang.org/x/sync from 0.8.0 to 0.9.0 ([#1892](#1892)). * Bump golang.org/x/text from 0.19.0 to 0.20.0 ([#1893](#1893)). * Bump golang.org/x/mod from 0.21.0 to 0.22.0 ([#1895](#1895)). * Bump golang.org/x/oauth2 from 0.23.0 to 0.24.0 ([#1894](#1894)). * Bump github.com/databricks/databricks-sdk-go from 0.49.0 to 0.51.0 ([#1878](#1878)).
Changes
There's no value in building artifacts on destroy because they are just removed from workspace as part of destroy.