Skip to content

Create a RunningAzureFunctions class to handle multiple function tasks in one workspace#4320

Merged
nturinski merged 10 commits intomainfrom
nat/runningFunctionMapArray
Nov 11, 2024
Merged

Create a RunningAzureFunctions class to handle multiple function tasks in one workspace#4320
nturinski merged 10 commits intomainfrom
nat/runningFunctionMapArray

Conversation

@nturinski
Copy link
Copy Markdown
Member

@nturinski nturinski commented Nov 8, 2024

Previously, there was a limitation of only being able to run one task per workspace. This would make it impossible to run and manage multiple tasks in subfolders which was blocking a scenario for the C# Dev Kit team.

These changes make the workspace folder a key to the map, but we are storing it in an array. The array contains the cwd of the subpath for the project. This will allow us to run multiple projects in different folders simultaneously which should hopefully get us one step closer to monorepo support.

@nturinski nturinski requested a review from a team as a code owner November 8, 2024 01:23
Comment thread src/funcCoreTools/funcHostTask.ts Outdated

const workspaceFolder = buildPathToWorkspaceFolderMap.get(debugSession.configuration.launchServiceData.buildPath)
if (workspaceFolder === undefined) {
throw Error()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: I wasn't sure if throwing here is correct.

Maybe a vscode.window.showWarningMessage('Unable to find workspaceFolder for debugConfiguration.buildPath"); + however its localized

Comment thread src/commands/pickFuncProcess.ts Outdated

const funcTask = new vscode.Task({ type: `func ${buildPath}` },
workspaceFolder,
hostStartTaskName, `func`,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: place on next line since its another argument

Comment thread src/commands/startFunctionApp.ts Outdated


const client: SiteClient = await node.site.createClient(context);
await startFuncProcessFromApi(`${workspace.workspaceFolders![0].uri.path}/bin/Debug/net8.0`, [], {});
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, will do. Was from testing 😅

workspaceFolder = {
uri: vscode.Uri.parse(buildPath),
name: buildPath,
index: -1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm also not sure if the consequences of using index: -1 if VS Code actually looks at this 😓

MicroFish91
MicroFish91 previously approved these changes Nov 8, 2024
Copy link
Copy Markdown
Contributor

@MicroFish91 MicroFish91 left a comment

Choose a reason for hiding this comment

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

Approving for now so as not to block. Ping if you need review again later

@nturinski nturinski changed the title Nat/running function map array Create a RunningAzureFunctions class to handle multiple function tasks in one workspace Nov 11, 2024
@nturinski nturinski merged commit c2cb7a4 into main Nov 11, 2024
@nturinski nturinski deleted the nat/runningFunctionMapArray branch November 11, 2024 17:50
@microsoft microsoft locked and limited conversation to collaborators Dec 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants