Uh oh!
There was an error while loading. Please reload this page.
Improve workspace import command by allowing references to local files for content - #793
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| // Give better errors / hints for common API errors. | ||
| func wrapImportAPIErrors(err error, importReq *workspace.Import) error { | ||
| apiErr := &apierr.APIError{} | ||
| if !errors.As(err, &apiErr) { |
There was a problem hiding this comment.
It seems like in the end it checks that the error type is **apierr.APIError instead of apierr.APIError or *apierr.APIError, is it expected?
There was a problem hiding this comment.
Yes. This checks that the error type is *apierr.APIErr. The errors.As method requires a pointer to a type that implements error (ie the Error() method)
In the Go SDK this is done by *apierr.API hence the double pointer being passed. see: https://github.com/databricks/databricks-sdk-go/blob/410c4b0a4cd0c38e97d8e5e3de7ddc2785fd9d12/apierr/errors.go#L65
Uh oh!
There was an error while loading. Please reload this page.
CLI: * Improve `workspace import` command by allowing references to local files for content ([#793](#793)). * Add `--file` flag to workspace export command ([#794](#794)). * Ensure profile flag is respected for sync command ([#837](#837)). * Add hint to delete sync snapshot if parsing fails ([#853](#853)). * Use profile information when getting a token using the CLI ([#855](#855)). Bundles: * Minor template tweaks ([#832](#832)). * Fixed using repo files as pipeline libraries ([#847](#847)). * Support .gitignore syntax in sync section and make sure it works recursively ([#854](#854)). * Allow target overrides for sync section ([#856](#856)). Internal: * Fix import export integration tests on windows ([#842](#842)). * Fix workspace import test ([#844](#844)). * Automatically create a release PR in homebrew-tap repo ([#841](#841)). Dependency updates: * Bump golang.org/x/term from 0.12.0 to 0.13.0 ([#852](#852)). * Bump golang.org/x/mod from 0.12.0 to 0.13.0 ([#851](#851)). * Bump golang.org/x/sync from 0.3.0 to 0.4.0 ([#849](#849)). * Bump golang.org/x/oauth2 from 0.12.0 to 0.13.0 ([#850](#850)).
CLI: * Improve `workspace import` command by allowing references to local files for content ([#793](#793)). * Add `--file` flag to workspace export command ([#794](#794)). * Ensure profile flag is respected for sync command ([#837](#837)). * Add hint to delete sync snapshot if parsing fails ([#853](#853)). * Use profile information when getting a token using the CLI ([#855](#855)). Bundles: * Minor template tweaks ([#832](#832)). * Fixed using repo files as pipeline libraries ([#847](#847)). * Support .gitignore syntax in sync section and make sure it works recursively ([#854](#854)). * Allow target overrides for sync section ([#856](#856)). Internal: * Fix import export integration tests on windows ([#842](#842)). * Fix workspace import test ([#844](#844)). * Automatically create a release PR in homebrew-tap repo ([#841](#841)). Dependency updates: * Bump golang.org/x/term from 0.12.0 to 0.13.0 ([#852](#852)). * Bump golang.org/x/mod from 0.12.0 to 0.13.0 ([#851](#851)). * Bump golang.org/x/sync from 0.3.0 to 0.4.0 ([#849](#849)). * Bump golang.org/x/oauth2 from 0.12.0 to 0.13.0 ([#850](#850)).
…les for content (#793) ## Changes This PR makes a few really important QOL improvements to the `workspace import` command. They are: 1. Adds the `--file` flag, which allows a user to specify a file to read the content from. 2. Wraps the most common error first time users of this command will run into with a helpful hint. 3. Minor changes to the command Use string changing `PATH` -> `TARGET_PATH` ## Tests Integration tests. The newly added integration tests that check the --file flag works as expected for both `SOURCE` and `AUTO` format. Skipped the other formats because the API behaviour for them is straightforward.
CLI: * Improve `workspace import` command by allowing references to local files for content ([#793](#793)). * Add `--file` flag to workspace export command ([#794](#794)). * Ensure profile flag is respected for sync command ([#837](#837)). * Add hint to delete sync snapshot if parsing fails ([#853](#853)). * Use profile information when getting a token using the CLI ([#855](#855)). Bundles: * Minor template tweaks ([#832](#832)). * Fixed using repo files as pipeline libraries ([#847](#847)). * Support .gitignore syntax in sync section and make sure it works recursively ([#854](#854)). * Allow target overrides for sync section ([#856](#856)). Internal: * Fix import export integration tests on windows ([#842](#842)). * Fix workspace import test ([#844](#844)). * Automatically create a release PR in homebrew-tap repo ([#841](#841)). Dependency updates: * Bump golang.org/x/term from 0.12.0 to 0.13.0 ([#852](#852)). * Bump golang.org/x/mod from 0.12.0 to 0.13.0 ([#851](#851)). * Bump golang.org/x/sync from 0.3.0 to 0.4.0 ([#849](#849)). * Bump golang.org/x/oauth2 from 0.12.0 to 0.13.0 ([#850](#850)).
…les for content (#793) ## Changes This PR makes a few really important QOL improvements to the `workspace import` command. They are: 1. Adds the `--file` flag, which allows a user to specify a file to read the content from. 2. Wraps the most common error first time users of this command will run into with a helpful hint. 3. Minor changes to the command Use string changing `PATH` -> `TARGET_PATH` ## Tests Integration tests. The newly added integration tests that check the --file flag works as expected for both `SOURCE` and `AUTO` format. Skipped the other formats because the API behaviour for them is straightforward.
CLI: * Improve `workspace import` command by allowing references to local files for content ([#793](#793)). * Add `--file` flag to workspace export command ([#794](#794)). * Ensure profile flag is respected for sync command ([#837](#837)). * Add hint to delete sync snapshot if parsing fails ([#853](#853)). * Use profile information when getting a token using the CLI ([#855](#855)). Bundles: * Minor template tweaks ([#832](#832)). * Fixed using repo files as pipeline libraries ([#847](#847)). * Support .gitignore syntax in sync section and make sure it works recursively ([#854](#854)). * Allow target overrides for sync section ([#856](#856)). Internal: * Fix import export integration tests on windows ([#842](#842)). * Fix workspace import test ([#844](#844)). * Automatically create a release PR in homebrew-tap repo ([#841](#841)). Dependency updates: * Bump golang.org/x/term from 0.12.0 to 0.13.0 ([#852](#852)). * Bump golang.org/x/mod from 0.12.0 to 0.13.0 ([#851](#851)). * Bump golang.org/x/sync from 0.3.0 to 0.4.0 ([#849](#849)). * Bump golang.org/x/oauth2 from 0.12.0 to 0.13.0 ([#850](#850)).
Changes
This PR makes a few really important QOL improvements to the
workspace importcommand.They are:
--fileflag, which allows a user to specify a file to read the content from.PATH->TARGET_PATHTests
Integration tests. The newly added integration tests that check the --file flag works as expected for both
SOURCEandAUTOformat.Skipped the other formats because the API behaviour for them is straightforward.