Skip to content

feat(fx-core): v4 create-flow localization and v3 parity#16309

Merged
Alive-Fish merged 2 commits into
devfrom
copilot/v4-create-localization-parity
Jul 8, 2026
Merged

feat(fx-core): v4 create-flow localization and v3 parity#16309
Alive-Fish merged 2 commits into
devfrom
copilot/v4-create-localization-parity

Conversation

@Alive-Fish

Copy link
Copy Markdown
Contributor

Summary

Localizes the v4 create flow and closes several v3 parity gaps in the v4 scaffolding engine. All new behavior is gated behind the V4Enabled feature flag (default false), so there is no shipped behavior change.

What's included

v4 create-flow localization & parity (commit 1)

  • Q1 selector localization — the create selector (Q1) now localizes via keyPrefix, sharing the same mechanism as Q2/Q3 (extracted into localizePrompt.ts). Previously Q1 was English-only regardless of NLS.
  • Reuse v3 NLS — rolled back fabricated literals across create templates to reuse the existing v3 core.* / template.* strings (mcp, graph-connector, apiSpec, etc.); no new strings invented.
  • Secret masking — added password support to the v4 engine (collectInputsuiPromptUI text config + schema) and set password: true on secret inputs (OpenAI / Azure OpenAI keys, MCP OAuth client secret), matching v3.
  • Question fragment reuse — the shared LLM question block (5 questions) is now authored once in templates/v4/_shared/questions/llm-service.json and pulled into 6 templates via a { "use": "llm-service" } reference, resolved at load time (questionFragments.ts).
  • Azure OpenAI cascade — restored the v3 progressive reveal: the endpoint question appears only once the key is set, and the deployment-name question only once the endpoint is set.
  • Schema renamequestion.schema.jsonquestions.schema.json to match the data file it validates (siblings descriptor / pipeline / selector already follow this convention).
  • Updated ADR-0016 and the scaffolding specs.

Unrelated lint cleanup (commit 2, isolated for review)

  • Removed 8 pre-existing @typescript-eslint/no-unnecessary-type-assertion errors in 6 non-v4 files. The casts became redundant under TypeScript 5.5 inferred type predicates (.filter(x => x != null) as T[]). Verified with tsc --noEmit; emitted JS is unchanged.

Testing

  • tests/v4: 748 passing (incl. a new Azure-cascade test).
  • Full npm run test:unit: 4909 passing, 0 failed; coverage lines 92.28%.
  • npm run lint: 0 errors (full tree); all changed files prettier-clean.
  • tsc -p ./ --noEmit: clean.

Notes

  • Flag-gated (V4Enabled default off) → zero shipped impact.
  • The two concerns are split into two commits for review clarity.

All new behavior is behind the V4Enabled flag (default off); tests/v4 = 748 passing.

- Localize the Q1 create selector via keyPrefix, sharing the Q2/Q3 mechanism (new localizePrompt.ts).

- Reuse existing v3 nls strings and roll back fabricated literals across create templates.

- Mask secret text inputs (password) in the v4 engine and template questions.

- Reuse the shared LLM question block across templates via reusable question fragments (new questionFragments.ts + _shared/llm-service.json).

- Restore the Azure OpenAI question cascade: endpoint shown once the key is set, deployment once the endpoint is set.

- Rename question.schema.json to questions.schema.json to match the data-file naming convention.

- Update ADR-0016 and scaffolding specs accordingly.
Pre-existing @typescript-eslint/no-unnecessary-type-assertion errors; the casts became redundant under TS 5.5 inferred type predicates (filter narrowing). Verified with tsc --noEmit; emitted JS is unchanged.
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

❌ VscUse Test Plan — Tests failure

Why these tests: The PR modifies the v4 create-flow wizard (selector.json, all questions.json files) with localization and parity changes gated by V4Enabled, so Feature plans covering the create wizard UI are prioritized, supplemented by representative template runs for the two most heavily changed template families (custom-copilot and DA).

Branch diff: copilot/v4-create-localization-paritydev

Results: ✅ 2 passed · ❌ 3 failed (of 5 plans)

Plans run:

  • Feature_UI_Layout__Create_Project_Questions
  • Feature_Verify_Wizard_UI_Loads_All_Project_Types_From_Wizard_Node
  • Feature_Verify_Feature_Flag_Filtering_In_Wizard_Options
  • Basic_Custom_Engine_Azure_OpenAI_ts_Copilot_Remote_Debug
  • DA_No_Action_Remote_Debug

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

🎯 Actual UI test run
🔗 Full pipeline results
📊 Detailed test report

ℹ️ How were these tests selected?

