Skip to content
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

Remove back-compat code related to the op reentry checks #22842

Merged
merged 12 commits into from
Nov 14, 2024

Conversation

MarioJGMsoft
Copy link
Contributor

@MarioJGMsoft MarioJGMsoft commented Oct 17, 2024

Fixes: AB#2309

Description

In light of Remove ability to reject reentrant ops (#20621) · microsoft/FluidFramework@c9d1562 (github.com), updating this to be about finishing the removal of ensureNoDataModelChanges.

The following uses of ensureNoDataModelChanges will be removed:

  • packages\runtime\container-runtime\src\channelCollection.ts:

    • ensureNoDataModelChanges: (...args) => {
  • packages\runtime\container-runtime\src\dataStoreContext.ts:

    • public ensureNoDataModelChanges(callback: () => T): T {
  • packages\runtime\runtime-definitions\src\dataStoreContext.ts:

    • ensureNoDataModelChanges(callback: () => T): T;
  • packages\runtime\test-runtime-utils\src\mocksDataStoreContext.ts:

    • public ensureNoDataModelChanges(callback: () => T): T {

@github-actions github-actions bot added area: runtime Runtime related issues base: main PRs targeted against main branch labels Oct 17, 2024
@github-actions github-actions bot added area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: tests Tests to add, test infrastructure improvements, etc labels Oct 17, 2024
@MarioJGMsoft MarioJGMsoft requested a review from a team as a code owner October 17, 2024 22:52
@github-actions github-actions bot added the public api change Changes to a public API label Oct 17, 2024
@MarioJGMsoft MarioJGMsoft requested review from a team, pragya91, markfields, jatgarg, tyler-cai-microsoft, kian-thompson and rajatch-ff and removed request for a team October 17, 2024 22:54
@MarioJGMsoft MarioJGMsoft linked an issue Oct 17, 2024 that may be closed by this pull request
Copy link
Collaborator

@msfluid-bot msfluid-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Coverage Summary

↑ packages.runtime.container-runtime.src:
Line Coverage Change: 0.02%    Branch Coverage Change: No change
Metric NameBaseline coveragePR coverageCoverage Diff
Branch Coverage 92.90% 92.90% → No change
Line Coverage 94.53% 94.55% ↑ 0.02%

Baseline commit: 952e805
Baseline build: 306581
Happy Coding!!

Code coverage comparison check passed!!

@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Oct 17, 2024

@fluid-example/bundle-size-tests: -347 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 465.86 KB 465.75 KB -113 Bytes
azureClient.js 563.18 KB 563.09 KB -99 Bytes
connectionState.js 724 Bytes 724 Bytes No change
containerRuntime.js 262.48 KB 262.35 KB -134 Bytes
fluidFramework.js 426.99 KB 427.01 KB +14 Bytes
loader.js 134.18 KB 134.19 KB +14 Bytes
map.js 42.71 KB 42.71 KB +7 Bytes
matrix.js 149.84 KB 149.85 KB +7 Bytes
odspClient.js 528.97 KB 528.88 KB -99 Bytes
odspDriver.js 97.88 KB 97.9 KB +21 Bytes
odspPrefetchSnapshot.js 42.81 KB 42.83 KB +14 Bytes
sharedString.js 165.77 KB 165.78 KB +7 Bytes
sharedTree.js 417.45 KB 417.46 KB +7 Bytes
Total Size 3.37 MB 3.37 MB -347 Bytes

Baseline commit: 952e805

Generated by 🚫 dangerJS against 5a45ae4

Comment on lines 303 to -306
// (undocumented)
ensureNoDataModelChanges<T>(callback: () => T): T;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This technically should have been marked as deprecated before now. To be completely strict we would not remove this from the mock until properly deprecated. This is test-runtime-utils and maybe there is a different contract there. I will let API CR make final call.

Copy link
Contributor

@Josmithr Josmithr Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless there is a reason we have to remove this in this PR and we are confident that none of our partners are using it (beyond just Loop), then I think it would be best to stick to the process and retain this as deprecated for future removal.

I see that we had an internal-facing comment noting it would be removed in 2.0, but our customers would have had no awareness of this, so I think it's worth erring on the side of caution.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, it seems like "ensureNoDataModelChanges" was deprecated on the interface and now he is removing it from the interface and classes.
Is it wrong to do so? In order to remove it, should it be marked as deprecated on interfaces and all classes implementing that interface?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jason-ha and @Josmithr Please take a look at this comment when you get time. We need to complete this breaking change PR by next week. Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, missed the earlier responses. Yes, strictly speaking any implementation of the interface that declares the same properties should also mark the members as deprecated. There is nothing stopping MockFluidDataStoreContext from continuing to expose a ensureNoDataModelChanges member even if the interface it extends plans to remove it from the interface. So, to be explicit, any implementations for which the member is deprecated should be marked so as well.

Unless there is an urgent need to remove this, it would probably be better to mark the appropriate implementation members as @deprecated and add them to the issue tracking @legacy breaks we plan to make in 2.20.

I don't think there is anything stopping us from removing the deprecated interface member, though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be okay making an exception for this one since the expected use is for mock to be used in places that would use ensureNoDataModelChanges via interface. Technically, we should have deprecated before and should wait, but I would be surprised if there is fallout.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Josmithr, are you also okay with this exception? Latest version has this removed per @jatgarg's suggestion to go the exception route.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarioJGMsoft, please make sure you have tested a build with these changes using the FF+Loop integration process. Reply with the build results link. Thanks!
Reference docs: https://eng.ms/docs/experiences-devices/opg/office-shared/fluid-framework/fluid-framework-internal/fluid-framework/docs/dev/monitoring/ff-loop-testing

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Josmithr, are you also okay with this exception? Latest version has this removed per @jatgarg's suggestion to go the exception route.

I don't have a strong opinion either way. Introducing a break to something with "Mock" in the name seems safer than most alternatives, so I don't see any harm in it. But I do think we should generally try to be consistent with this stuff. 🤷‍♂️

@github-actions github-actions bot removed area: tests Tests to add, test infrastructure improvements, etc area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct labels Nov 12, 2024
Copy link
Contributor

@jason-ha jason-ha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be sure to add a changeset for the removals and if we go with deprecation for the mock, then a deprecation note for it.

Comment on lines 303 to -306
// (undocumented)
ensureNoDataModelChanges<T>(callback: () => T): T;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be okay making an exception for this one since the expected use is for mock to be used in places that would use ensureNoDataModelChanges via interface. Technically, we should have deprecated before and should wait, but I would be surprised if there is fallout.

@MarioJGMsoft MarioJGMsoft requested a review from a team as a code owner November 12, 2024 18:11
.changeset/icy-webs-help.md Outdated Show resolved Hide resolved
@jason-ha
Copy link
Contributor

I think PR description should be updated. It seems to reference past things rather than describe the current change. Probably should be similar to the changeset content.

@jatgarg
Copy link
Contributor

jatgarg commented Nov 13, 2024

@MarioJGMsoft Since @jason-ha suggested we can remove the test runtime utils one too in this PR, lets remove that as well. Also update the changeset accordingly.

Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> [email protected] ci:linkcheck /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test ci:start 1313 linkcheck:full

1: starting server using command "npm run ci:start"
and when url "[ 'http://127.0.0.1:1313' ]" is responding with HTTP status code 200
running tests using command "npm run linkcheck:full"


> [email protected] ci:start
> http-server ./public --port 1313 --silent


> [email protected] linkcheck:full
> npm run linkcheck:fast -- --external


> [email protected] linkcheck:fast
> linkcheck http://localhost:1313 --skip-file skipped-urls.txt --external

Crawling...

Stats:
  443760 links
    3414 destination URLs
       2 URLs ignored
       0 warnings
       0 errors


Copy link
Contributor

@Josmithr Josmithr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs changes look good! Thanks!

@MarioJGMsoft MarioJGMsoft merged commit 3aff19a into microsoft:main Nov 14, 2024
32 checks passed
@MarioJGMsoft MarioJGMsoft deleted the ensureNoDataModelChangers branch November 14, 2024 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: runtime Runtime related issues base: main PRs targeted against main branch changeset-present public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove back-compat code related to the op reentry checks
5 participants