-
Notifications
You must be signed in to change notification settings - Fork 549
(tree) Unify summarize and getAttachSummary methods on summarizables #24761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(tree) Unify summarize and getAttachSummary methods on summarizables #24761
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR unifies the summarization interface by removing getAttachSummary
, making summarize
synchronous, and adding a fullTree
flag and incremental context propagation.
- Replace all
getAttachSummary
methods and calls with the new synchronoussummarize
signature - Add an optional
fullTree
parameter tosummarizeCore
and propagate it throughSharedTreeCore
, kernel, and public APIs - Update tests and feature-libraries to use
summarize
and wire up incremental summary paths
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
packages/dds/tree/src/test/shared-tree-core/sharedTreeCore.spec.ts | Removed summarizeAsync , updated mock to use summarize , and adjusted event interface |
packages/dds/tree/src/test/feature-libraries/chunked-forest/chunkEncodingEndToEnd.spec.ts | Replaced getAttachSummary with summarize in forest end-to-end tests |
packages/dds/tree/src/shared-tree-core/sharedTreeCore.ts | Added fullTree argument, and prepend each summarizable’s path in the incremental context |
packages/dds/tree/src/shared-tree-core/sharedTreeCore.ts (interface) | Dropped getAttachSummary declaration and updated summarize signature |
packages/dds/tree/src/shared-tree-core/editManagerSummarizer.ts | Renamed getAttachSummary to summarize , removed async stub |
packages/dds/tree/src/feature-libraries/schema-index/schemaSummarizer.ts | Made summarize sync, defaulted fullTree , and updated incremental path logic |
packages/dds/tree/src/feature-libraries/forest-summary/forestSummarizer.ts | Renamed to synchronous summarize and accept incremental context |
packages/dds/tree/src/feature-libraries/detachedFieldIndexSummarizer.ts | Renamed to synchronous summarize and accept incremental context |
packages/dds/shared-object-base/src/sharedObjectKernel.ts | Added fullTree parameter to kernel’s summarizeCore call |
packages/dds/shared-object-base/src/sharedObject.ts | Propagated fullTree through public summarize into summarizeCore |
packages/dds/shared-object-base/api-report/shared-object-base.legacy.alpha.api.md | Updated API report to include new fullTree parameter in summarizeCore signature |
.changeset/loud-dolls-appear.md | Documented the new fullTree parameter in the release notes |
packages/dds/tree/src/feature-libraries/schema-index/schemaSummarizer.ts
Show resolved
Hide resolved
packages/dds/tree/src/feature-libraries/schema-index/schemaSummarizer.ts
Outdated
Show resolved
Hide resolved
packages/dds/shared-object-base/api-report/shared-object-base.legacy.alpha.api.md
Show resolved
Hide resolved
packages/dds/tree/src/feature-libraries/schema-index/schemaSummarizer.ts
Show resolved
Hide resolved
.changeset/loud-dolls-appear.md
Outdated
"@fluidframework/shared-object-base": minor | ||
"__section": legacy | ||
--- | ||
Added an optional boolean parameter `fullTree` to `SharedObject`'s `summarizeCore` method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our most recent guidance for changeset titles is to not use inlineCode
syntax (to prevent the generated changelogs from appearing too noisy). This still needs to be documented in a more accessible place, but here are the guidelines we're using when reviewing: https://eng.ms/docs/experiences-devices/opg/office-shared/fluid-framework/fluid-framework-internal/fluid-framework/docs/on-call/release/release-prep
Added an optional boolean parameter `fullTree` to `SharedObject`'s `summarizeCore` method | |
Added an optional boolean parameter "fullTree" to SharedObject's summarizeCore method |
.changeset/loud-dolls-appear.md
Outdated
Added an optional boolean parameter `fullTree` to `SharedObject`'s `summarizeCore` method | ||
|
||
This parameter tells the shared object that it should generate a full tree summary, i.e., it must not summarize incrementally. | ||
Currently no known SharedObjects's do incremental summaries; however any that do exist or are made in the future must take this "fullTree" parameter into consideration to function correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit (we do like inlineCode
syntax in the changeset body when referring to APIs)
Currently no known SharedObjects's do incremental summaries; however any that do exist or are made in the future must take this "fullTree" parameter into consideration to function correctly. | |
Currently no known `SharedObjects`'s do incremental summaries; however, any that do exist or are made in the future must take this "fullTree" parameter into consideration to function correctly. |
/** | ||
* {@inheritDoc @fluidframework/datastore-definitions#(IChannel:interface).summarize} | ||
* @param stringify - Serializes the contents of the component (including {@link (IFluidHandle:interface)}s) for storage. | ||
* @param fullTree - flag indicating whether the attempt should generate a full |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can we call out the default value explicitly here? Also, I'm pushing for us to use full sentence casing consistently when possible.
* @param fullTree - flag indicating whether the attempt should generate a full | |
* @param fullTree - A flag indicating whether the attempt should generate a full |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still some active suggestions that I think would be good, but approving for tree.
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
@Josmithr Could you please review this PR again. I addressed your comments. |
Description
This PR makes the following changes:
getAttachSummary
method fromSummarizable
in shared tree and replaces it with the existingsummarize
method.These methods are supposed to be used in two different scenarios -
getAttachSummary
for the summary that is synchronously generated during container attach andsummarize
for the summary that is asynchronously generated during regular summarization in case tree wants to support async summarization for scenarios like virtualization.However, currently only
getAttachSummary
is used in both these scenarios since DDSes do not do async summarization. Some of the summarizables implement both of these methods and some only implement one of them. This leads to some confusion and also using the method "getAttachSummary" for regular summarization is also misleading.So, this PR keeps the
summarize
method and makes in syncronous. The async version of this method can be added later when it is needed.fullTree
param to thesummarizeCore
method inSharedObject
. This is needed for tree (or any DDS) to support incremental summarization. If this param is true, a full tree must be generated without any incrementality.SharedTreeCore
'ssummarizeCore
method, append the sub-tree path's to the incremental summary context before passing it to the individual summarizables. This will keep the logic in one place without having each summarizable do it and also, the summarizables shouldn't know about its parent's incremental summary details.AB#40395