-
Notifications
You must be signed in to change notification settings - Fork 800
Gate experimental polyglot languages behind per-language feature flags #14428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -120,7 +120,7 @@ public NewCommand( | |||||
| { | ||||||
| _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)" | ||||||
|
||||||
| 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)" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,8 @@ | ||||||||||||||||||||||||||||||||||||||||||||
| // Licensed to the .NET Foundation under one or more agreements. | ||||||||||||||||||||||||||||||||||||||||||||
| // The .NET Foundation licenses this file to you under the MIT license. | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| using Aspire.Cli.Configuration; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| namespace Aspire.Cli.Projects; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| /// <summary> | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -9,12 +11,9 @@ namespace Aspire.Cli.Projects; | |||||||||||||||||||||||||||||||||||||||||||
| /// </summary> | ||||||||||||||||||||||||||||||||||||||||||||
| /// <remarks> | ||||||||||||||||||||||||||||||||||||||||||||
| /// This implementation provides a static list of supported languages. | ||||||||||||||||||||||||||||||||||||||||||||
| /// Future implementations could discover languages from: | ||||||||||||||||||||||||||||||||||||||||||||
| /// - 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. | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
| /// Experimental languages (Go, Java, Rust) are filtered based on per-language feature flags. | |
| /// Experimental languages are filtered based on per-language feature flags. |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
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.
| 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
AI
Feb 10, 2026
There was a problem hiding this comment.
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.
| return true; | |
| return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
--languagehelp text now lists only “csharp, typescript”, butinit --languagecan also accept experimental languages when their feature flags are enabled. Consider mentioning the experimental flags in the option description so--helpstays accurate for those scenarios.