Skip to content
Open
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
15 changes: 13 additions & 2 deletions apps/vs-code-designer/src/app/utils/__test__/binaries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ describe('binaries', () => {
vscode.window.showErrorMessage = showErrorMessage;

const result = await getLatestDotNetVersion(context, majorVersion);
expect(result).toBe(DependencyVersion.dotnet6);
expect(result).toBe(DependencyVersion.dotnet8);
expect(showErrorMessage).toHaveBeenCalled();
});

it('should return fallback dotnet version when no major version is sent', async () => {
const result = await getLatestDotNetVersion(context);

expect(result).toBe(DependencyVersion.dotnet6);
expect(result).toBe(DependencyVersion.dotnet8);
});
});

Expand Down Expand Up @@ -245,6 +245,17 @@ describe('binaries', () => {
expect(showErrorMessage).toHaveBeenCalled();
});

it('should return fallback nodejs version when requested version is not found in the list', async () => {
const response = [{ tag_name: 'v20.0.0' }, { tag_name: 'v18.0.0' }, { tag_name: 'v16.0.0' }];
(axios.get as any).mockResolvedValue({ data: response, status: 200 });

const result = await getLatestNodeJsVersion(context, '99');

expect(result).toBe(DependencyVersion.nodeJs);
expect(context.telemetry.properties.latestNodeJSVersion).toBe('fallback-no-match');
expect(context.telemetry.properties.errorLatestNodeJsVersion).toBe('No matching Node JS version found.');
});

it('should return fallback nodejs version when no major version is sent', async () => {
const result = await getLatestNodeJsVersion(context);
expect(result).toBe(DependencyVersion.nodeJs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ export async function activateAzurite(context: IActionContext, projectPath?: str
const isAzuriteRunning = await validateEmulatorIsRunning(context, projectPath, false);

if (autoStartAzurite && !isAzuriteRunning) {
await updateWorkspaceSetting(azuriteLocationSetting, azuriteLocationExtSetting, projectPath, azuriteExtensionPrefix);
// Use the configured location, or default to the global default path
const azuriteLocation = azuriteLocationExtSetting || defaultAzuritePathValue;
await updateWorkspaceSetting(azuriteLocationSetting, azuriteLocation, projectPath, azuriteExtensionPrefix);
await executeOnAzurite(context, extensionCommand.azureAzuriteStart);
context.telemetry.properties.azuriteStart = 'true';
context.telemetry.properties.azuriteLocation = azuriteLocationExtSetting;
context.telemetry.properties.azuriteLocation = azuriteLocation;
}
}
}
Expand Down
9 changes: 6 additions & 3 deletions apps/vs-code-designer/src/app/utils/binaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function downloadAndExtractDependency(

// Extract to targetFolder
if (dependencyName === dotnetDependencyName) {
const version = dotNetVersion ?? semver.major(DependencyVersion.dotnet6);
const version = dotNetVersion ?? semver.major(DependencyVersion.dotnet8);
if (process.platform === Platform.windows) {
await executeCommand(
ext.outputChannel,
Expand Down Expand Up @@ -216,12 +216,12 @@ export async function getLatestDotNetVersion(context: IActionContext, majorVersi
.catch((error) => {
context.telemetry.properties.latestVersionSource = 'fallback';
context.telemetry.properties.errorNewestDotNetVersion = `Error getting latest .NET SDK version: ${error}`;
return DependencyVersion.dotnet6;
return DependencyVersion.dotnet8;
});
}

context.telemetry.properties.latestVersionSource = 'fallback';
return DependencyVersion.dotnet6;
return DependencyVersion.dotnet8;
}

export async function getLatestNodeJsVersion(context: IActionContext, majorVersion?: string): Promise<string> {
Expand All @@ -238,6 +238,9 @@ export async function getLatestNodeJsVersion(context: IActionContext, majorVersi
return releaseVersion;
}
}
context.telemetry.properties.latestNodeJSVersion = 'fallback-no-match';
context.telemetry.properties.errorLatestNodeJsVersion = 'No matching Node JS version found.';
return DependencyVersion.nodeJs;
Comment on lines +241 to +243
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new fallback path when no matching Node.js version is found (lines 241-243) is not covered by unit tests. The existing test at line 237 only covers the API failure case (catch block), but doesn't test the scenario where the API succeeds but returns releases that don't match the requested major version. Consider adding a test case that mocks a successful API response with releases that don't match the major version to verify this new fallback behavior works correctly.

Copilot uses AI. Check for mistakes.
})
.catch((error) => {
context.telemetry.properties.latestNodeJSVersion = 'fallback';
Expand Down
6 changes: 3 additions & 3 deletions apps/vs-code-designer/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const azureWebJobsStorageKey = 'AzureWebJobsStorage';
export const functionsInprocNet8Enabled = 'FUNCTIONS_INPROC_NET8_ENABLED';
export const functionsInprocNet8EnabledTrue = '1';
export const azureWebJobsSecretStorageTypeKey = 'AzureWebJobsSecretStorageType';
export const workflowappRuntime = 'node|18';
export const workflowappRuntime = 'node|20';
export const viewOutput = localize('viewOutput', 'View Output');
export const webhookRedirectHostUri = 'Workflows.WebhookRedirectHostUri';
export const workflowAppAADClientId = 'WORKFLOWAPP_AAD_CLIENTID';
Expand Down Expand Up @@ -311,9 +311,9 @@ export const defaultDataMapperVersion = 2;

// Fallback Dependency Versions
export const DependencyVersion = {
dotnet6: '6.0.413',
dotnet8: '8.0.318',
funcCoreTools: '4.0.7030',
nodeJs: '18.17.1',
nodeJs: '20.18.3',
} as const;
export type DependencyVersion = (typeof DependencyVersion)[keyof typeof DependencyVersion];

Expand Down
2 changes: 1 addition & 1 deletion e2e/testSetup/BlankLogicApp/logicAppStandard.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ resource appService 'Microsoft.Web/sites@2020-06-01' = {
}
{
name: 'WEBSITE_NODE_DEFAULT_VERSION'
value: '~18'
value: '~20'
}
{
name: 'AzureWebJobsStorage'
Expand Down
Loading