databricks-cli/bundle
shreyas-goenka 207777849b
Log latest error event on pipeline run fail (#239)
DAB config used to test this:

bundle.yml
```
workspace:
  host: <deco-azure-prod>

bundle:
  name: deco-538

resources:
  pipelines:
    foo:
      name: "[${bundle.name}] log pipeline errors"
      libraries:
        - notebook:
            path: ./myNb.py
      development: true
```

myNb.py
```
# Databricks notebook source
print(1/0)
```

Before:
```
2023/03/09 01:28:44 [INFO] [pipelines.foo] Update available at ***
2023/03/09 01:28:44 [INFO] [pipelines.foo] Update status: CREATED
2023/03/09 01:28:46 [INFO] [pipelines.foo] Update status: INITIALIZING
2023/03/09 01:28:52 [INFO] [pipelines.foo] Update status: FAILED
2023/03/09 01:28:52 [INFO] [pipelines.foo] Update has failed!
Error: update failed
```

Now:
```
2023/03/09 01:29:31 [INFO] [pipelines.foo] Update available at ***
2023/03/09 01:29:31 [INFO] [pipelines.foo] Update status: CREATED
2023/03/09 01:29:33 [INFO] [pipelines.foo] Update status: INITIALIZING
2023/03/09 01:29:40 [INFO] [pipelines.foo] Update status: FAILED
2023/03/09 01:29:40 [INFO] [pipelines.foo] Update has failed!
2023/03/09 01:29:40 [ERROR] [pipelines.foo] Update 27bc77 is FAILED.
trace for most recent exception:
Failed to execute python command for notebook '/Users/shreyas.goenka@databricks.com/.bundle/deco-538/default/files/myNb' with id RunnableCommandId(9070319781942164851) and error AnsiResult(---------------------------------------------------------------------------
ZeroDivisionError                         Traceback (most recent call last)
<command--1> in <cell line: 1>()
----> 1 print(1/0)

ZeroDivisionError: division by zero,Map(),Map(),List(),List(),Map())
Error: update failed
```
2023-03-16 12:23:46 +01:00
..
artifacts Mutators to define current user and default artifact path (#112) 2022-12-01 11:17:29 +01:00
config Initialize BRICKS_CLI_PATH and increase default OAuth timeout (#237) 2023-03-08 16:14:24 +01:00
deploy Execute file synchronization on deploy (#211) 2023-02-20 19:42:55 +01:00
deployer Use filer.Filer in bundle/deployer/locker (#136) 2022-12-15 17:16:07 +01:00
internal/tf Update deps for internal-only tree (#214) 2023-02-20 14:30:42 +01:00
phases Execute file synchronization on deploy (#211) 2023-02-20 19:42:55 +01:00
run Log latest error event on pipeline run fail (#239) 2023-03-16 12:23:46 +01:00
schema skip flaky cross reference test (#251) 2023-03-15 17:09:52 +01:00
tests Revert "Rename jobs -> workflows" (#118) 2022-12-01 22:39:15 +01:00
bundle.go Add function to opportunistically load a bundle (#180) 2023-01-27 16:57:39 +01:00
bundle_test.go Add function to opportunistically load a bundle (#180) 2023-01-27 16:57:39 +01:00
context.go Make sync command work in bundle context; reorder args (#207) 2023-02-20 11:33:30 +01:00
context_test.go Add command that writes the materialized bundle configuration to stdout (#95) 2022-11-21 15:39:53 +01:00
mutator.go Move mutator interface to top level bundle package (#105) 2022-11-28 10:59:43 +01:00
mutator_test.go Move mutator interface to top level bundle package (#105) 2022-11-28 10:59:43 +01:00
root.go Add function to opportunistically load a bundle (#180) 2023-01-27 16:57:39 +01:00
root_test.go Add function to opportunistically load a bundle (#180) 2023-01-27 16:57:39 +01:00