Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add config for dbt deps #1565

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@
"type": "number",
"description": "By default how much lineage should expand.",
"default": 1
},
"dbt.installDepsOnProjectInitialization": {
"type": "boolean",
"description": "Install dbt deps on project initialization",
"default": true
}
}
},
Expand Down
12 changes: 9 additions & 3 deletions src/manifest/dbtProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -523,9 +523,12 @@ export class DBTProject implements Disposable {
project: this,
inProgress: true,
});
if (!this.depsInitialized) {
const installDepsOnProjectInitialization = workspace
.getConfiguration("dbt")
.get<boolean>("installDepsOnProjectInitialization", true);
if (!this.depsInitialized && installDepsOnProjectInitialization) {
try {
await this.installDeps();
await this.installDeps(true);
} catch (error: any) {
// this is best effort
console.warn("An error occured while installing dependencies", error);
Expand Down Expand Up @@ -655,10 +658,13 @@ export class DBTProject implements Disposable {
);
}

async installDeps() {
async installDeps(silent = false) {
this.telemetry.sendTelemetryEvent("installDeps");
const installDepsCommand =
this.dbtCommandFactory.createInstallDepsCommand();
if (silent) {
installDepsCommand.focus = false;
}
return this.dbtProjectIntegration.deps(installDepsCommand);
}

Expand Down
Loading