Cherry-pick #16306 to dev: generate DT add-MCP action inline instead of v4 modify front door#16312
Cherry-pick #16306 to dev: generate DT add-MCP action inline instead of v4 modify front door#16312Alive-Fish with Copilot wants to merge 4 commits into
Conversation
…front door DT-on 'add action --api-plugin-type mcp' now writes the URL-only ai-plugin manifest and wires oauth/register directly in core.addPlugin, independent of TEAMSFX_V4_ENABLED. The oauth/register action name and registrationId are derived from the MCP server URL so re-adding the same server is idempotent, and the server is probed for auth metadata when none is provided. Enable TEAMSFX_MCP_FOR_DA_DT by default and fix FeatureFlagManager.listEnabled for default-on flags. Add e2e coverage for MCP no-auth/auth/edge-case flows.
…solution fails The DT add-MCP inline path wrapped endpoint resolution and yml injection in one try/catch, so a failed auth-metadata probe (unreachable server / no resource_metadata) skipped the oauth/register injection entirely — leaving the ai-plugin referencing a registration that was never created. Split into two best-effort steps (mirroring the create flow): endpoint resolution failure now leaves endpoints empty but the oauth/register (or dcr/register) action is still written for the developer to complete. Verified end-to-end via the CLI add-action flow.
E2E Test Selection — AI SelectedWhy these tests: The fx-core changes target declarativeAgent logic (FxCore.declarativeAgent.ts, AddPluginInputs/Options) and feature flags, so all declarativeAgent/* tests are included; the three MCP test files are returned directly as changed e2e tests (rule 7); feature/multienv covers the featureFlags.ts change impact. Cases selected (14):
Need to run more tests?Comment on this PR:
Then re-run the workflow. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #16312 +/- ##
==========================================
+ Coverage 87.26% 87.28% +0.02%
==========================================
Files 631 633 +2
Lines 33084 33133 +49
Branches 7715 7724 +9
==========================================
+ Hits 28870 28920 +50
- Misses 2401 2407 +6
+ Partials 1813 1806 -7
🚀 New features to boost your workflow:
|
|
@copilot fix patch coverage |
…on error, and no-name fallback
Fixed patch coverage: added three unit tests to |
Synchronizes PR #16306 (
fix(fx-core): generate DT add-MCP action inline instead of v4 modify front door) fromrelease/6.12todev. Previously, with DT on,atk add action --api-plugin-type mcprouted through the v4 modify front door, producing an incompleteoauth/registerinm365agents.ymland coupling DT toTEAMSFX_V4_ENABLED.Changes (cherry-picked)
FxCore.declarativeAgent.ts): DT-on writes the URL-onlyai-plugin.jsonand wiresoauth/register/dcr/registervia the shared injector directly incore.addPlugin, independent ofTEAMSFX_V4_ENABLED. The v4add-mcp-servermodify template is untouched.oauth/registername/registrationIdderive from the MCP server URL (shared with the create flow), making re-adds idempotent (one registration per server).resource_metadata) still writes the registration action for the developer to complete.TEAMSFX_MCP_FOR_DA_DTdefaults on;FeatureFlagManager.listEnablednow honours default-on flags.AddPluginInputs/AddPluginOptions; added MCP no-auth / with-auth / edge-case e2e coverage.Conflict resolution notes
FxCore.declarativeAgent.tsconflicted only becausedevhad already dropped acallCoreMethod:line from the old v4-dispatch block that this change deletes wholesale; the resolved file is byte-identical to the source commit with no dev-specific change lost.rcversioning and the version-parsinguseLocalTemplatelogic — both refactored away ondev, which now uses a config-flaguseLocalTemplateand a stable version.dev'sutils.test.ts/generator.test.tsalready pass without it, and applying it would target testsdevhas removed.