Skip to content

chore: add VS Code Azure Functions debug setup for gofuncapp - #9315

Open
Fernadoteixeira wants to merge 6 commits into
Azure:mainfrom
Fernadoteixeira:fernadoteixeira-scaling-bassoon
Open

chore: add VS Code Azure Functions debug setup for gofuncapp#9315
Fernadoteixeira wants to merge 6 commits into
Azure:mainfrom
Fernadoteixeira:fernadoteixeira-scaling-bassoon

Conversation

@Fernadoteixeira

@Fernadoteixeira Fernadoteixeira commented Jul 27, 2026

Copy link
Copy Markdown

Why

Contributors working on the cli/azd/test/functional/testdata/samples/gofuncapp fixture need a reproducible VS Code setup to debug the Go Azure Functions host locally with the sample's fixture layout.

What changed

  • Preserved existing workspace recommendations and appended Azure Functions and Go extensions.
  • Added a Go Functions attach debug profile that uses remote mode and the standard Delve port.
  • Added Azure Functions workspace settings targeting the gofuncapp sample path with cross-platform path separators.
  • Added VS Code tasks to prepare go.mod/go.sum from fixture .txt files and start the Functions host.
  • Added .funcignore in the sample to ignore .venv during packaging.

Notes for reviewers

This is scoped to contributor tooling for local debugging of the Go fixture sample. It does not change azd runtime behavior.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 27, 2026 18:24
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
7 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@Fernadoteixeira
Fernadoteixeira marked this pull request as draft July 27, 2026 18:24
@Fernadoteixeira
Fernadoteixeira marked this pull request as ready for review July 27, 2026 18:24
@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported identify a customer issue label Jul 27, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution @Fernadoteixeira! We will review the pull request and get back to you soon.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
7 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds VS Code tooling for locally debugging the gofuncapp Azure Functions sample.

Changes:

  • Adds Functions/Python debug settings and tasks.
  • Adds relevant extension recommendations.
  • Excludes .venv from packaging.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.vscode/extensions.json Updates recommended extensions.
.vscode/launch.json Adds a Functions attach profile.
.vscode/settings.json Configures the Functions workspace.
.vscode/tasks.json Adds host and dependency tasks.
cli/azd/test/functional/testdata/samples/gofuncapp/.funcignore Excludes .venv.
Comments suppressed due to low confidence (2)

.vscode/tasks.json:29

  • azd-code-reviewer: This second working directory has the same cross-platform separator problem. On macOS and Linux the pip task cannot resolve this path; use forward slashes here as well.
				"cwd": "${workspaceFolder}/cli\\azd\\test\\functional\\testdata\\samples\\gofuncapp"

.vscode/settings.json:12

  • azd-code-reviewer: The configured project is declared as language: go in its azure.yaml and contains Go source, but this setting tells the Functions extension to treat it as Python. Align the Functions language/model settings with the Go worker, or point the entire setup at the Python funcapp sample instead.
  "azureFunctions.projectLanguage": "Python",

Comment thread .vscode/extensions.json Outdated
Comment thread .vscode/tasks.json Outdated
Comment thread .vscode/tasks.json Outdated
Comment thread .vscode/settings.json Outdated
Comment thread .vscode/launch.json Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 27, 2026 22:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

.vscode/tasks.json:11

  • [azd-code-reviewer] This directory is not directly runnable by Core Tools: the fixture intentionally stores its module as go.mod.txt/go.sum.txt, and the functional test renames them only after copying the sample (up_test.go:256-258). func host start runs go build . in this cwd, so this pre-launch task cannot build the worker from a clean checkout. Add a preparation step that creates usable module files (or debug a prepared copy) before starting the host.
				"cwd": "${workspaceFolder}/cli/azd/test/functional/testdata/samples/gofuncapp"

Comment thread .vscode/tasks.json Outdated
Comment thread .vscode/launch.json Outdated
Comment thread .vscode/extensions.json
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 27, 2026 22:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

