Skip to content
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

Improved error message when 'bricks bundle run' is executed before 'bricks bundle deploy' #378

Merged
merged 2 commits into from
May 10, 2023

Conversation

andrewnester
Copy link
Contributor

Changes

Improved error message when 'bricks bundle run' is executed before 'bricks bundle deploy'

The error happens when we attempt to load terraform state when it does not exist.

The best way to check if terraform state actually exists is to call terraform show -json and that's what already happens here
main...error-before-deploy#diff-8c50f8c04e568397bc865b7e02d1f4ec5b18379d8d32daddfeb041035d804f5fL28

Absence of state.Values indicates that there is no state and likely bundle was just never deployed.

Tests

Ran bricks bundle run test_job on a new non-deployed bundle.

Output:

Error: terraform show: No state. Did you forget to run 'bricks bundle deploy'?

Running bricks bundle deploy && bricks bundle run test_job succeeds.

@andrewnester andrewnester requested review from pietern and a team May 9, 2023 12:48
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Leaving stamp to unblock merge.

bundle/deploy/terraform/load.go Outdated Show resolved Hide resolved
Copy link
Contributor

@pietern pietern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Leaving stamp to unblock merge.

Co-authored-by: Pieter Noordhuis <pieter.noordhuis@databricks.com>
@andrewnester andrewnester merged commit 473d2bf into main May 10, 2023
4 checks passed
@andrewnester andrewnester deleted the error-before-deploy branch May 10, 2023 09:02
@shreyas-goenka shreyas-goenka mentioned this pull request May 15, 2023
shreyas-goenka added a commit that referenced this pull request May 15, 2023
## Changes
## 0.0.32
* Add support for variables in bundle config. Introduces 4 ways of
setting variable values, which in decreasing order of priority are:
([#383](#383)).
	1. Command line flag. For example: `--var="foo=bar"`
	2. Environment variable. eg: BUNDLE_VAR_foo=bar
	3. Default value as defined in the applicable environments block
	4. Default value defined in variable definition
* Make the git details bundle config block optional
([#372](#372)).
* Fix api post integration tests
([#371](#371)).
* Fix table of content by removing not required top-level item
([#366](#366)).
* Fix printing the tasks in job output in DAG execution order
([#377](#377)).
* Improved error message when 'bricks bundle run' is executed before
'bricks bundle deploy'
([#378](#378)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants