Skip to content

Fix Java, PowerShell, and Go workload setup - #5801

Merged
sarah (satvu) merged 2 commits into
vnextfrom
satvu-setup-workload-investigation
Oct 29, 2026
Merged

sarah (satvu) merged 2 commits into
vnextfrom
satvu-setup-workload-investigation

Conversation

@satvu

@satvu sarah (satvu) commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Issue describing the changes in this PR

Resolves #5777 for Java, PowerShell, and Go.

func setup previously installed the Java/PowerShell worker and extension bundle without planning the corresponding stack workload. For Go projects configured with FUNCTIONS_WORKER_RUNTIME=native, setup requested an unpublished native worker instead of the Go stack and worker. Setup could report success, including under --check, while func run could not recognize the project.

Pull request checklist

Additional information

User-visible behavior changes

  • Java and PowerShell setup includes their stack workloads, whether selected explicitly with --features or inferred from the project's configured runtime.
  • Both stacks appear in the interactive picker, feature help, setup hints, and local debug-workload feature mappings.
  • When inferring project defaults, setup maps native to the canonical go feature before planning the Go stack/worker and applying profile supported-runtime and worker-version constraints. Matching is case-insensitive and trims whitespace. Explicit --features go remains unchanged.
  • The Go mapping is setup-only: project configuration and the runtime sent to the Functions host remain native.
  • --check fails for missing required stack workloads and for missing Go worker versions available in the catalog; complete installations pass without installing anything.
  • Template workloads remain limited to stacks that publish them. General optional-worker/catalog policies are unchanged.

The setup hint catalog reuses the planner's supported-stack list instead of maintaining a duplicate allowlist. Regression coverage includes explicit/configured selection, local-settings runtime projection, installation dependencies, missing/installed/unpublished stack checks, JSON results, interactive choices, feature hints, native-to-Go normalization, supported/unsupported Go profiles, and Go worker-version constraints. The former Java test for unmapped stacks now uses custom to preserve that existing behavior.

Validation on the combined branch

  • dotnet build test\Func.Tests\Func.Tests.csproj -c Release --no-restore -p:CI=true --verbosity quiet — passed, 0 warnings and 0 errors.
  • dotnet test test\Func.Tests\Func.Tests.csproj -c Release --no-build --no-restore --filter "FullyQualifiedName~Commands.Setup|FullyQualifiedName~FunctionsProjectResolverTests|FullyQualifiedName~LocalSettingsConfigurationProviderTests|FullyQualifiedName~BundleHintBuilderTests|FullyQualifiedName~WorkloadInstallCommandTests" --verbosity quiet — passed, 340 tests.
  • PowerShell AST syntax and Java/PowerShell feature-map checks — passed; each feature maps to four existing workload projects.
  • git diff --check — passed.

Before the Java/PowerShell product fix, dotnet test test\Func.Tests\Func.Tests.csproj --no-restore --filter "FullyQualifiedName~JavaOrPowerShell" --verbosity quiet failed all 20 new regression cases as expected.

Go validation before integration

The Go subagent ran these checks on original commit 306da522, cherry-picked here as 5e9a2b7d:

  • dotnet test .\test\Workloads\Stacks\Go.Tests\Workloads.Go.Tests.csproj --no-restore -c Release --verbosity minimal -p:TreatWarningsAsErrors=true — passed, 38 tests, including assertions that the resolved host worker runtime remains native.
  • Real Windows x64 end-to-end testing against a temporary localhost NuGet v3 feed and fresh CLI/workload homes — passed. For a Go project configured only through local.settings.json with FUNCTIONS_WORKER_RUNTIME=native and no .func/config, setup --yes --install-policy if-needed --check first exited 1 naming all four missing dependencies. Actual setup installed host, Go worker, Go stack, and extension bundle and exited 0; a repeated check exited 0.
  • func start performed real go mod tidy/build, launched managed Azurite, resolved worker runtime native, and served GET and POST /api/hello with HTTP 200 and Hello from Go Worker!.
  • A fresh func init <path> --stack go --name ... project also passed setup checking and startup/GET/POST; native-project init adoption passed.

Go E2E environment: Go 1.27.3, worker SDK github.com/azure/azure-functions-golang-worker v0.7.0-preview, host 4.1054.200-preview.3.dev, Go stack 1.0.0-preview.2.dev, Go worker 1.0.0-preview.1.dev, and stable extension bundle 4.35.0. The test processes and local feed were stopped afterward. This validates current source/local packages, not older shipped preview artifacts.

No live-feed Java/PowerShell installation or host execution was performed; their regression tests exercise the real setup services with substituted catalog/store/installer boundaries.

Include both language stacks in setup planning, interactive selection, and feature hints so setup checks cannot overlook missing stack workloads.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@satvu
sarah (satvu) requested a review from a team as a code owner October 28, 2026 22:27
Map configured native projects to the go setup feature before planning dependencies and profile constraints. Preserve the native runtime used by the Functions host.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@satvu sarah (satvu) changed the title Fix Java and PowerShell stack installation in func setup Fix Java, PowerShell, and Go workload setup Oct 28, 2026

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.

🟢 Approval recommended

No active review issues remain for the expanded setup workloads and Go runtime-resolution changes.

No open issues 🎉

What changed in this PR

Addresses #5777 by making func setup include the Java and PowerShell stack workloads and correctly resolve Go projects configured with the native worker runtime.

Changes:

  • Adds Java and PowerShell to setup planning, interactive choices, help, hints, and local debug-workload mappings.
  • Maps configured native runtimes to Go during setup without changing the runtime passed to the Functions host.
  • Adds regression coverage for dependency installation, --check, profile constraints, and JSON output, plus updated setup documentation.
File Description
test/​Func.Tests/​Commands/​Setup/​SetupRunnerTests.cs Covers Java, PowerShell, and Go installation and dependency checks.
test/​Func.Tests/​Commands/​Setup/​SetupFeatureCatalogTests.cs Tests Java and PowerShell package and runtime hints.
test/​Func.Tests/​Commands/​Setup/​SetupDefaultHintTests.cs Tests dependency planning from Java and PowerShell local settings.
test/​Func.Tests/​Commands/​Setup/​SetupCommandTests.cs Verifies Java and PowerShell appear in feature help.
test/​Func.Tests/​Commands/​Setup/​SetupAutomationContractTests.cs Updates expected interactive stack choices and fixtures.
src/​Func/​Commands/​Setup/​SetupTypes.cs Adds Java and PowerShell stack package mappings.
src/​Func/​Commands/​Setup/​SetupFeatureResolver.cs Normalizes configured native runtimes to the Go feature.
src/​Func/​Commands/​Setup/​SetupFeatureCatalog.cs Reuses the planner’s supported-stack list for hints.
src/​Func/​Commands/​Setup/​SetupCommand.cs Includes Java and PowerShell in feature help.
README.md Documents language setup, checks, and debug-script features.
eng/​scripts/​debug-workloads.ps1 Adds Java and PowerShell debug-workload mappings.
docs/​cli-architecture.md Explains setup-only Go runtime normalization.

Review effort: Balanced

@satvu
sarah (satvu) merged commit 87e3fcf into vnext Oct 29, 2026
7 checks passed
@satvu
sarah (satvu) deleted the satvu-setup-workload-investigation branch October 29, 2026 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants