Граф коммитов

21367 Коммитов

Автор SHA1 Сообщение Дата
Sonali Deshpande 0c1886ec38
Revert "Default Runtime Request Header Wait Config and Telemetry (#22… (#22955)
Reverting this commit as it causes the FF/Loop pipeline to fail

[ADO
Task](https://dev.azure.com/fluidframework/internal/_workitems/edit/22460)
2024-11-01 09:17:06 -07:00
Michael Zhen e432720309
(docs): update force deployment condition for build docs (#22954)
previous shouldDeploy condition have not been included in deployment
condition. This variable has been updated to "forceDeployment" and
included back in the deployment condition.

shouldDeploy has been updated to check if release builds are the latest
version in its major version series.
2024-10-31 16:44:25 -07:00
Craig Macomber (Microsoft) 512e53f04e
tree: Make SchematizingSimpleTreeView implement TreeViewAlpha (#22953)
## Description

Make SchematizingSimpleTreeView implement TreeViewAlpha, and add some
helper types.
2024-10-31 23:22:21 +00:00
Noah Encke 62ae4c541b
Fix SharedTreeCore detached sequence numbers when loading into a detached tree (#22947)
## Description

It is possible to load a summary into a detached SharedTree. In this
case, the detached revision that is used to generate sequence IDs for
commits while detached must be updated to ensure that it doesn't
duplicate any of the sequence IDs already used in the summary. This PR
fixes the issue and also adds an assert when sequencing in the
EditManager to ensure that we don't sequence regressive sequence IDs.

This fix also allows us to trim the trunk when summarizing (without
breaking our fuzz tests), which reduces summary sizes especially for
detached trees with many synchronous edits.
2024-10-31 14:10:54 -07:00
Craig Macomber (Microsoft) 176335ce88
Tree: allow explicit construction of array and map nodes with no arguments (#22946)
## Description

See changeset for details.
2024-10-31 20:10:25 +00:00
Abram Sanderson 64d89bd2db
Improve DDS stress pipeline stage rendering (#22952)
## Description

Adjusts the `condition` parameter of
`include-conditionally-run-stress-test` to apply to the entire stage
rather than the test-running job. This improves the clarity from the
pipeline overview page, see most recent run vs previous ones:


![image](https://github.com/user-attachments/assets/e344d02a-a617-4163-bbda-0bfaac276541)

This also fixes the `stressMode` parameter not being given options at
queue time, which was introduced in #21702 and prevented the pipeline
from being queued.

---------

Co-authored-by: Abram Sanderson <absander@microsoft.com>
2024-10-31 12:28:53 -07:00
Joshua Smithrud 5709197b9b
build(docs): Hard-code redirects (#22949)
Updates website build to no longer dynamically generate
`fallback/index.js`. Instead, the redirects are hard-coded in
`fallback/routes.js`.

This work is in preparation for the Docusaurus migration.


[AB#19990](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/19990)
2024-10-31 19:12:57 +00:00
Abram Sanderson 929f76627a
Respect interval start & end side on ack (#22945)
## Description

Users of `IntervalCollection` can specify a start and end `side` when
adding or changing an interval. Doing so changes the behavior for the
resulting `start` and `end` local references put into the merge tree:
using the default `Side.Before` causes references to slide forward when
the segment they exist on is removed, whereas using `Side.After` causes
references to slide backward.

In the common case, local reference positions sliding is initiated by
removing a segment in merge-tree. However, `IntervalCollection` also
reuses this slide logic when intervals are changed/added concurrently to
a segment removal. This latter case did not correctly plumb through the
sliding preference to the helper function it used, which gave
undesirable merge semantics.

Resolves
[AB#22191](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/22191).

Co-authored-by: Abram Sanderson <absander@microsoft.com>
2024-10-31 07:57:44 -07:00
Kian Thompson 8a833a65db
Add more portions of the path to r11s request errors (#22943)
We can add more portions of the URL path on r11s request errors. To
protect against logging IDs in the URL, any path portion that does not
explicitly match the list of known paths will be replaced with
`REDACTED`.

Continuation of https://github.com/microsoft/FluidFramework/pull/22851

Fixes
[AB#22156](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/22156)
2024-10-31 00:01:06 +00:00
Noah Encke 522f76fc08
Remove leftover memory test (#22942)
## Description

Removes a redundant test that was accidentally checked in #22940
2024-10-30 21:11:15 +00:00
Craig Macomber (Microsoft) b669a6efdb
tree: `TreeNodeSchemaClass` now specifies its `TNode` as `TreeNode` (#22938)
## Description

This improves on #22763 to be slightly more specific in the case of
TreeNodeSchemaClass with an unspecified TNode parameter.
2024-10-30 13:40:59 -07:00
Vlad Sudzilouski d1ef767416
Better connection telemetry (#22936)
Collect more data (telemetry) to better understand number of concurrent users in the document.
In addition to capturing quorum size, capture audience size, as well as capture how many socket connections there were in a session
2024-10-30 13:39:20 -07:00
Noah Encke 4405bdc814
Don't run SharedTree memory usage test code during test discovery (#22940)
## Description

The tests unnecessarily initialize a SharedTree during test discovery.
This exercises many common code paths in SharedTree (creation, editing,
etc.). Breakpoints set in these areas will be hit during the discovery
of these memory tests, even if the memory tests are not being run. This
is annoying and confusing for development - for example, running any
(unrelated) single SharedTree test from the test browser will also run
the memory test initialization code and hit extraneous breakpoints.

This PR removes the unnecessary initialization code, which is (sneakily)
happening in a property initializer.
2024-10-30 20:10:22 +00:00
Kian Thompson ea2cb391e9
Convert assert 0x3d1 to DataProcessingError (#22920)
Convert the 0x3d1 assert to a DataProcessingError for better telemetry
purposes.

Fixes
[AB#7066](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/7066)
2024-10-30 13:02:22 -07:00
Tyler Butler 122e0822f2
build(build-cli): Upgrade jssm-viz and remove patch (#22941) 2024-10-30 13:02:08 -07:00
Craig Macomber (Microsoft) ce850b31b1
Rename or move some simple tree source files and tests (#22939)
## Description

Rename toFlexSchema to toStoredSchema to reflect that flex schema is no
longer a thing.
Rename/move tests to match what they are testing.
2024-10-30 12:50:18 -07:00
jzaffiro 30003a864a
Fix JSON format for service clients pipeline (#22935)
Add quotes to the new display name field in the FLUID_LOGGER_PROPS env
variable. Related to #22901, where the lack of quotes led to malformed
JSON.
2024-10-30 16:59:10 +00:00
Alex Villarreal c56a5218b8
refactor: Update dependencies so path-to-regexp gets to a version without CVE (#22928)
## Description

Updates our transitive dependencies on `path-to-regexp` to versions that
fixed https://nvd.nist.gov/vuln/detail/CVE-2024-45296 . Accomplished by
updating our direct dependencies on `sinon` to a mix of version 18 and
19, since that's the main way in which we get transitive dependencies on
`path-to-regexp`.

`@types/sinon` was also opportunistically updated to the latest version
where it wasn't already up to date.
2024-10-30 11:48:31 -05:00
Alex Villarreal 1edf5091de
refactor: Update transitive dependency on `tar` to address CVE (#22932)
## Description

Updates `tar` to version `6.2.1` to address
https://nvd.nist.gov/vuln/detail/CVE-2024-28863 . Done by adding a
`pnpm.overrides` entry `"tar": "^6.2.1"` to the package.json of each of
the affected packages, running `pnpm i --no-frozen-lockfile`, then
removing the override from package.json and running the same command
again.
2024-10-30 11:46:01 -05:00
Tyler Butler 9e1895bfe1
build(build-tools): Use fluid-build to build (#22925)
Updates the configuration for build-tools packages to use fluid-build to
build.

The changes were modest since it was already using fluid-build for most
of the build. Only the root-level tasks needed to be hooked up, and the
individual package scripts needed to be updated.

[AB#17062](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/17062)
2024-10-30 16:05:59 +00:00
Noah Encke 8d4f495760
Simplify and protect GraphCommit objects (#22931)
## Description

This PR improves GraphCommits in a couple of ways.

1. It adds a protective assert to the properties of commits that have
been trimmed by the EditManager. This prevents any part of our system
from accessing those commits without immediately throwing an error. This
will catch any bugs that try to hold on to stale graph commits much
sooner than they would otherwise be caught.
2. It removes the rollback property from GraphCommit and implements it
via a WeakMap instead. This is appropriate because the rollback property
is only used by a single scoped feature, so it need not be a property
that is visible to all other code that works with GraphCommits.
2024-10-29 20:59:36 -07:00
Noah Encke 34f6b6b29e
Delay edit manager trunk eviction when detached (#22930)
## Description

When a SharedTree is detached and submits a change, this schedules the
subsequent advancement of the EditManager's minimum sequence number on
the JS microtask queue rather than doing it immediately/synchronously.
Doing it synchronously is problematic because advancing the minimum
sequence number might cause trunk commits to be evicted, however, this
is happening in an event callback context - `submitCommit` is being
called as a result of the `afterChange` event being fired on the local
branch. If trunk eviction were to occur immediately, it would mean that
other listeners to the `afterChange` event might experience different
trunks (some before trimming, others after trimming). In practice, this
is a problem when generating revertibles, as revertibles respond to the
`afterChange` event by creating branches - but the bases of these
branches may or may not have already been trimmed by the aforementioned
behavior. Delaying the trimming guarantees that all listeners to the
`afterChange` event can safely reference any commits that they may
already have handles to.
2024-10-29 16:41:44 -07:00
Tyler Butler 2d98e6cc68
fix(release): Check release notes and changelog generation in release tool (#22811)
Adds steps to the release tool to check that release notes have been
generated and that the per-package changelogs have been updated. Also
prompts the user for a bump type earlier in the process if needed.

The changelog step is not trivial to check, so I just prompt the user to
select whether they did it. Not ideal, but at least the tool will remind
the release driver that this step is needed. We can add a more complete
check in the future if needed.

---------

Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
2024-10-29 15:28:45 -07:00
Craig Macomber (Microsoft) 4a730a0f3a
tree: Const schema type parameters, more tests tree and misc cleanups (#22927)
## Description

A collection of minor improvements split out from
https://github.com/microsoft/FluidFramework/pull/22566 for simplified
and more targeted review.
2024-10-29 21:46:41 +00:00
Kian Thompson 2f1175f167
Include service URL and request method in r11s request errors (#22851)
Troubleshooting live-site issues and customer reported issues will
become easier. Ex: If Container creation failures have service URL and
response code, it'll be easier to identify point of failure and come-up
with a fix to mitigate/fix the incident.

This gives AFR a good idea about the APIs which are failing, which
cluster it was going to, and which cluster group it was going to. It
helps AFR correlate the errors on the server better.

## Examples

Here are some examples of request calls. Only the bolded parts can be
logged, and the first line of each entry below is just the type of
request being made (no need to log it):

**CreateDocument** (or **CreateContainer**)
**POST** https://**us.fluidrelay.azure.com/documents**/someId

**Connect**  
**GET**
https://**alfred.southcentralus-1.fluidrelay.azure.com/socket.io**/?documentId=someId&tenantId=someId&EIO=4&transport=websocket
 
**GetDelta**  
**GET**
https://**alfred.southcentralus-1.fluidrelay.azure.com/deltas**/someId/someId?from=0&to=2001

**GetSummary**  
**GET**
https://**historian.southcentralus-1.fluidrelay.azure.com/repos**/someId/git/summaries/latest?token=someToken&disableCache=true

**PostSummary**  
**POST**
https://**historian.southcentralus-1.fluidrelay.azure.com/repos**/someId/git/summaries?token=someToken

**FindSession** – **First Request**
**POST**
https://**alfred.southcentralus-1.fluidrelay.azure.com/documents**/someId/session/someId

Fixes
[AB#18452](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/18452)
2024-10-29 14:45:01 -07:00
Craig Macomber (Microsoft) 645b9ed695
tree: handle schema contravariantly when generating input types (#22874)
## Description

Handle schema contravariantly when generating input types.

## Breaking Changes

No runtime changes, but typing tweaks could break users on non-exact
schema, and the enum schema APIs have been tweaked to avoid relying on
non-exact schema, see changeset.
2024-10-29 13:02:32 -07:00
Craig Macomber (Microsoft) a1b4cdd45e
Fix libCheck (#22923)
## Description

While neither of these compile errors are in the `@public` API surface,
they could impact customers using the public API due to how `libCheck`
works and how Fluid Framework handles it's API exports.

See changeset for details.

I have filed
https://dev.azure.com/fluidframework/internal/_workitems/edit/21856 to
internally track that this was not detected by the CI of FF or FF
examples.
2024-10-29 12:12:20 -07:00
Tyler Butler 34e16dd44f
improvement(build-cli): Remove node-fetch dependency (#22832)
node-fetch is not actually used in build-cli because Node 18+ supports
fetch natively, and we weren't importing from node-fetch anyway.
2024-10-29 12:06:12 -07:00
Tyler Butler bea83a6c94
refactor(build-infrastructure): Make package manager install command an array of args (#22918)
The package manager's install command was a string, but an array of args
is better since we were splitting the string anyway.
2024-10-29 12:05:27 -07:00
Navin Agarwal 0b1ce2b38f
Op bunching 3: Bunch contiguous ops for DDS in a batch - DDS part (#22841)
## Reviewer guidance
This is part 3 or 3 of the op bunching feature. This part focuces on the
changes in the DDS. [Part
1](https://github.com/microsoft/FluidFramework/pull/22839) and [part
2](https://github.com/microsoft/FluidFramework/pull/22840).

## Problem
During op processing, container runtime sends ops one at a time to data
stores to DDSes. If a DDS has received M contiguous ops as part of a
batch, the DDS is called M times to process them individually. This has
performance implications for some DDSes and they would benefit from
receiving and processing these M ops together.

Take shared tree for example:
For each op received which has a sequenced commit, all the pending
commits are processed by the rebaser. So, as the number of ops received
grows, so does the processing of pending commits. The following example
describes this clearly:
Currently if a shared tree client has N pending commits which have yet
to be sequenced, each time that client receives a sequenced commit
authored by another client (an op), it will update each of its pending
commits which takes at least O(N) work.
Instead, if it receives M commits at once, it could do a single update
pass on each pending commit instead of M per pending commit.
It can compose the M commits together into a single change to update
over, so it can potentially go from something like O (N * M) work to O
(N + M) work with batching.

## Solution - op bunching
The solution implemented here is a feature called "op bunching".
With this feature, contiguous ops in a grouped op batch that belong to a
data store / DDS will be bunched and sent to it in an array - The
grouped op is sent as an `ISequencedMessageEnvelope` and the individual
message `contents` in it are sent as an array along with the
`clientSequenceNumber` and `localOpMetadata`.
The container runtime will send bunch of contiguous ops for each data
store to it. The data store will send bunch of contiguous ops for each
DDS to it. The DDS can choose how to process these ops. Shared tree for
instance, would compose the commits in all these ops and update pending
commits with it.
Bunching only contiguous ops for a data store / DDS in a batch preserves
the behavior of processing ops in the sequence it was received.

Couple of behavior changes to note:
1. Op events - An implication of this change is the timing of "op"
events emitted by container runtime and data store runtime will change.
Currently, these layers emit an "op" event immediately after an op is
processed. With this change, an upper layer will only know when a bunch
has been processed by a lower layer. So, it will emit "op" events for
individual ops in the bunch after the entire bunch is processed.
From my understanding, this should be fine because we do not provide any
guarantee that the "op" event will be emitted immediately after an op is
processed. These events will be emitted in order of op processing and
(sometime) after the op is processed.
Take delta manager / container runtime as an example. Delta manager
sends an op for processing to container runtime and emits the "op"
event. However, container runtime may choose to not process these ops
immediately but save them until an entire batch is received. This change
was made but was reverted due to some concerns not related to the topic
discussed here - https://github.com/microsoft/FluidFramework/pull/21785.
The chang here is similar to the above behavior where an upper layer
doesn't know and shouldn't care what lower layers do with ops.
2. `metadata` property on message - With this PR, the metadata property
is removed from a message before it's sent to data stores and DDS. This
is because we now send one common message (the grouped op) and an array
of contents. Individual messages within a grouped op have batch begin
and end metadata but they are just added by the runtime to keep it like
old batch messages. The data store and DDS don't care about it so
removing them should be fine.


[AB#20123](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/20123)
2024-10-29 11:18:41 -07:00
Tony Murphy 550286da29
Fix handle resolution bug and add test for synchronous datastore creation (#22917)
Adding a test that attempts to create a new datastore as synchronously
as possible. In the process of creating this test, i noticed a bug in
the handle resolution code, where handles to datastores would fail to
resolve, unless customer request logic, like in data object, is used. It
should not be necessary to use custom request logic, as it is pattern
the runtime has been moving away from. To fix this I've added handling
to the datastore runtime such that it returns the entrypoint when the
request is via a handle, and has no sub-path.
2024-10-29 17:48:55 +00:00
Alex Villarreal 1852ac5cb7
refactor: Update puppeteer to latest version to address CVE (#22898)
## Description

Update puppeteer to latest version so it brings in `ws@8.17.x` (instead
of `8.16`) to address https://nvd.nist.gov/vuln/detail/CVE-2024-37890.

The [breaking changes from `puppeteer` 22 to
23](https://github.com/puppeteer/puppeteer/releases/tag/puppeteer-v23.0.0)
don't affect us as far as I can tell, but I had to update
`jest-puppeteer` to its latest version (and it made sense to update
`jest-environment-puppeteer` as well) for jest tests to pass again.
Otherwise I was getting errors like this:

```console
 FAIL  dist/test/jest/buffer.spec.js
  ● Test suite failed to run

    TypeError: global.context.isIncognito is not a function

      at closeContext (node_modules/.pnpm/jest-environment-puppeteer@9.0.2_typescript@5.4.5/node_modules/jest-environment-puppeteer/dist/index.js:210:24)
```
2024-10-29 12:18:50 -05:00
Tyler Butler d521597e7d
build(build-tools): Upgrade most dependencies to latest semver-compatible version (#22916)
Updates the dependencies in build-tools to the latest semver-compatible
versions.
2024-10-29 09:51:02 -07:00
Noah Encke 381a70f96d
Fix bug in EditManager fast forwarding step (#22921)
## Description

This fixes a bug in which the sequence numbers associated with local
branches could be advanced when they shouldn't have been. This allowed
commits from those branches to be garbage collected while the branches
were still alive.
2024-10-29 09:44:31 -07:00
Tyler Butler 199b9d0512
feat(build-infrastructure): Add default implementations for core interfaces (#22865)
This change adds default implementations of the `IFluidRepo`,
`IWorkspace`, `IReleaseGroup`, and `IPackage` interfaces. These
implementations are sufficient for most uses in build-tools and
build-cli. They may be further extended for specific scenarios in future
changes.

I disabled the TypeDoc generation in this PR to make the code changes
easier to review. Once this series of PRs lands, we can enable TypeDoc
or api-markdown-documenter and regen the docs.

---------

Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
2024-10-28 17:00:48 -07:00
Jatin Garg 59441f3636
Add socker error handling for r11s (#22864)
## Description


[AB#18937](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/18937)

Implement error handling for the following errors sent by AFR over the
socket.

1.) For Cluster Draining:
error =  {
code: 503,
canRetry?: true;
message?: "Cluster is not available. Please retry later.";
retryAfter?: number;
retryAfterMs?: number;
internalErrorCode?:ClusterDraining;
}

2.) Token Revoked:
error =  {
code: 401/403,
canRetry?: false;
message?: "Permission denied. Token has been revoked.";
internalErrorCode?:TokenRevoked;
}

---------

Co-authored-by: Jatin Garg <jatingarg@Jatins-MacBook-Pro-2.local>
2024-10-28 15:56:21 -07:00
Navin Agarwal 2e5b969d3a
Op bunching 2: Bunch contiguous ops for data store in a batch - data store part (#22840)
## Reviewer guidance
This is part 2 or 3 of the op bunching feature. This part focuces on the
changes in data store. Part 1 - #22839

## Problem
During op processing, container runtime sends ops one at a time to data
stores to DDSes. If a DDS has received M contiguous ops as part of a
batch, the DDS is called M times to process them individually. This has
performance implications for some DDSes and they would benefit from
receiving and processing these M ops together.

Take shared tree for example:
For each op received which has a sequenced commit, all the pending
commits are processed by the rebaser. So, as the number of ops received
grows, so does the processing of pending commits. The following example
describes this clearly:
Currently if a shared tree client has N pending commits which have yet
to be sequenced, each time that client receives a sequenced commit
authored by another client (an op), it will update each of its pending
commits which takes at least O(N) work.
Instead, if it receives M commits at once, it could do a single update
pass on each pending commit instead of M per pending commit.
It can compose the M commits together into a single change to update
over, so it can potentially go from something like O (N * M) work to O
(N + M) work with batching.

## Solution - op bunching
The solution implemented here is a feature called "op bunching".
With this feature, contiguous ops in a grouped op batch that belong to a
data store / DDS will be bunched and sent to it in an array - The
grouped op is sent as an `ISequencedMessageEnvelope` and the individual
message `contents` in it are sent as an array along with the
`clientSequenceNumber` and `localOpMetadata`.
The container runtime will send bunch of contiguous ops for each data
store to it. The data store will send bunch of contiguous ops for each
DDS to it. The DDS can choose how to process these ops. Shared tree for
instance, would compose the commits in all these ops and update pending
commits with it.
Bunching only contiguous ops for a data store / DDS in a batch preserves
the behavior of processing ops in the sequence it was received.

Couple of behavior changes to note:
1. Op events - An implication of this change is the timing of "op"
events emitted by container runtime and data store runtime will change.
Currently, these layers emit an "op" event immediately after an op is
processed. With this change, an upper layer will only know when a bunch
has been processed by a lower layer. So, it will emit "op" events for
individual ops in the bunch after the entire bunch is processed.
From my understanding, this should be fine because we do not provide any
guarantee that the "op" event will be emitted immediately after an op is
processed. These events will be emitted in order of op processing and
(sometime) after the op is processed.
Take delta manager / container runtime as an example. Delta manager
sends an op for processing to container runtime and emits the "op"
event. However, container runtime may choose to not process these ops
immediately but save them until an entire batch is received. This change
was made but was reverted due to some concerns not related to the topic
discussed here - https://github.com/microsoft/FluidFramework/pull/21785.
The chang here is similar to the above behavior where an upper layer
doesn't know and shouldn't care what lower layers do with ops.
2. `metadata` property on message - With this PR, the metadata property
is removed from a message before it's sent to data stores and DDS. This
is because we now send one common message (the grouped op) and an array
of contents. Individual messages within a grouped op have batch begin
and end metadata but they are just added by the runtime to keep it like
old batch messages. The data store and DDS don't care about it so
removing them should be fine.


[AB#20123](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/20123)
2024-10-28 15:43:36 -07:00
jzaffiro 362f1ada4a
Add intuitive pipeline names in telemetry events for stress/e2e test runs (#22901)
Instead of only using the package name to distinguish between stress
test runs and end to end test runs, add a more distinct identifier to
the `details` field in Kusto.

<img width="733" alt="image"
src="https://github.com/user-attachments/assets/9b465f4e-a7f5-46ce-8ba3-4b990b9c4607">


[AB#11817](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/11817)

---------

Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
2024-10-28 22:03:22 +00:00
Tyler Butler 55bed2d6c6
build(build-tools): Upgrade mocha to latest version (#22907)
Upgrades mocha to the latest version, which is a minor bump, and update
the types to 10.x since they were still at 9.x.
2024-10-28 19:29:42 +00:00
Tyler Butler 952fafe839
build(build-cli): Upgrade inquirer to @inquirer/prompts (#22903)
Inquirer has been rewritten and released as `@inquirer/prompts`, so this
PR upgrades the few inquirer uses we have to the new version.

We also use another prompt library in build-cli, `prompts`, and I think
we can likely replace it with the new inquirer, but I left that for
another change.
2024-10-28 12:19:20 -07:00
Navin Agarwal 9127d9f3c6
Op bunching 1: Bunch contiguous ops for data store in a batch - Runtime part (#22839)
## Reviewer guidance
This is part 1 or 3 of the op bunching feature. The PR with the
end-to-end feature is
https://github.com/microsoft/FluidFramework/pull/22686. It has been
broken down for simpler review process.
This part focuces on the changes in the Runtime layer.

Note - This change breaks the snapshot tests because old snapshots with
merge tree had "catchupOps" blobs which contained ops. Now that
"metadata" property is not sent to DDS, comparing snapshots fails
because of the metadata property not present in latest snapshots for
these merge tree instances. A code change is done in snapshot normalizer
for this.

## Problem
During op processing, container runtime sends ops one at a time to data
stores to DDSes. If a DDS has received M contiguous ops as part of a
batch, the DDS is called M times to process them individually. This has
performance implications for some DDSes and they would benefit from
receiving and processing these M ops together.

Take shared tree for example:
For each op received which has a sequenced commit, all the pending
commits are processed by the rebaser. So, as the number of ops received
grows, so does the processing of pending commits. The following example
describes this clearly:
Currently if a shared tree client has N pending commits which have yet
to be sequenced, each time that client receives a sequenced commit
authored by another client (an op), it will update each of its pending
commits which takes at least O(N) work.
Instead, if it receives M commits at once, it could do a single update
pass on each pending commit instead of M per pending commit.
It can compose the M commits together into a single change to update
over, so it can potentially go from something like O (N * M) work to O
(N + M) work with batching.

## Solution - op bunching
The solution implemented here is a feature called "op bunching".
With this feature, contiguous ops in a grouped op batch that belong to a
data store / DDS will be bunched and sent to it in an array - The
grouped op is sent as an `ISequencedMessageEnvelope` and the individual
message `contents` in it are sent as an array along with the
`clientSequenceNumber` and `localOpMetadata`.
The container runtime will send bunch of contiguous ops for each data
store to it. The data store will send bunch of contiguous ops for each
DDS to it. The DDS can choose how to process these ops. Shared tree for
instance, would compose the commits in all these ops and update pending
commits with it.
Bunching only contiguous ops for a data store / DDS in a batch preserves
the behavior of processing ops in the sequence it was received.

Couple of behavior changes to note:
1. Op events - An implication of this change is the timing of "op"
events emitted by container runtime and data store runtime will change.
Currently, these layers emit an "op" event immediately after an op is
processed. With this change, an upper layer will only know when a bunch
has been processed by a lower layer. So, it will emit "op" events for
individual ops in the bunch after the entire bunch is processed.
From my understanding, this should be fine because we do not provide any
guarantee that the "op" event will be emitted immediately after an op is
processed. These events will be emitted in order of op processing and
(sometime) after the op is processed.
Take delta manager / container runtime as an example. Delta manager
sends an op for processing to container runtime and emits the "op"
event. However, container runtime may choose to not process these ops
immediately but save them until an entire batch is received. This change
was made but was reverted due to some concerns not related to the topic
discussed here - https://github.com/microsoft/FluidFramework/pull/21785.
The chang here is similar to the above behavior where an upper layer
doesn't know and shouldn't care what lower layers do with ops.
2. `metadata` property on message - With this PR, the metadata property
is removed from a message before it's sent to data stores and DDS. This
is because we now send one common message (the grouped op) and an array
of contents. Individual messages within a grouped op have batch begin
and end metadata but they are just added by the runtime to keep it like
old batch messages. The data store and DDS don't care about it so
removing them should be fine.
This also results in the "snapshot test" failing as explained before and
this PR contains a fix for that.


[AB#20123](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/20123)
2024-10-28 11:13:27 -07:00
Alex Villarreal b30731fbad
refactor: Cleanup references to markdown-magic-template in lockfiles (#22906)
## Description

Cleanup references to markdown-magic-template from lockfiles.

These projects have a `file:` reference to `@fluid-tools/markdown-magic`
in their package json. The only way I could find to clean up the
lockfile entries corresponding to the dependency tree for the dependency
that we removed in `@fluid-tools/markdown-magic` was to manually delete
that line from the lockfile in these packages and run `pnpm i
--no-frozen-lockfile` after.
2024-10-25 18:24:26 -05:00
Tyler Butler 0ec024d366
build(build-tools): Upgrade danger to 12.x (#22904)
Upgrades danger to the latest major release. According to [the release
notes](https://github.com/danger/danger-js/releases/tag/12.0.1) the
breaking change was to remove support for node<18, so I don't expect
issues.
2024-10-25 16:02:35 -07:00
WillieHabi 364d9b5cb7
fix(client): make IAudienceEvents intersectable (#22805)
## Description
In preparation for adding `attendeeDisconnected` support for Presence.
We'll be using same support Audience uses to monitor disconnects and
announce them.

This PR keep IAudienceEvents "removeMember" and "addMember" distinct
such that interfaces with similar capabilities may be intersected.

---------

Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
2024-10-25 15:27:17 -07:00
Alex Villarreal 8b77d3987e
refactor: Remove unnecessary dep in `@fluid-tools/markdown-magic` (#22900)
## Description

`markdown-magic-template` is not used at all as far as I can tell, and
it brings in a transitive dependency on `lodash.template: 4.5.0` which
is flagged with a CVE that can't be addressed easily because `lodash`
seems to have stopped publishing each of their functions as a separate
package after 4.5.0.
2024-10-25 17:13:08 -05:00
Tyler Butler 4bf641d537
build(build-tools): Upgrade oclif dependencies to latest (#22899)
Upgrades oclif dependencies to the latest versions. All updates were
minor or patch.
2024-10-25 13:49:00 -07:00
Tyler Butler c4560a7e74
build(build-tools): Upgrade jssm and jssm-viz, patch jssm-viz (#22880)
The latest release of jssm includes the fixes in
https://github.com/StoneCypher/jssm/pull/569, so our patch is no longer
needed and has been removed. However, the jssm-viz package has a similar
problem (open PR: https://github.com/StoneCypher/jssm-viz/pull/54) so I
patched it with type changes similar to what was done for jssm
originally.

If or when the jssm-viz PR is accepted or the issue is otherwise fixed,
we can remove the patch.
2024-10-25 16:17:04 +00:00
Alex Villarreal c8ea391f49
refactor: Update dependency on cookie to address CVE (#22847)
## Description

Updates the `cookie` dependency to address [a
[CVE](https://nvd.nist.gov/vuln/detail/CVE-2021-23368) in the `cookie`
package](https://nvd.nist.gov/vuln/detail/CVE-2024-47764). This required
updating `express` since it declares a hardcoded (no range) dependency
on `cookie`.
2024-10-25 10:40:56 -05:00
Tyler Butler dbfa05941e
test(build-cli): Upgrade oclif-test (#22705)
oclif-test underwent some major changes in its latest release. Tests in
build-tools have been updated with new patterns to account for the
changes. The changes were informed by [the oclif-test migration
guide](https://github.com/oclif/test/blob/main/MIGRATION.md).

Most of the conversion was straightforward except for tests that use env
variables. For those, I used
[mocked-env](https://www.npmjs.com/package/mocked-env). The tests still
use mocha/chai.
2024-10-25 01:47:02 +00:00
Tyler Butler 11c535aed3
build(build-tools): Upgrade @octokit/core to 5.x (#22887)
Upgrades @octokit/core to v5, which should have no effect on our uses.
The breaking changes are mostly related to dropping node support:
https://github.com/octokit/core.js/releases/tag/v5.0.0

I could have gone to v6 but there are some other deps in the tree with
peer deps on v5, and the main change in v6 is that it went ESM-only.
2024-10-24 18:38:00 -07:00