fix(fx-core): respect real feature flag default in dynamic scaffold UI#16229
Conversation
Dynamic wizard/TDP nodes built from JSON hardcoded defaultValue 'false' when gating options by featureFlag, so flags whose real default is 'true' (e.g. OpenPluginImportExport, MCPForDADCR) were wrongly hidden when the env var was unset, diverging from static nodes. Resolve the flag's real default from FeatureFlags by name, falling back to 'false' for unknowns. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
❌ VscUse Test Plan — Tests unknownWhy these tests: PR fixes feature-flag default resolution in constructNode.ts (packages/fx-core, rule 10 → Feature_*); selected plans directly cover wizard option filtering, wizard node loading, and dynamic scaffold behaviour — the exact areas touched by this bug fix. Branch diff: Plans run:
ℹ️ How were these tests selected?GitHub Copilot (Claude Sonnet 4.6, high reasoning) analysed the PR title, description, and the diff between |
E2E Test Selection — AI SelectedWhy these tests: The .github/** changes are infra-only (rule 9, no tests); the fx-core scaffold changes map to teamsApp/, teamsAgent/, declarativeAgent/, and feature/template/multienv* patterns (rule 1), but the only available test case (./vs/FoundryProxyAgent.dotnet.tests.ts) does not fall under any of those patterns. Cases selected (0): Need to run more tests?Comment on this PR:
Then re-run the workflow. |
Dispatch cd.yml directly on the source/reference branch instead of the private neil/cdprivatepipeline branch, passing preid=alpha and skipping the markdown check and branch validation for dev/testing smoke runs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #16229 +/- ##
==========================================
+ Coverage 86.45% 86.46% +0.01%
==========================================
Files 624 624
Lines 31815 31818 +3
Branches 7437 7438 +1
==========================================
+ Hits 27505 27511 +6
+ Misses 2481 2479 -2
+ Partials 1829 1828 -1
🚀 New features to boost your workflow:
|
When a PR is updated the parent vscuse selector run is cancelled, but the workflows it dispatches (smoke -> cd / docker / ui-test) kept running as orphans. Add per-branch concurrency to each dispatched tier so a re-dispatch cancels the stale run. Production CD and nightly UI test runs on dev/release use a unique run_id group so concurrency is a no-op there. Also add a skipdockerbuild input to cd.yml gating its trigger-docker-build job; the smoke pipeline passes skipdockerbuild=true so only its own docker build runs, removing the duplicate image build. The docker build gains an optional source_ref input used solely to group concurrency per branch. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
❌ VscUse Test Plan — Tests failureWhy these tests: The core fix is in constructNode.ts (scaffold wizard feature-flag gate), directly exercised by Feature_Verify_Feature_Flag_Filtering_In_Wizard_Options; DA_MCP_None_Remote covers the specifically broken MCPForDADCR flag whose true default was wrongly suppressed; Feature_Verify_Wizard_UI_Loads_All_Project_Types_From_Wizard_Node validates that wizard node loading reflects the corrected flag defaults. Branch diff: Plans run:
ℹ️ How were these tests selected?GitHub Copilot (Claude Sonnet 4.6, high reasoning) analysed the PR title, description, and the diff between |
Summary
Two related changes:
1. Dynamic scaffold feature-flag default (fx-core)
packages/fx-core/src/question/scaffold/constructNode.tsbuilds wizard/TDP question nodes from JSON (templates/ui/wizardNode.json,tdpNode.json); options can be gated by"featureFlag": "TEAMSFX_XXX". The gate hardcodeddefaultValue: "false":So any flag whose real default is
"true"(e.g.OpenPluginImportExport,MCPForDADCR,KiotaNPMIntegration) was wrongly treated OFF when the env var was unset — the option silently disappeared, diverging from static nodes that pass the realFeatureFlags.X. Onrelease/6.10this hid the default-on MCP-for-DA option.Fix: resolve each flag's real default by looking it up in
FeatureFlagsby name, falling back to"false"for unknown flags.Tests (
packages/fx-core/tests/question/scaffold.test.ts): true-default flag included when env unset; false-default excluded when unset; explicit env override wins both ways; unknown flag excluded. Verified the three JSON-referenced flags (TEAMSFX_AGENT_SKILLS,TEAMSFX_CHAT_PARTICIPANT_ENTRIES,TEAMSFX_CF_SHORTCUT_METAOS) all default false, so no existing option's visibility regresses.2. Smoke-test pipeline runs against the PR branch
cd.ymldirectly on the PR/source branch (previously the privateneil/cdprivatepipelinebranch viaexternal_ref), withpreid=alpha,skipmarkdowncheck=true,SkipBranchCheck=true.3. Stop orphaned runs + remove the duplicate docker build
When a PR is updated the parent vscuse selector run is cancelled, but the runs it dispatched (smoke → cd / docker / ui-test) kept running as orphans. Added per-branch
concurrency(cancel-in-progress) to each dispatched tier so a re-dispatch cancels the stale run. Production CD and nightly UI-test runs ondev/release/*use a uniquerun_idgroup, so concurrency is a no-op there — real releases are never cancelled or queued.Also added a
skipdockerbuildinput tocd.ymlso the smoke flow (which builds its own image) doesn't trigger a second docker build; the docker workflow gains an optionalsource_refinput used solely to group concurrency per branch.Testing
scaffold.test.ts160/160 pass;npm run buildand ESLint clean on changed files.Files
packages/fx-core/src/question/scaffold/constructNode.tspackages/fx-core/tests/question/scaffold.test.ts.github/workflows/dev-smoke-test-pipeline.yml.github/workflows/cd.yml.github/workflows/ui-test-vscuse-template.yml.github/workflows/vscuse-atk-docker-build.yml