Skip to content

fix(config): add more logging for auto_install_required_extensions feature flag #6372

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

Merged
merged 3 commits into from
May 22, 2025
Merged
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
65 changes: 62 additions & 3 deletions packages/config/src/utils/extensions/auto-install-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,73 @@ export async function handleAutoInstallExtensions({
mode,
extensionApiBaseUrl,
}: AutoInstallOptions) {
if (!featureFlags?.auto_install_required_extensions || !accountId || !siteId || !token || !cwd || offline) {
if (!featureFlags?.auto_install_required_extensions) {
return integrations
}
const account = accounts?.find((account: any) => account.id === accountId)
if (!account) {
if (!accountId) {
console.error("Failed to auto install extension(s): Missing 'accountId'", {
accountId,
siteId,
cwd,
offline,
mode,
})
return integrations
}
if (!siteId) {
console.error("Failed to auto install extension(s): Missing 'siteId'", {
accountId,
siteId,
cwd,
offline,
mode,
})
return integrations
}
if (!token) {
console.error("Failed to auto install extension(s): Missing 'token'", {
accountId,
siteId,
cwd,
offline,
mode,
})
return integrations
}
if (!cwd) {
console.error("Failed to auto install extension(s): Missing 'cwd'", {
accountId,
siteId,
cwd,
offline,
mode,
})
return integrations
}
if (offline) {
console.error("Failed to auto install extension(s): Running as 'offline'", {
accountId,
siteId,
cwd,
offline,
mode,
})
return integrations
}

try {
const account = accounts?.find((account: any) => account.id === accountId)
if (!account) {
console.error(`Failed to auto install extension(s): Couldn't find 'account' with id '${accountId}'`, {
accountId,
siteId,
cwd,
offline,
mode,
})
return integrations
}

const packageJson = getPackageJSON(cwd)
if (
!packageJson?.dependencies ||
Expand Down
Loading