.vscode/tasks.json:14

  • azd-code-reviewer: Copying the module files into this source fixture leaves a nested go.mod in the repository. cli_test.go:830 embeds testdata/samples/*, and up_test.go:256 deliberately keeps these files as .txt to avoid that module boundary; after one debug session, functional tests/builds can fail until contributors manually remove the generated files. Prepare a disposable copy outside the embedded fixture (and point both tasks/settings at it), rather than mutating the fixture in place.
				"command": "[ -f go.mod ] || cp go.mod.txt go.mod; [ -f go.sum ] || cp go.sum.txt go.sum"
			},
			"linux": {
				"command": "[ -f go.mod ] || cp go.mod.txt go.mod; [ -f go.sum ] || cp go.sum.txt go.sum"

.vscode/tasks.json:24

  • azd-code-reviewer: The sample has no local.settings.json, and this task does not set a worker runtime. Current Core Tools therefore enters its worker-runtime selection prompt instead of starting the host, so the background pre-launch task is not reproducible and may wait indefinitely for input. Supply the native Go runtime in the task environment (or create an equivalent ignored local settings file during preparation).
			"command": "host start",

Comment thread .vscode/tasks.json Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 27, 2026 23:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread .vscode/tasks.json
Comment thread .vscode/settings.json Outdated
Add a cleanup task that removes go.mod/go.sum from the gofuncapp fixture
after each debug session to prevent functional test build failures.
Wire it as postDebugTask in the Go Functions attach profile.
Remove deploy-only settings (deploySubpath, scmDoBuildDuringDeployment)
and unrelated chat setting from workspace settings.json.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 27, 2026 23:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

.vscode/tasks.json:36

  • azd-code-reviewer: The prepare task preserves an existing go.mod/go.sum, but this cleanup task unconditionally deletes both files. Stopping the debugger can therefore delete contributor-created or customized module files that predated the session on every OS. Record which files the prepare task created (for example with marker files) and delete only those during cleanup.
			"label": "cleanup gofuncapp debug",
			"type": "shell",
			"windows": {
				"command": "cmd.exe /c \"if exist go.mod del go.mod & if exist go.sum del go.sum\""

Adds .vscode/cspell.yaml that imports the existing cspell.global.yaml,
enabling the VS Code cspell extension to discover the workspace
spell-check configuration automatically.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 28, 2026 00:05
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

@Fernadoteixeira please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"
Contributor License Agreement

Contribution License Agreement

This Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
and conveys certain license rights to Microsoft Corporation and its affiliates (“Microsoft”) for Your
contributions to Microsoft open source projects. This Agreement is effective as of the latest signature
date below.

  1. Definitions.
    “Code” means the computer software code, whether in human-readable or machine-executable form,
    that is delivered by You to Microsoft under this Agreement.
    “Project” means any of the projects owned or managed by Microsoft and offered under a license
    approved by the Open Source Initiative (www.opensource.org).
    “Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any
    Project, including but not limited to communication on electronic mailing lists, source code control
    systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of
    discussing and improving that Project, but excluding communication that is conspicuously marked or
    otherwise designated in writing by You as “Not a Submission.”
    “Submission” means the Code and any other copyrightable material Submitted by You, including any
    associated comments and documentation.
  2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any
    Project. This Agreement covers any and all Submissions that You, now or in the future (except as
    described in Section 4 below), Submit to any Project.
  3. Originality of Work. You represent that each of Your Submissions is entirely Your original work.
    Should You wish to Submit materials that are not Your original work, You may Submit them separately
    to the Project if You (a) retain all copyright and license information that was in the materials as You
    received them, (b) in the description accompanying Your Submission, include the phrase “Submission
    containing materials of a third party:” followed by the names of the third party and any licenses or other
    restrictions of which You are aware, and (c) follow any other instructions in the Project’s written
    guidelines concerning Submissions.
  4. Your Employer. References to “employer” in this Agreement include Your employer or anyone else
    for whom You are acting in making Your Submission, e.g. as a contractor, vendor, or agent. If Your
    Submission is made in the course of Your work for an employer or Your employer has intellectual
    property rights in Your Submission by contract or applicable law, You must secure permission from Your
    employer to make the Submission before signing this Agreement. In that case, the term “You” in this
    Agreement will refer to You and the employer collectively. If You change employers in the future and
    desire to Submit additional Submissions for the new employer, then You agree to sign a new Agreement
    and secure permission from the new employer before Submitting those Submissions.
  5. Licenses.
  • Copyright License. You grant Microsoft, and those who receive the Submission directly or
    indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license in the
    Submission to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute
    the Submission and such derivative works, and to sublicense any or all of the foregoing rights to third
    parties.
  • Patent License. You grant Microsoft, and those who receive the Submission directly or
    indirectly from Microsoft, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license under
    Your patent claims that are necessarily infringed by the Submission or the combination of the
    Submission with the Project to which it was Submitted to make, have made, use, offer to sell, sell and
    import or otherwise dispose of the Submission alone or with the Project.
  • Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement.
    No additional licenses or rights whatsoever (including, without limitation, any implied licenses) are
    granted by implication, exhaustion, estoppel or otherwise.
  1. Representations and Warranties. You represent that You are legally entitled to grant the above
    licenses. You represent that each of Your Submissions is entirely Your original work (except as You may
    have disclosed under Section 3). You represent that You have secured permission from Your employer to
    make the Submission in cases where Your Submission is made in the course of Your work for Your
    employer or Your employer has intellectual property rights in Your Submission by contract or applicable
    law. If You are signing this Agreement on behalf of Your employer, You represent and warrant that You
    have the necessary authority to bind the listed employer to the obligations contained in this Agreement.
    You are not expected to provide support for Your Submission, unless You choose to do so. UNLESS
    REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, AND EXCEPT FOR THE WARRANTIES
    EXPRESSLY STATED IN SECTIONS 3, 4, AND 6, THE SUBMISSION PROVIDED UNDER THIS AGREEMENT IS
    PROVIDED WITHOUT WARRANTY OF ANY KIND, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY OF
    NONINFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
  2. Notice to Microsoft. You agree to notify Microsoft in writing of any facts or circumstances of which
    You later become aware that would make Your representations in this Agreement inaccurate in any
    respect.
  3. Information about Submissions. You agree that contributions to Projects and information about
    contributions may be maintained indefinitely and disclosed publicly, including Your name and other
    information that You submit with Your Submission.
  4. Governing Law/Jurisdiction. This Agreement is governed by the laws of the State of Washington, and
    the parties consent to exclusive jurisdiction and venue in the federal courts sitting in King County,
    Washington, unless no federal subject matter jurisdiction exists, in which case the parties consent to
    exclusive jurisdiction and venue in the Superior Court of King County, Washington. The parties waive all
    defenses of lack of personal jurisdiction and forum non-conveniens.
  5. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and
    supersedes any and all prior agreements, understandings or communications, written or oral, between
    the parties relating to the subject matter hereof. This Agreement may be assigned by Microsoft.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread .vscode/launch.json
"host": "127.0.0.1",
"port": 2345,
"preLaunchTask": "func: host start",
"postDebugTask": "cleanup gofuncapp debug"
Comment thread .vscode/tasks.json
}
},
{
"label": "cleanup gofuncapp debug",

@jongio jongio left a comment

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.

Ran this against a local checkout. Most of the earlier feedback looks addressed. A few things still open:

The Windows prepare and cleanup commands don't do what they read as. In cmd.exe both && and & get absorbed into the if body, so the second guard only runs when the first guard's branch is taken. I reproduced both failure modes locally.

.vscode/cspell.yaml does fill in the dangling cSpell.import that settings.json already had, but it imports cspell.global.yaml while CI lints root files with cspell.misc.yaml. That splits the editor from CI on files like SECURITY.md.

Two of the new settings.json entries change behavior for everyone working in this repo, not just people debugging this fixture.

On the overall shape: root .vscode/ is shared by every contributor and every subproject in the repo. Pinning it to one functional-test fixture path means anyone with the Functions extension installed gets azure-dev treated as a Go Functions project rooted at test data. Would a .vscode/ folder inside the gofuncapp sample, or a short section in CONTRIBUTING.md, get you the same workflow without the workspace-wide side effects?

Comment thread .vscode/tasks.json
"label": "prepare gofuncapp debug",
"type": "shell",
"windows": {
"command": "cmd.exe /c \"if not exist go.mod copy /Y go.mod.txt go.mod >nul && if not exist go.sum copy /Y go.sum.txt go.sum >nul\""

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.

cmd.exe folds && into the if body, so this parses as if not exist go.mod ( copy ... && if not exist go.sum copy ... ). When go.mod already exists the whole line is skipped and go.sum never gets created, so func host start then fails on a missing checksum.

Line 36 has the same shape with &: if go.mod is already gone but go.sum is still there, go.sum never gets deleted.

I reproduced both on Windows. Wrapping each if in parens fixes the parse and keeps the current "don't clobber what I didn't create" behavior:

Suggested change
"command": "cmd.exe /c \"if not exist go.mod copy /Y go.mod.txt go.mod >nul && if not exist go.sum copy /Y go.sum.txt go.sum >nul\""
"command": "cmd.exe /c \"(if not exist go.mod copy /Y go.mod.txt go.mod >nul) & (if not exist go.sum copy /Y go.sum.txt go.sum >nul)\""

Line 36 needs the same treatment: cmd.exe /c "(if exist go.mod del go.mod) & (if exist go.sum del go.sum)".

This is separate from the ownership question already raised on line 33.

Comment thread .vscode/cspell.yaml
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

import: ./cspell.global.yaml

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.

CI lints root and docs files with cspell.misc.yaml (.github/workflows/cspell-misc.yml and magefile.go), and that config layers overrides on top of the global word list. Importing the global config directly here means the editor flags words CI accepts.

Checked locally: cspell lint SECURITY.md --config ./.vscode/cspell.yaml reports MSRC and msrc as unknown words, while --config ./.vscode/cspell.misc.yaml is clean. Same split on docs/specs/metrics-audit/audit-process.md.

Suggested change
import: ./cspell.global.yaml
import: ./cspell.misc.yaml

Comment thread .vscode/settings.json
],
"aspire.enableSettingsFileCreationPromptOnStartup": false
"aspire.enableSettingsFileCreationPromptOnStartup": false,
"azureFunctions.projectSubpath": "cli/azd/test/functional/testdata/samples/gofuncapp",

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.

These three are committed workspace settings, so every contributor with the Functions extension installed gets azure-dev treated as a single Go Functions project rooted at a test fixture. The repo also has samples/funcapp, so picking gofuncapp here is arbitrary for anyone not working on this specific sample.

Could these move into a .vscode/ folder inside the gofuncapp sample? That keeps the config next to the thing it configures and off everyone else's workspace.

Comment thread .vscode/settings.json
"azureFunctions.projectSubpath": "cli/azd/test/functional/testdata/samples/gofuncapp",
"azureFunctions.projectLanguage": "Go",
"azureFunctions.projectRuntime": "~4",
"debug.internalConsoleOptions": "neverOpen"

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.

This applies to every debug session in the repo, including the existing "Debug azd cli" config, so anyone debugging azd stops getting the debug console. internalConsoleOptions is valid as a per-configuration attribute, so it can live on the new Go Functions entry in launch.json instead of here.

Comment thread .vscode/launch.json
"configurations": [
// If you set `AZD_DEBUG=true` in your environment, `azd` will pause early in start up and allow you to attach
// to it. Use the Attach to Process configuration and pick the corresponding `azd` process.
{

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.

This drops the comment that explained AZD_DEBUG=true, which is how you get azd to pause at startup so "Attach to Process" has something to attach to. That isn't discoverable from the config itself. The comment above "Debug azd cli" was removed too. Can both go back? They're unrelated to the Functions work.

@@ -0,0 +1 @@
.venv No newline at end of file

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.

.venv is a Python virtualenv directory and this is a Go sample, so it won't match anything here.

azd uses .funcignore as the packaging ignore file for function apps (cli/azd/pkg/project/service_target.go:144), so this is an edit to a functional-test fixture rather than contributor tooling, which sits awkwardly with "does not change azd runtime behavior" in the description. Is it needed at all? None of the other samples ship one.

Comment thread .vscode/extensions.json
"golang.go"
]
}
} No newline at end of file

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.

This drops the trailing newline on a file that otherwise had one. tasks.json and the new .funcignore don't have one either. Worth adding back so the diff stays to the intended change.

@jongio jongio left a comment

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.

Went back with Core Tools installed to check whether this debug flow actually runs end to end. It doesn't get as far as attaching, and the fixture cleanup has a gap that can leave cli/azd/test/functional in a state where it won't compile. Both inline.

My earlier notes on the Windows cmd.exe quoting, the cspell import target, and the workspace-wide settings still apply, so I won't repeat them here.

Comment thread .vscode/tasks.json
{
"type": "func",
"label": "func: host start",
"command": "host start",

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 installed Core Tools 4.5.0 and ran func host start against a copy of this fixture with go.mod/go.sum copied in exactly the way the prepare task does. It never starts the host, it stops on an interactive prompt:

Use the up/down arrow keys to select a worker runtime:
1. dotnet (isolated worker model)
2. dotnet (in-process model)
3. Node
4. Python
5. Powershell
6. Custom

Two things behind that. The fixture has no local.settings.json, so FUNCTIONS_WORKER_RUNTIME is unset and Core Tools falls back to asking. And there's no Go entry in that list. Go runs through Custom, which needs a customHandler block in host.json with a defaultExecutablePath plus a build step to produce the binary, and gofuncapp/host.json only carries version and extensionBundle.

As a preLaunchTask with isBackground: true that prompt never gets answered, so the task hangs, Delve never listens on 2345, and "Attach to Go Functions" has nothing to attach to.

Did this launch for you locally? If it did, knowing your Core Tools version would help, because it doesn't on 4.5.0. Otherwise this needs a local.settings.json with the worker runtime plus host.json and build wiring for the Go worker before the profile can do anything.

Comment thread .vscode/tasks.json
"command": "host start",
"problemMatcher": "$func-golang-watch",
"isBackground": true,
"dependsOn": "prepare gofuncapp debug",

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.

dependsOn means this task creates go.mod in the fixture, but cleanup only runs as postDebugTask on the launch config. Anything that runs this task without a debug session leaves the file behind: picking "func: host start" from Run Task, the Functions extension starting the host on its own, or terminating the task instead of stopping the debugger.

That matters more than it looks. With go.mod present:

$ go vet ./test/functional/
test\functional\cli_test.go:830:12: pattern all:testdata/samples/*: cannot embed directory testdata/samples/gofuncapp: in different module

The whole functional test package stops compiling until someone deletes it by hand, which is what the .txt suffix at up_test.go:256 exists to prevent. A leftover go.sum is harmless on its own, I checked that separately, it's go.mod that breaks the build.

cli/azd/test/functional/testdata/samples/.gitignore only carries .azure/ today, so these also show up as untracked files and can get committed by accident. Listing go.mod and go.sum there would cap the blast radius however the task gets invoked. Copying the sample to a temp dir and debugging from there would avoid the problem outright.

@jongio jongio left a comment

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.

Re-checked against d00ac9e. No new commits since my last pass, so the open items still stand. Two things I dug into that add to them.

The prepare and cleanup tasks aren't symmetric in when they run, and combined with the host start problem that isn't a corner case. Details inline.

On moving this next to the sample instead of the repo root: cli/azd/test/functional/testdata/samples/funcapp/.vscode/extensions.json already exists, so per-sample .vscode is an established pattern here rather than something new I'm asking you to invent.

Also relevant to who this is for: gofuncapp isn't referenced anywhere in the repo. copySample is called with funcapp at up_test.go:170, but never with gofuncapp, and a case-insensitive search for the name across the tree turns up nothing outside this PR. The fixture came in with #8599. So today the audience is whoever is hand-testing Go Functions support, which argues for keeping the config out of every contributor's workspace.

One thing to not chase: the bicep-lint failure is a module restore problem (BCP190) in cli/azd/internal/scaffold/testdata, unrelated to your changes.

Comment thread .vscode/launch.json
"host": "127.0.0.1",
"port": 2345,
"preLaunchTask": "func: host start",
"postDebugTask": "cleanup gofuncapp debug"

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.

postDebugTask only fires when a debug session ends, and preLaunchTask gates whether that session ever starts. func: host start carries dependsOn: prepare gofuncapp debug, so the order on a normal F5 is: write go.mod and go.sum into the fixture, start the host, then attach.

On the Core Tools version I tested, the second step never completes, it sits on the worker runtime prompt. No session means no postDebugTask, so the first F5 leaves go.mod behind and go vet ./test/functional/ stops compiling until someone deletes it by hand.

That makes this more than the startup-failure path already raised on this line. It's the path you get by following the config exactly as written. Cleanup hung off the debug lifecycle can't cover setup that happens before the session exists.

Copying the sample into a temp directory and pointing cwd there would leave the fixture untouched no matter where the flow stops.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

customer-reported identify a customer issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants