Skip to content

fix(fx-core): respect real feature flag default in dynamic scaffold UI#16229

Merged
qfai merged 4 commits into
devfrom
qfai/fix-dynamic-scaffold-feature-flag-defaul
Jun 30, 2026
Merged

fix(fx-core): respect real feature flag default in dynamic scaffold UI#16229
qfai merged 4 commits into
devfrom
qfai/fix-dynamic-scaffold-feature-flag-defaul

Conversation

@qfai

@qfai qfai commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Two related changes:

  1. Bug fix — dynamic (JSON-driven) scaffold wizard/TDP nodes ignored a feature flag's real default value.
  2. Smoke-test pipeline — make it validate the PR's own branch, and stop it from leaving orphaned workflow runs.

1. Dynamic scaffold feature-flag default (fx-core)

packages/fx-core/src/question/scaffold/constructNode.ts builds wizard/TDP question nodes from JSON (templates/ui/wizardNode.json, tdpNode.json); options can be gated by "featureFlag": "TEAMSFX_XXX". The gate hardcoded defaultValue: "false":

return featureFlagManager.getBooleanValue({ name: flagName, defaultValue: "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 real FeatureFlags.X. On release/6.10 this hid the default-on MCP-for-DA option.

Fix: resolve each flag's real default by looking it up in FeatureFlags by 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

  • Dispatch cd.yml directly on the PR/source branch (previously the private neil/cdprivatepipeline branch via external_ref), with preid=alpha, skipmarkdowncheck=true, SkipBranchCheck=true.
  • Run the final vscuse UI test on the source branch too, so the PR's own test plans are what get exercised.

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 on dev / release/* use a unique run_id group, so concurrency is a no-op there — real releases are never cancelled or queued.

Also added a skipdockerbuild input to cd.yml so the smoke flow (which builds its own image) doesn't trigger a second docker build; the docker workflow gains an optional source_ref input used solely to group concurrency per branch.


Testing

  • fx-core: scaffold.test.ts 160/160 pass; npm run build and ESLint clean on changed files.
  • Workflows: all four YAMLs validated; concurrency expression semantics reviewed to confirm real releases / nightly are unaffected.

Files

  • packages/fx-core/src/question/scaffold/constructNode.ts
  • packages/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

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>
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

❌ VscUse Test Plan — Tests unknown

Why 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: qfai/fix-dynamic-scaffold-feature-flag-defauldev

Plans run:

  • Feature_Verify_Feature_Flag_Filtering_In_Wizard_Options
  • Feature_Verify_Wizard_UI_Loads_All_Project_Types_From_Wizard_Node
  • Feature_Verify_Scaffold_Works_For_Dynamically_Added_Template

Step Status
1️⃣ Build VSIX (CD) ✅ Done
2️⃣ Build Docker image ✅ Done
3️⃣ Run UI tests ❌ Tests unknown
ℹ️ How were these tests selected?

GitHub Copilot (Claude Sonnet 4.6, high reasoning) analysed the PR title, description, and the diff between
qfai/fix-dynamic-scaffold-feature-flag-defaul and dev
to pick the most relevant test plans from packages/tests/vscuse/Index.md.

@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

E2E Test Selection — AI Selected

Why 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):


View pipeline run

Need to run more tests?

Comment on this PR:

  • /e2e-run ./path/to/test.tests.ts — add specific cases to AI selection
  • /e2e-run-all — run all e2e cases

Then re-run the workflow.

@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 29, 2026 07:39 — with GitHub Actions Inactive
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

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.46%. Comparing base (c7420a1) to head (ffa1235).
⚠️ Report is 6 commits behind head on dev.

Additional details and impacted files

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
...ges/fx-core/src/question/scaffold/constructNode.ts 96.61% <100.00%> (+0.05%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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>
@qfai qfai requested a review from qinzhouxu as a code owner June 30, 2026 07:10
@qfai qfai temporarily deployed to engineering June 30, 2026 07:10 — with GitHub Actions Inactive
@qfai qfai temporarily deployed to engineering June 30, 2026 07:10 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

❌ VscUse Test Plan — Tests failure

Why 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: qfai/fix-dynamic-scaffold-feature-flag-defauldev

Plans run:

  • Feature_Verify_Feature_Flag_Filtering_In_Wizard_Options
  • DA_MCP_None_Remote
  • Feature_Verify_Wizard_UI_Loads_All_Project_Types_From_Wizard_Node

Step Status
1️⃣ Build VSIX (CD) ✅ Done
2️⃣ Build Docker image ✅ Done
3️⃣ Run UI tests ❌ Tests failure

🔗 Full pipeline results

ℹ️ How were these tests selected?

GitHub Copilot (Claude Sonnet 4.6, high reasoning) analysed the PR title, description, and the diff between
qfai/fix-dynamic-scaffold-feature-flag-defaul and dev
to pick the most relevant test plans from packages/tests/vscuse/Index.md.

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