Skip to content

Commit a644c6a

Browse files
authored
Exporter: detect & handle deleted workspace objects (notebooks/files/directories) when running in incremental mode (#3225)
* Started work on handling of deleted workspace objects * Generating IDs... * Working versions of deletes, renames doesn't work yet... * Naive implementation of renames detection * Add tests * Explain how it works in the doc * Added a note about renaming * Address the code reviews
1 parent 37c6c29 commit a644c6a

File tree

7 files changed

+314
-61
lines changed

7 files changed

+314
-61
lines changed

docs/guides/experimental-exporter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ All arguments are optional, and they tune what code is being generated.
4646
* `-includeUserDomains` - optionally include domain name into generated resource name for `databricks_user` resource.
4747
* `-importAllUsers` - optionally include all users and service principals even if they are only part of the `users` group.
4848
* `-exportDeletedUsersAssets` - optionally include assets of deleted users and service principals.
49-
* `-incremental` - experimental option for incremental export of modified resources and merging with existing resources. *Please note that only a limited set of resources (notebooks, SQL queries/dashboards/alerts, ...) provides information about the last modified date - all other resources will be re-exported again! Also, it's impossible to detect the deletion of the resources, so you must do periodic full export if resources are deleted!* **Requires** `-updated-since` option if no `exporter-run-stats.json` file exists in the output directory.
49+
* `-incremental` - experimental option for incremental export of modified resources and merging with existing resources. *Please note that only a limited set of resources (notebooks, SQL queries/dashboards/alerts, ...) provides information about the last modified date - all other resources will be re-exported again! Also, it's impossible to detect the deletion of many resource types (i.e. clusters, jobs, ...), so you must do periodic full export if resources are deleted! For Workspace objects (notebooks, workspace files and directories) exporter tries to detect deleted objects and remove them from generated code (requires presence of `ws_objects.json` file that is written on each export that pulls all workspace objects). For workspace objects renames are handled as deletion of existing/creation of new resource!* **Requires** `-updated-since` option if no `exporter-run-stats.json` file exists in the output directory.
5050
* `-updated-since` - timestamp (in ISO8601 format supported by Go language) for exporting of resources modified since a given timestamp. I.e., `2023-07-24T00:00:00Z`. If not specified, the exporter will try to load the last run timestamp from the `exporter-run-stats.json` file generated during the export and use it.
5151
* `-notebooksFormat` - optional format for exporting of notebooks. Supported values are `SOURCE` (default), `DBC`, `JUPYTER`. This option could be used to export notebooks with embedded dashboards.
5252
* `-noformat` - optionally turn off the execution of `terraform fmt` on the exported files (enabled by default).

0 commit comments

Comments
 (0)