Skip to content

Commit

Permalink
fix(vscode): Update functions extension bundle to workflows (#4986)
Browse files Browse the repository at this point in the history
* Update functions extension bundle to workflows

* Update aka url
  • Loading branch information
ccastrotrejo committed Jun 15, 2024
1 parent 2dd176e commit d942192
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { debugSymbolDll } from '../../../constants';
import { debugSymbolDll, extensionBundleId } from '../../../constants';
import { ext } from '../../../extensionVariables';
import { localize } from '../../../localize';
import { getFunctionsCommand } from '../../utils/funcCoreTools/funcVersion';
Expand All @@ -12,7 +12,7 @@ import * as path from 'path';

export async function getDebugSymbolDll(): Promise<string> {
const bundleFolderRoot = await getExtensionBundleFolder();
const bundleFolder = path.join(bundleFolderRoot, 'Microsoft.Azure.Functions.ExtensionBundle.Workflows');
const bundleFolder = path.join(bundleFolderRoot, extensionBundleId);
let bundleVersionNumber = '0.0.0';

const bundleFolders = await fse.readdir(bundleFolder);
Expand Down
18 changes: 6 additions & 12 deletions apps/vs-code-designer/src/app/utils/bundleFeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import {
defaultVersionRange,
defaultBundleId,
localSettingsFileName,
defaultExtensionBundlePathValue,
extensionBundleId,
} from '../../constants';
import { defaultVersionRange, extensionBundleId, localSettingsFileName, defaultExtensionBundlePathValue } from '../../constants';
import { getLocalSettingsJson } from './appSettings/localSettings';
import { downloadAndExtractDependency } from './binaries';
import { getJsonFeed } from './feed';
Expand All @@ -26,13 +20,13 @@ import * as vscode from 'vscode';
* @returns {Promise<IBundleFeed>} Returns bundle extension object.
*/
async function getBundleFeed(context: IActionContext, bundleMetadata: IBundleMetadata | undefined): Promise<IBundleFeed> {
const bundleId: string = (bundleMetadata && bundleMetadata.id) || defaultBundleId;
const bundleId: string = (bundleMetadata && bundleMetadata.id) || extensionBundleId;

const envVarUri: string | undefined = process.env.FUNCTIONS_EXTENSIONBUNDLE_SOURCE_URI;
// Only use an aka.ms link for the most common case, otherwise we will dynamically construct the url
let url: string;
if (!envVarUri && bundleId === defaultBundleId) {
url = 'https://aka.ms/AA66i2x';
if (!envVarUri && bundleId === extensionBundleId) {
url = 'https://aka.ms/AAqvc78';
} else {
const baseUrl: string = envVarUri || 'https://functionscdn.azureedge.net/public';
url = `${baseUrl}/ExtensionBundles/${bundleId}/index-v2.json`;
Expand Down Expand Up @@ -65,7 +59,7 @@ async function getBundleDependencyFeed(
context: IActionContext,
bundleMetadata: IBundleMetadata | undefined
): Promise<IBundleDependencyFeed> {
const bundleId: string = (bundleMetadata && bundleMetadata?.id) || defaultBundleId;
const bundleId: string = (bundleMetadata && bundleMetadata?.id) || extensionBundleId;
const projectPath: string | undefined = vscode.workspace.workspaceFolders ? vscode.workspace.workspaceFolders[0].uri.fsPath : null;
let envVarUri: string | undefined = process.env.FUNCTIONS_EXTENSIONBUNDLE_SOURCE_URI;
if (projectPath) {
Expand Down Expand Up @@ -112,7 +106,7 @@ export async function addDefaultBundle(context: IActionContext, hostJson: IHostJ
}

hostJson.extensionBundle = {
id: defaultBundleId,
id: extensionBundleId,
version: versionRange,
};
}
Expand Down
1 change: 0 additions & 1 deletion apps/vs-code-designer/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ export const ProjectDirectoryPath = 'ProjectDirectoryPath';
export const extensionVersionKey = 'FUNCTIONS_EXTENSION_VERSION';
export const azureStorageTypeSetting = 'Files';
// Project
export const defaultBundleId = 'Microsoft.Azure.Functions.ExtensionBundle';
export const defaultVersionRange = '[1.*, 2.0.0)'; // Might need to be changed
export const funcWatchProblemMatcher = '$func-watch';
export const extInstallCommand = 'extensions install';
Expand Down

0 comments on commit d942192

Please sign in to comment.