feat: migrate wizard question tree to JSON-driven dynamic templates#15560
Open
feat: migrate wizard question tree to JSON-driven dynamic templates#15560
Conversation
Migrate all wizard question tree nodes from hardcoded TypeScript to JSON configuration files, enabling dynamic template release without code changes. Changes: - Create rootNode.json for project type selection (DA, CEA, Teams, Office Add-in, etc.) - Create daNode.json for Declarative Agent sub-tree with featureFlag support - Create officeAddinNode.json for Office Add-in sub-tree - Create graphConnectorNode.json for Graph Connector sub-tree - Enhance constructNode.ts with featureFlag filtering, icon/groupName support, loadJsonNode helper, and all new node references (lazy imports to avoid cycles) - Add rootNode.ts loader following existing ceaNode/teamsNode pattern - Simplify createRootNode.ts to use JSON-loaded root node - Add 24 unit tests for constructNode and rootNode The JSON files are included in metadata.zip and distributed via the existing template publish/fetch pipeline. Future template CRUD only requires JSON changes + template publish, no code release needed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
tecton
reviewed
Mar 23, 2026
Contributor
tecton
left a comment
There was a problem hiding this comment.
LGTM and left some comments. Also, related strings could be moved to metadata in following PR.
| } | ||
|
|
||
| /** Map of feature flag names (as stored in JSON) to FeatureFlags enum values */ | ||
| const featureFlagMap: Record<string, FeatureFlag> = { |
Contributor
There was a problem hiding this comment.
This seems to be redundant?
| // Set appropriate onDidSelection callback | ||
| if (jsonObject.data.name === QuestionNames.WithPlugin) { | ||
| // Lazy import to avoid circular dependency | ||
| const { setTemplateNameAndGC } = require("./vsc/daProjectTypeNode"); |
Contributor
There was a problem hiding this comment.
It's better to use import instead of require.
| return foundryNode(jsonObject.condition as any); | ||
|
|
||
| // Sub-tree nodes loaded from JSON (lazy imports to avoid circular dependency) | ||
| case "ceaNode": { |
Contributor
There was a problem hiding this comment.
What would be the benefit of loading sub-tree nodes dynamically instead of a whole tree node loaded from file? It can be separated in source files and combined into a JSON file to be loaded.
…simplify featureFlag 1. Merge sub-tree JSONs into single wizardNode.json: root + DA + graphConnector + officeAddin are combined at build time (wizard.ts). Source files remain separate for maintainability. CEA and Teams nodes are still separate (pre-existing pattern). 2. Replace require() with static imports: moved setTemplateNameAndGC to CapabilityOptions.ts to break circular dependency. ceaNode/teamsNode loaded via loadJsonNode (same file, no circular import). 3. Remove redundant featureFlagMap: replaced with dynamic lookup on FeatureFlags class. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate all wizard question tree nodes from hardcoded TypeScript to JSON configuration files, enabling dynamic template release without code changes.
Changes
New JSON node files (templates/src/ui/)
Enhanced constructNode.ts
New rootNode.ts
Simplified createRootNode.ts
Unit Tests
Impact
Verification
Work item
link