Repository navigation
feat(fx-core): add prepared SharePoint publication - #16950
Open
Bert Jansen (jansenbe) wants to merge 12 commits into
Open
Bert Jansen (jansenbe) wants to merge 12 commits into
Bert Jansen (jansenbe) wants to merge 12 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Teams manifest schemas through v1.30 define ToolSource with remoteMcpServer only; plugin exists only in devPreview. Connector-only SharePoint assembly and preparation now fail with UnsupportedAgentConnectorManifestVersion instead of emitting schema-invalid output. Regressions use the genuine TeamsManifestConverter. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
There was an error handling pipeline event 0f4eee12-b214-4de0-9993-e22652d75944. |
…e auth errors - Re-verify Graph/SharePoint token tenant and audience against the journal before every prepared write (tokenIdentity.ts). - Scope identity-lock failures to lock acquisition so inner errors keep codes. - Replace ctime drift checks with size/mtime/content checks on bounded reads. - Preserve typed pre-write FxErrors in publishAppPackage and attach allowlisted recovery data instead of relabeling them. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Adds AC-tagged contract tests for token tenant/audience mismatch, identity lock conflicts and simultaneous preparations, interleaved two-tenant catalog requests, cancellation at read/poll/approval/settlement boundaries, deploy and submission refusal branches, driver input/output validation, and journal, source and artifact integrity checks. Timing tests use deferred fakes instead of wall-clock waits. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Exercise bounded archives, public assembly refusals, catalog validation, and durable mutation/preflight failures without changing coverage thresholds or runtime behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Bert Jansen (jansenbe)
marked this pull request as ready for review
November 10, 2026 20:15
Bert Jansen (jansenbe)
requested review from
Alive-Fish,
HuihuiWu-Microsoft,
qfai,
Qinzhou Xu (qinzhouxu),
Yu Zhang (summzhan),
Ning Tang (tecton) and
Alice Wang (wh-alice)
as code owners
November 10, 2026 20:15
Sébastien Levert (sebastienlevert)
left a comment
Contributor
There was a problem hiding this comment.
Automated review with GitHub Copilot of head 65322350e8b7a73b6c7b77cc9ac937c3d0861ef9 against base 0f174dfa8ab211614517a4a13fabdbfc99e06310. The 681 focused tests, source typecheck, and changed-production-file lint passed; the four findings below were reproduced with isolated offline probes. No live-tenant validation was performed.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Bert Jansen (jansenbe)
requested a review
from Sébastien Levert (sebastienlevert)
November 11, 2026 04:14
This branch has not been deployed
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
spfx/preparePublicationto inspect the completed SPPKG, extract the supported API plugin, remove the embedded agent package from a separate SharePoint deployment copy, prepare the authoritative app package, and persist SHA-256 lineage in a project-local journal.spfx/deployandteamsApp/publishAppPackageactions only when prepared-publication inputs are supplied. Requires explicit approval, checks identity/version/collisions, uses single-attempt writes, verifies SharePoint bytes and deployment before Graph submission, and blocks automatic replay after rejected or unknown writes.@microsoft/teamsfx-core/build/sharepointPackage:assembleSharePointApplicationPackage(input: AssembleSharePointApplicationPackageInput): Promise<Result<SharePointApplicationPackage, SharePointApplicationPackageError>>.Input is the authoritative
applicationPackage: Bufferplus selectedsharePointPackage: Buffer. Output includes application ZIP bytes/hash, source application/SPPKG hashes, plugin hash, app ID/version, product ID, managed reference kind/ID/path, and{ level: "local-structural", tenantNeutral: true }.{{TENANT_MCP_URL}}in the managed runtime URL. Tenant-bound preparation replaces that contribution in the staged M365 application ZIP using the verified catalog HTTPS origin and selected solution ID before hashing/submission; it does not broadly substitute unrelated text. Original application ZIP and SPPKG remain unchanged.agentConnectors[].toolSource.pluginregistration is supported only where the schema defines it (currentlydevPreview). GA through v1.30 fails withUnsupportedAgentConnectorManifestVersion. No automatic upgrade,remoteMcpServersubstitution, schema-invalid output, or synthetic agent. GA connector-only support is an unresolved future capability outside this draft by explicit decision.FxCoreClient.publishstill executes YAMLpublish:unchanged. Ordinary non-prepared behavior andpackages/cliremain unchanged; no WIQD source is included or modified.Spec and design
Acceptance criteria to tests
Historical validation at
65322350e8b7a73b6c7b77cc9ac937c3d0861ef9The following CI and full-suite evidence belongs to that earlier tests-only head; it is retained as history and is not claimed as validation of later commits.
Official CI results for this head
codecov/patch: SUCCESS — 91.62% of diff hit, target 88.88%.codecov/project: SUCCESS — 89.01%, reported +0.12% compared with0f174df.unit-testandscenario-tooling-windows.Local evidence (Node 22,
packages/fx-core)npm run test:unitpassed: 339 files passed, 1 skipped; 7,796 tests passed, 35 skipped, 1 todo, 0 failed. Full-package Istanbul coverage: lines 94.10%, statements 93.72%, branches 88.70%, functions 93.20%. The unchanged global coverage gate passed.0f174dfa8ab211614517a4a13fabdbfc99e06310: 91.62% (1,630/1,779), matching official Codecov. This calculation uses the LCOV union of line/branch locations on diff-added source lines and counts uncovered branches as partial/uncovered locations. It also reproduced the preceding live result 69.03% (1,228/1,779) before these tests.npm run buildpassed, including scenario-tooling type-check.eslint --quietandprettier --checkon all five changed test files passed. Test-tsconfig type-check reports zero errors in those five files; the complete test-tsconfig has errors elsewhere and is not claimed green.npm run lint -- --quietstill reports the unnecessary assertion atPluginManifestUtils.ts:407. This file is byte-identical to PR base0f174dfa: Git blob968da2160f7558905f32f9007f6ed69a8bfbd0d2in both base and head. It was not changed or suppressed.Assertion failed, previously traced to unchangedtests/component/provisionUtils.test.ts:9importing console.assert; this is not represented as a clean-output run.Earlier runtime corrections remain covered: tenant/audience verification before prepared writes, identity-lock error preservation, bounded-read change detection without metadata-only ctime false positives, deferred-HTTP settlement tests, interleaved catalog requests, and typed pre-write errors with recovery data. This follow-up changes none of those inputs. The separate ctime check in
openPlugin/fileSystem.ts:193remains untouched. A generator concurrency flake was observed historically; the current full run above passed.Separately disclosed gates
API upload/<default>). Both language jobs succeeded, but those successes and zero annotations are not a clean aggregate result. No suppression, permission broadening or workflow change.pr-titlefails until linked.Deferred gates and open questions
At the user's direction, vibe-coding human Gate 1 (resolve spec questions) and Gate 2 (approve the acceptance criteria) are deferred to draft review. Maintainers should review the ACs and decide:
{{TENANT_ORIGIN}}UI CSP fields; no field path is qualified, so no broad substitution is performed.GA connector-only registration is a future capability excluded from this draft by decision, not a pending decision for this draft.
Work item and follow-up
Current PR state at the latest refresh: open and not draft; this update does not change PR state. WEX PBI 3359458 is context only and does not satisfy
lint-pr; a qualifying ATK work item must be linked to clear the failingpr-titlecheck. Consumer-adapter adoption follows separately; this PR modifies ATK only.Latest reviewer follow-up —
a85ae56a70712c44ad540bcf0da1a678bc00db87Addressed all four Sebastien Levert inline findings; the threads are intentionally left unresolved for the PR author to resolve manually:
filevalues are relative to the referenced agent manifest, whilemanagedReference.entryPathseparately identifies the root-relative ZIP entry. Preparation/schema and artifact-lineage validation resolve references consistently. Transformation identity is v4; v2/v3 retain their prior root-path interpretation for compatibility.lastSharePointVerifiedStateis emitted only when durable upload and deployment states are bothconfirmed, not merely because the journal is terminal.cause; the error-data projection still exposes only allowlisted HTTP status, service code, and request ID.Verification at this head
fx-coretests: 5 files, 285 tests passed (packageFile,preparedRecovery,preparedPublication.contracts,preparedPublication.integration,preparedPublication).tsc -p . --incremental falseandtypecheck:scenario-tooling: passed.git diff --check: passed. Changed-file precommit (eslint --fix --quiet, Prettier) passed. Full package lint remains blocked by the same unrelatedteamsApp/utils/utils.ts:407unnecessary assertion; the file blob matchesorigin/dev(d3ec652b9b426f62a7732725cd4c277923cf5e26).unit-test, scenario-tooling, Analyze (C# and JavaScript),codecov/patch,codecov/project, and CLA passed; format, sensitive-content, and YAML lint were pending at the last refresh;pr-titlefailed because a qualifying ATK work item is missing; CodeQL was skipped. The historical CodeQL note below refers to an earlier head; it is not a result for this commit.a85ae56a70712c44ad540bcf0da1a678bc00db87is pushed to the existing PR branch. Precommit was run directly and passed; the commit hook itself could not launch/bin/bashin this Windows environment. No tenant operations were run. Existing unrelated worktree changes remain unstaged.