-
Notifications
You must be signed in to change notification settings - Fork 557
Make internal loadContainerRuntime take in IFluidDataStoreRegistry #25622
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
Open
CraigMacomber
wants to merge
6
commits into
microsoft:main
Choose a base branch
from
CraigMacomber:loadContainerRuntime
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+201
−177
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e79c834
Make internal loadContainerRuntime take in FluidDataStoreRegistry
CraigMacomber 4658473
Update packages/runtime/container-runtime/src/containerRuntime.ts
CraigMacomber 6732268
Better comments
CraigMacomber 2602c80
reintroduce loadRuntime2
CraigMacomber 35c5257
Merge branch 'main' into loadContainerRuntime
CraigMacomber 91b0a8d
Merge branch 'main' of https://github.com/microsoft/FluidFramework in…
CraigMacomber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Based on our end to end tests, it seems like this internal API surface can't change between versions as that breaks stuff.
It seems bad that we don't do type testing, API reports, or special documentation or tagging on APIs that that might be called with incorrect types due to mixing types from one version of the package with implementations from another.
This seems very hard to maintain, and not type safe, but maybe I'm missing something?
I guess I have to put this back, and add a new API instead, but also not use that new API from places that can cross compat layer boundaries (at least until some point in the future determined by layer compat policy?)
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.
IMO, our end-to-end tests should not use internal APIs. If we need access to an API to run such tests, then our customers likely do too.
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.
I don't think this is a case of them using our internal APIs, but rather a case of them using our non-internal APIs, and those APIs using our internal ones. At the very least they don't call this API directly.
This is more of a case of our own internal APIs calling each other across a layer boundary where we can load different versions of the code and doing so in such a way that there is no type checking the two sides are compatible at that level.
At least that's my guess at what I think that's what's happening: I don't have a good understanding of the situation.
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.
We already have a legacy+beta wrapper around this API (a module level function) which I did not change. I hoped leaving that alone would be enough to keep this compatible, but apparently not.
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.
Maybe I'm wrong. Looks like packages/test/test-utils/src/testContainerRuntimeFactory.ts calls
containerRuntimeCtor.loadRuntime
and that's the source of most if not all of the errors.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.
I have no idea if the issue is that test compat uses it, or if there is a real compat issue.
I think overloads here would be more of a mess as it would require the implementation to support both, and if there is a layer compat use of this API it could end up having all future versions have to support both as well, and the code which overrides (the attribution stuff) this method would get extra complicated as well by having to reimplement support for both.
Also I don't see how merging these into a single implementation would allow us to deprecate the old one. Having one combined method seems like it would make deprecation slightly harder not easier, especially given there is an override of this and potential layer compat implications.
Also if we want the test code to be updated to know about the loadRuntime2, having it have a different name would make it possible to detect at runtime, which would make it easier to migrate to in a compatible way.
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.
It would be good to get an answer to this before we make any changes here.
Uh oh!
There was an error while loading. Please reload this page.
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.
Adding @markfields here since he made this internal fairly recently (< a year ago).
I wonder if we can replace the usages in test to
loadContainerRuntime
, then this compat problem will go away eventually (once we are past the compat window).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.
For the specific instance that @CraigMacomber mentioned (packages/test/test-utils/src/testContainerRuntimeFactory.ts calls containerRuntimeCtor.loadRuntime), it seems that we explicitly do this for testing compat with v1.X.
@scottn12 is there any way around this?
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.
I think the issue here is actually not the 1.x clients, since for those clients we fall back to
containerRuntimeCtor.load()
. I believe the issue is that we also test against 2.x minor releases (i.e. we currently test against 2.53.1), which will try to callloadRuntime()
but won't have the updated function if we make changes to it