Skip to content

Commit

Permalink
Merge branch 'main' into fix-pip-wsfs
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikgupta-db authored Aug 2, 2023
2 parents 581b678 + bfea2ec commit d1e5048
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 10 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ yarn install

If you find an issue/bug or have a feature request, please file an issue here: https://github.com/databricks/databricks-vscode/issues/new

Also please send the logs as per these instructions https://docs.databricks.com/dev-tools/vscode-ext.html#send-usage-logs-to-databricks to us at
vscode-private-preview _at_ databricks _dot_ com (remove_the_spaces)
Also please append the logs as per these instructions https://docs.databricks.com/dev-tools/vscode-ext.html#send-usage-logs-to-databricks.
5 changes: 3 additions & 2 deletions packages/databricks-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "LicenseRef-LICENSE",
"version": "1.1.0",
"engines": {
"vscode": "^1.76.0"
"vscode": "^1.78.0"
},
"categories": [
"Data Science",
Expand Down Expand Up @@ -643,7 +643,8 @@
]
},
"extensionDependencies": [
"ms-python.python"
"ms-python.python",
"ms-toolsai.jupyter"
],
"vsce": {
"dependencies": false,
Expand Down
23 changes: 21 additions & 2 deletions packages/databricks-vscode/src/configuration/auth/AzureCliCheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ export class AzureCliCheck implements Disposable {
type: "next",
next: "loginAzureCli",
};
} else if (result.expired) {
return {
type: "next",
next: "loginAzureCli",
};
} else if (result.aud) {
this.azureLoginAppId = result.aud;
return {
Expand Down Expand Up @@ -164,6 +169,7 @@ export class AzureCliCheck implements Disposable {
iss?: string;
aud?: string;
canLogin: boolean;
expired: boolean;
error?: Error;
}> {
const workspaceClient = new WorkspaceClient(
Expand All @@ -188,6 +194,18 @@ export class AzureCliCheck implements Disposable {
return {
iss: m[1],
canLogin: false,
expired: false,
};
}

m = e.message.match(
/(Interactive authentication is needed). Please run:\naz login( --scope ([a-z0-9-]+?)\/\.default)?\n/s
);
if (m) {
return {
canLogin: false,
error: new Error(m[1]),
expired: true,
};
}

Expand All @@ -198,12 +216,13 @@ export class AzureCliCheck implements Disposable {
return {
aud: m[1],
canLogin: false,
expired: false,
};
}

return {canLogin: false, error: e};
return {canLogin: false, error: e, expired: false};
}
return {canLogin: true};
return {canLogin: true, expired: false};
}

// check if Azure CLI is installed
Expand Down
8 changes: 6 additions & 2 deletions packages/databricks-vscode/src/test/e2e/wdio.conf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,17 @@ export const config: Options.Testrunner = {
for (let i = 0; i < 2; i++) {
try {
await new Promise((resolve, reject) => {
const extensionDependencies =
packageJson.extensionDependencies.flatMap((item) => [
"--install-extension",
item,
]);
execFile(
cli,
[
"--extensions-dir",
EXTENSION_DIR,
"--install-extension",
"ms-python.python",
...extensionDependencies,
"--install-extension",
VSIX_PATH,
"--force",
Expand Down
6 changes: 4 additions & 2 deletions packages/databricks-vscode/src/utils/urlUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function normalizeHost(host: string): URL {
}
if (
!url.hostname.match(
/(\.databricks\.azure\.us|\.databricks\.azure\.cn|\.azuredatabricks\.net|\.gcp\.databricks\.com|\.cloud\.databricks\.com)$/
/(\.databricks\.azure\.us|\.databricks\.azure\.cn|\.azuredatabricks\.net|\.gcp\.databricks\.com|\.cloud\.databricks\.com|\.dev\.databricks\.com)$/
)
) {
throw new Error("Not a Databricks host");
Expand All @@ -43,5 +43,7 @@ export function isGcpHost(url: URL): boolean {
}

export function isAwsHost(url: URL): boolean {
return !!url.hostname.match(/\.cloud\.databricks\.com$/);
return !!url.hostname.match(
/(\.cloud\.databricks\.com|\.dev\.databricks\.com)$/
);
}

0 comments on commit d1e5048

Please sign in to comment.