Skip to content

Commit 4405617

Browse files
authored
Pass product version to JS SDK (#491)
1 parent 949c5cb commit 4405617

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

packages/databricks-vscode/src/configuration/AzureCliCheck.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
import {ExecUtils, WorkspaceClient} from "@databricks/databricks-sdk";
1+
import {
2+
ExecUtils,
3+
ProductVersion,
4+
WorkspaceClient,
5+
} from "@databricks/databricks-sdk";
26
import {NamedLogger} from "@databricks/databricks-sdk/dist/logging";
37
import {commands, Disposable, Uri, window} from "vscode";
48
import {Loggers} from "../logger";
59
import {AzureCliAuthProvider} from "./auth/AuthProvider";
610

11+
// eslint-disable-next-line @typescript-eslint/no-var-requires
12+
const extensionVersion = require("../../package.json")
13+
.version as ProductVersion;
14+
715
export type Step<S, N> = () => Promise<
816
SuccessResult<S> | NextResult<N> | ErrorResult
917
>;
@@ -214,11 +222,17 @@ export class AzureCliCheck implements Disposable {
214222
canLogin: boolean;
215223
error?: Error;
216224
}> {
217-
const workspaceClient = new WorkspaceClient({
218-
host: host.toString(),
219-
authType: "azure-cli",
220-
azureLoginAppId: this.azureLoginAppId,
221-
});
225+
const workspaceClient = new WorkspaceClient(
226+
{
227+
host: host.toString(),
228+
authType: "azure-cli",
229+
azureLoginAppId: this.azureLoginAppId,
230+
},
231+
{
232+
product: "databricks-vscode",
233+
productVersion: extensionVersion,
234+
}
235+
);
222236
try {
223237
await workspaceClient.currentUser.me();
224238
} catch (e: any) {

0 commit comments

Comments
 (0)