-
Notifications
You must be signed in to change notification settings - Fork 20
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
Fixes to initialisation UI #1160
Conversation
} | ||
}); | ||
} else if (e instanceof Error) { | ||
if (e instanceof Error) { |
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.
With allSettled
we are swallowing normal errors right now, we should re-throw them in setTarget/setAuthProvider methods.
But I'm not sure why should we move error handling over there? Seems easier to just have Promise.all
and catch everything here. Plus we need to add error handling to ConnectionCommands.selectTarget
too.
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.
Removed all settled. I split setting target/auth provider and doing state refresh into 2 separate steps. Now, auth provider and target will still be updated in all models, even if there are some errors. Then, errors are propagated normally from refresh.
@@ -105,6 +105,10 @@ export class ClusterComponent extends BaseComponent { | |||
new ThemeColor("notificationsErrorIcon.foreground") | |||
), | |||
id: TREE_ICON_ID, | |||
command: { |
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.
Let's remove the command from the package.json->view/item/context
then?
const label = "Login to Databricks"; | ||
const host = await this.configModel.get("host"); | ||
if (host === undefined) { | ||
return []; |
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 the bundle doesn't have a host defined we show a "failed to initialize target" notification right now, and then end up in a broken state when you can't really switch target anymore or even trigger the error again.
At least here it would make sense to show a message about the absent host and prompt users to open and update the dabs config
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.
Fixed this state as well. Now we show a message saying "host is misconfigured". And once user fixes it, changes are picked up and processed automatically.
@@ -214,12 +215,32 @@ export class ConfigModel implements Disposable { | |||
// We want to wait for all the configs to be loaded before we emit any change events from the | |||
// configStateCache. | |||
await this.readStateMutex.synchronise(async () => { | |||
await Promise.all([ | |||
await Promise.allSettled([ |
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.
Is it intentional that we never fail here anymore and always proceed to the setAuthProvider
? setAuthProvider
doesn't fail too with allSettled
, so we are swallowing non-ProcessError errors now, breaking some of the higher-level error handling (in the ConnectionManager and ConnectionCommands)
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.
Yes. The idea is to not block login based on errors here, and also actually run all the promises parallely. I agree that we should show error messages for other errors as well.
Right now, when any of the models fail to refresh, we completely logout, and user has to log back in. With this change, the user can make changes and fixes to their bundle, which will automatically refresh the models and these fixes will then propagate back to the UI
this.bundleValidateModel.setTarget(target); | ||
this.overrideableConfigModel.setTarget(target); | ||
this.bundleRemoteStateModel.setTarget(target); | ||
this.onDidChangeTargetEmitter.fire(); |
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 wonder if we now have a race condition because you emit the target change before refreshing the models? During the refresh the connection manager tries to login with saved auth and might use stale values from the configModel (since its refresh is tied to the refreshes of other models, which might not happen in time)
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.
Should we emit the target change at the very end of the method?
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.
Made it emit at the end.
## packages/databricks-vscode ## (2024-04-03) * Add currently selected python environment to path for wheel builds (#1159) ([2128013](2128013)), closes [#1159](#1159) * Add extension name to the private preview terms and conditions popup (#1144) ([5370f04](5370f04)), closes [#1144](#1144) * Bump databricks cli to v0.216.0 (#1166) ([fdd0a17](fdd0a17)), closes [#1166](#1166) * Fixes to initialisation UI (#1160) ([77267f4](77267f4)), closes [#1160](#1160) * Ignore stderr for validate and summary commands (#1151) ([3780ec4](3780ec4)), closes [#1151](#1151) * Rename some things (#1146) ([450b002](450b002)), closes [#1146](#1146) * Use packaged CLI if a cli path is not specified in .databrickscfg profile (#1150) ([2cff68e](2cff68e)), closes [#1150](#1150) ## packages/databricks-vscode-types ## (2024-04-03) --------- Co-authored-by: releasebot <noreply@github.com> Co-authored-by: Kartik Gupta <88345179+kartikgupta-db@users.noreply.github.com> Co-authored-by: kartikgupta-db <kartik.gupta@databricks.com>
Changes
Welcome view changes
Login Changes
Tests