Skip to content

Conversation

@sebastienros
Copy link
Member

Summary

Add per-language experimental feature flags for Python, Go, Java, and Rust polyglot languages. When polyglotSupportEnabled is true, only C# and TypeScript are available by default. Experimental languages require an additional flag to be enabled.

New Feature Flags

Flag Language Default
experimentalPolyglot:python Python false
experimentalPolyglot:go Go false
experimentalPolyglot:java Java false
experimentalPolyglot:rust Rust false

Behavior Matrix

polyglotSupportEnabled Per-language flag Languages Available
false (default) N/A C# only
true none C#, TypeScript
true experimentalPolyglot:python=true C#, TypeScript, Python
true experimentalPolyglot:go=true C#, TypeScript, Go

Per-language flags are additive on top of polyglotSupportEnabled.

Changes

  • KnownFeatures.cs — Added 4 new feature flag constants and metadata entries
  • ILanguageDiscovery.cs — Added IsExperimental property to LanguageInfo record
  • DefaultLanguageDiscovery.cs — Injected IFeatures, filters experimental languages based on per-language flags in all discovery methods
  • NewCommand.cs / InitCommand.cs — Updated --language option description
  • Dockerfile.go/java/rust/python — CI polyglot validation enables per-language experimental flags
  • Extension schemas — Added experimentalPolyglot object with per-language properties
  • DefaultLanguageDiscoveryTests.cs — Added tests for experimental language filtering

Usage

# Enable polyglot + Python
aspire config set features:polyglotSupportEnabled true --global
aspire config set features:experimentalPolyglot:python true --global

Add per-language experimental feature flags for Python, Go, Java, and Rust.
When polyglotSupportEnabled is true, only C# and TypeScript are available
by default. Experimental languages require an additional flag:

- experimentalPolyglot:python
- experimentalPolyglot:go
- experimentalPolyglot:java
- experimentalPolyglot:rust

Changes:
- Add IsExperimental property to LanguageInfo record
- Add 4 new feature flags to KnownFeatures
- Filter experimental languages in DefaultLanguageDiscovery based on flags
- Update CI Dockerfiles to enable per-language flags
- Update extension JSON schemas with new flag definitions
- Update --language option description in NewCommand/InitCommand
- Add tests for experimental language filtering
Copilot AI review requested due to automatic review settings February 10, 2026 15:42
@github-actions
Copy link
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14428

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14428"

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces per-language feature flags to gate experimental polyglot language support in Aspire.Cli, so that polyglot can be enabled broadly while still requiring explicit opt-in for specific experimental languages.

Changes:

  • Added new feature flags (experimentalPolyglot:{python,go,java,rust}) and surfaced them in CLI feature metadata and extension JSON schemas.
  • Extended language discovery metadata with an IsExperimental marker and filtered experimental languages based on feature flags.
  • Updated CLI help text, CI polyglot validation Dockerfiles, and added/updated tests to cover experimental language filtering.

Reviewed changes

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

Show a summary per file
File Description
tests/Aspire.Cli.Tests/Projects/DefaultLanguageDiscoveryTests.cs Updates construction of language discovery and adds tests for experimental language gating.
src/Aspire.Cli/Projects/ILanguageDiscovery.cs Adds IsExperimental to LanguageInfo to support gating logic.
src/Aspire.Cli/Projects/DefaultLanguageDiscovery.cs Implements experimental-language filtering via per-language feature flags.
src/Aspire.Cli/KnownFeatures.cs Defines new experimental polyglot feature flags and metadata.
src/Aspire.Cli/Commands/NewCommand.cs Updates --language help text to reflect default language options.
src/Aspire.Cli/Commands/InitCommand.cs Updates --language help text to reflect default language options.
extension/schemas/aspire-settings.schema.json Adds features.experimentalPolyglot schema entries for settings validation/intellisense.
extension/schemas/aspire-global-settings.schema.json Adds features.experimentalPolyglot schema entries for global settings validation/intellisense.
.github/workflows/polyglot-validation/Dockerfile.* Enables the relevant experimental polyglot flag in each language validation container.

Comment on lines +153 to +158
if (s_experimentalFeatureFlags.TryGetValue(language.LanguageId.Value, out var featureFlag))
{
return features.IsFeatureEnabled(featureFlag, false);
}

return true;
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

DefaultLanguageDiscovery now filters experimental languages only by the per-language flag, but the feature metadata/docs state these flags require polyglotSupportEnabled. As-is, enabling experimentalPolyglot:* will surface the language even when polyglotSupportEnabled is false. Consider updating IsLanguageEnabled to also require features.IsFeatureEnabled(KnownFeatures.PolyglotSupportEnabled, false) (at least for experimental languages) so runtime behavior matches the documented requirement.

Suggested change
if (s_experimentalFeatureFlags.TryGetValue(language.LanguageId.Value, out var featureFlag))
{
return features.IsFeatureEnabled(featureFlag, false);
}
return true;
// Experimental languages require polyglot support to be enabled globally.
if (!features.IsFeatureEnabled(KnownFeatures.PolyglotSupportEnabled, false))
{
return false;
}
if (s_experimentalFeatureFlags.TryGetValue(language.LanguageId.Value, out var featureFlag))
{
return features.IsFeatureEnabled(featureFlag, false);
}
// If there is no per-language feature flag defined, treat the experimental language as disabled.
return false;