GitHub Copilot (Claude Sonnet 4.6, high reasoning) analysed the PR title, description, and the diff between
copilot/v4-create-localization-parity and dev
to pick the most relevant test plans from packages/tests/vscuse/Index.md.

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

E2E Test Selection — AI Selected

Why these tests: Rule 1 (fx-core changes to coordinator, v4 scaffolding, question flow, secret masker, envUtil) maps to teamsApp/, teamsAgent/, declarativeAgent/, and feature/multienv; template changes across da/, custom-copilot, bot, tab, message-extension, and teams-collaborator-agent directories reinforce all teamsApp, teamsAgent, and declarativeAgent selections; docs-only files are excluded per Rule 9.

Cases selected (21):

  • ./teamsApp/basicBot.tests.ts
  • ./teamsApp/basicMessageExtension.tests.ts
  • ./teamsApp/basicTab.tests.ts
  • ./teamsAgent/DebugCustomCopilotBasicBot.tests.ts
  • ./teamsAgent/DebugCustomCopilotRagAiSearchBot.tests.ts
  • ./teamsAgent/DebugCustomCopilotRagBasicBot.tests.ts
  • ./teamsAgent/teamsCollaboratorAgent.tests.ts
  • ./declarativeAgent/DeclarativeAgentBasic.tests.ts
  • ./declarativeAgent/DeclarativeAgentWithApiKeyAuth.tests.ts
  • ./declarativeAgent/DeclarativeAgentWithOAuth.tests.ts
  • ./declarativeAgent/DeclarativeAgentWithNoneAuth.tests.ts
  • ./declarativeAgent/DeclarativeAgentWithEntra.tests.ts
  • ./declarativeAgent/DeclarativeAgentInvalidManifestShape.tests.ts
  • ./declarativeAgent/mcp/DeclarativeAgentMCPNoAuth.tests.ts
  • ./declarativeAgent/mcp/DeclarativeAgentMCPWithAuth.tests.ts
  • ./declarativeAgent/mcp/DeclarativeAgentMCPAuthEdgeCases.tests.ts
  • ./declarativeAgent/typespec/typespec.withoutAction.tests.ts
  • ./declarativeAgent/typespec/typespec.withAction.tests.ts
  • ./declarativeAgent/addKnowledge/AddWebSearchByAll.tests.ts
  • ./declarativeAgent/addKnowledge/AddWebSearchByUrl.tests.ts
  • ./feature/multienv.tests.ts

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.

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.27%. Comparing base (2fda93f) to head (070ee87).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
...s/fx-core/src/v4/distribution/questionFragments.ts 93.18% 2 Missing and 1 partial ⚠️
...kages/fx-core/src/v4/surface/createSelectorWalk.ts 50.00% 0 Missing and 1 partial ⚠️
packages/fx-core/src/v4/surface/localizePrompt.ts 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##              dev   #16309   +/-   ##
=======================================
  Coverage   87.26%   87.27%           
=======================================
  Files         631      633    +2     
  Lines       33084    33119   +35     
  Branches     7715     7723    +8     
=======================================
+ Hits        28870    28903   +33     
- Misses       2401     2402    +1     
- Partials     1813     1814    +1     
Files with missing lines Coverage Δ
...ackages/fx-core/src/common/secretmasker/feature.ts 96.47% <100.00%> (ø)
...ackages/fx-core/src/component/coordinator/index.ts 85.35% <100.00%> (-0.04%) ⬇️
...t/driver/teamsApp/utils/CopilotGptManifestUtils.ts 85.57% <ø> (ø)
packages/fx-core/src/component/utils/envUtil.ts 88.63% <100.00%> (ø)
packages/fx-core/src/question/other.ts 87.19% <100.00%> (ø)
...ckages/fx-core/src/v4/buildTarget/parseSelector.ts 81.45% <100.00%> (+0.94%) ⬆️
...ages/fx-core/src/v4/collectInputs/collectInputs.ts 88.30% <ø> (ø)
...ges/fx-core/src/v4/distribution/createQuestions.ts 89.47% <100.00%> (+4.85%) ⬆️
.../fx-core/src/v4/distribution/declarativePackage.ts 87.65% <100.00%> (-1.11%) ⬇️
...fx-core/src/v4/providers/createOptionsProviders.ts 94.56% <100.00%> (ø)
... and 4 more
🚀 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.

@Alive-Fish Alive-Fish merged commit bf866b5 into dev Jul 8, 2026
55 of 62 checks passed
@Alive-Fish Alive-Fish deleted the copilot/v4-create-localization-parity branch July 8, 2026 05:14
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