Copilot uses AI. Check for mistakes.
/// - Configuration files (~/.aspire/languages.json)
/// - NuGet search (Aspire.Hosting.Language.* packages)
/// - Remote service endpoints
/// Experimental languages (Go, Java, Rust) are filtered based on per-language feature flags.
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The remarks mention experimental languages as “(Go, Java, Rust)”, but this file also marks Python as experimental. Update the remark to include Python (or reword to avoid listing specific languages) so the documentation matches behavior.

Suggested change
/// Experimental languages (Go, Java, Rust) are filtered based on per-language feature flags.
/// Experimental languages are filtered based on per-language feature flags.

Copilot uses AI. Check for mistakes.
public async Task GetAvailableLanguagesAsync_ReturnsPythonLanguage()
{
var discovery = new DefaultLanguageDiscovery();
var features = new TestFeatures();
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

These tests enable the per-language experimental flag but do not enable KnownFeatures.PolyglotSupportEnabled. The PR description/feature metadata say experimental polyglot flags require polyglotSupportEnabled, so the tests should set both flags (or the implementation/docs should be adjusted for consistency).

Suggested change
var features = new TestFeatures();
var features = new TestFeatures();
features.SetFeature(KnownFeatures.PolyglotSupportEnabled, true);

Copilot uses AI. Check for mistakes.
Comment on lines +87 to +90
var features = new TestFeatures();
features.SetFeature(featureFlag, true);
var discovery = new DefaultLanguageDiscovery(features);

Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

This parametrized test enables experimentalPolyglot:* flags but not polyglotSupportEnabled. If experimental language availability is intended to be additive on top of polyglotSupportEnabled (per PR description), set KnownFeatures.PolyglotSupportEnabled to true in the test setup as well.

Copilot uses AI. Check for mistakes.
Comment on lines +145 to +147
var features = new TestFeatures();
features.SetFeature(KnownFeatures.ExperimentalPolyglotGo, true);
var discovery = new DefaultLanguageDiscovery(features);
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

This test enables KnownFeatures.ExperimentalPolyglotGo but not KnownFeatures.PolyglotSupportEnabled. To match the documented requirement that experimental polyglot flags require polyglot support, the test should enable both (or update the implementation/docs).

Copilot uses AI. Check for mistakes.
return features.IsFeatureEnabled(featureFlag, false);
}

return true;
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

IsLanguageEnabled returns true if an experimental language isn't present in s_experimentalFeatureFlags. That means a future contributor could mark a language as experimental but forget to add the mapping, and it would become enabled by default (opposite of the intended gating). Consider defaulting to false when IsExperimental is true and no feature-flag mapping exists.

Suggested change
return true;
return false;

Copilot uses AI. Check for mistakes.
public void GetLanguageById_ReturnsExperimentalLanguageWhenFlagEnabled()
{
var features = new TestFeatures();
features.SetFeature(KnownFeatures.ExperimentalPolyglotRust, true);
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

This test enables KnownFeatures.ExperimentalPolyglotRust but not KnownFeatures.PolyglotSupportEnabled. If experimental polyglot languages are meant to be gated by both flags, the test should set polyglotSupportEnabled too (or the docs/implementation should be reconciled).

Suggested change
features.SetFeature(KnownFeatures.ExperimentalPolyglotRust, true);
features.SetFeature(KnownFeatures.ExperimentalPolyglotRust, true);
features.SetFeature(KnownFeatures.PolyglotSupportEnabled, true);

Copilot uses AI. Check for mistakes.
_languageOption = new Option<string?>("--language", "-l")
{
Description = "The programming language for the AppHost (csharp, typescript, python)"
Description = "The programming language for the AppHost (csharp, typescript)"
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The --language help text now lists only “csharp, typescript”, but the command can accept additional experimental languages when their feature flags are enabled. Consider tweaking the description to mention that more languages may be available when experimental polyglot flags are turned on, to avoid making --help misleading for users who enable them.

Suggested change
Description = "The programming language for the AppHost (csharp, typescript)"
Description = "The programming language for the AppHost (for example: csharp, typescript; additional experimental languages may be available when polyglot features are enabled)"

Copilot uses AI. Check for mistakes.
_languageOption = new Option<string?>("--language", "-l")
{
Description = "The programming language for the AppHost (csharp, typescript, python)"
Description = "The programming language for the AppHost (csharp, typescript)"
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

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

The --language help text now lists only “csharp, typescript”, but init --language can also accept experimental languages when their feature flags are enabled. Consider mentioning the experimental flags in the option description so --help stays accurate for those scenarios.

Suggested change
Description = "The programming language for the AppHost (csharp, typescript)"
Description = "The programming language for the AppHost (csharp, typescript; additional experimental languages may be available when enabled via feature flags)."

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

🎬 CLI E2E Test Recordings

The following terminal recordings are available for commit 2de8b00:

Test Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
CreateAndDeployToDockerCompose ▶️ View Recording
CreateAndDeployToDockerComposeInteractive ▶️ View Recording
CreateAndPublishToKubernetes ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateEmptyAppHostProject ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
ResourcesCommandShowsRunningResources ▶️ View Recording

📹 Recordings uploaded automatically from CI run #21871647512

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.

2 participants