-
Notifications
You must be signed in to change notification settings - Fork 547
Add ODSP version attach to OdspContainerServices #24595
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
base: main
Are you sure you want to change the base?
Add ODSP version attach to OdspContainerServices #24595
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
Adds an ODSP-specific attach
method to the OdspContainerServices
API, allowing callers to pass ODSP-only attach properties directly.
- Exposes
attach(odspProps)
onOdspContainerServices
- Updates
getContainerServices
to accept the fluid container instance and return anattach
wrapper - Adds end-to-end tests for successful attach via
services.attach()
and double-attach rejection
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
packages/service-clients/odsp-client/src/odspClient.ts | Pass fluidContainer into getContainerServices and add attach |
packages/service-clients/odsp-client/src/interfaces.ts | Define attach in OdspContainerServices with JSDoc |
packages/service-clients/odsp-client/api-report/odsp-client.beta.api.md | Reflect new attach in beta API report |
packages/service-clients/odsp-client/api-report/odsp-client.alpha.api.md | Reflect new attach in alpha API report |
packages/service-clients/end-to-end-tests/odsp-client/src/test/containerCreate.spec.ts | Add tests for services.attach() behavior |
Comments suppressed due to low confidence (1)
packages/service-clients/odsp-client/src/odspClient.ts:254
- [nitpick] Consider adding a test that passes specific
odspProps
(e.g.,filePath
,fileName
) toservices.attach()
to verify they’re correctly forwarded to the underlying attach call.
attach: async (odspProps?: ContainerAttachProps<OdspContainerAttachProps>) => {
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
@@ -87,6 +91,11 @@ export interface OdspContainerServices { | |||
* Provides an object that facilitates obtaining information about users present in the Fluid session, as well as listeners for roster changes triggered by users joining or leaving the session. | |||
*/ | |||
audience: IOdspAudience; | |||
|
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.
Are users expected to ever construct or implement the OdspContainerServices
interface? Or do we exclusively provide objects of this type to them?
If the latter, we should consider marking the interface as @sealed
so that we can add new members in the future without it being considered a breaking change.
Since this API is @beta
, we can make this change. But adding a non-optional property would normally be breaking (if not sealed).
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 we return this interface in createContainer or getContainer call and very likely we need to add new stuff to this interface for ODSP specific features. I don't think clients need to implement this interface. @vladsud for any comments.
I will try to mark it as sealed.
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.
This is type of out parameter in our API, and we expect no custom implementations.
That said, it's totally normal to construct custom implementation as a mock in tests.
I think sealed is fine.
@@ -87,6 +91,11 @@ export interface OdspContainerServices { | |||
* Provides an object that facilitates obtaining information about users present in the Fluid session, as well as listeners for roster changes triggered by users joining or leaving the session. | |||
*/ | |||
audience: IOdspAudience; | |||
|
|||
/** | |||
* Attach function that is used to attach the container to the ODSP service. This function is specific to the ODSP service and accepts some ODSP specific properties. |
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: I think this can be simplified, given the context (these are ODSP-specific types)
* Attach function that is used to attach the container to the ODSP service. This function is specific to the ODSP service and accepts some ODSP specific properties. | |
* Attaches the container to the ODSP service. |
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.
Can we also add a @param
comment for odspProps
? What does it mean for the user not to provide anything here? We should document the default 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.
I'm not clear why this is needed? OdspContainerAttachProps supposedly supports passing filePath and fileName?
@ChumpChief The reason of this change is that external user has no knowledge of this OdspContainerAttachProps in IFluidContainer's attach method. The old signature is attach(props?: ContainerAttachProps): Promise, where ContainerAttachProps is translated to unknown. To let user be aware of what can be passed to the attach function, I add it to ODSP services, since filePath/fileName only applies to ODSPClient, not AzureClient. The functionalities is working now but the signature is not what we want. |
If it's just a typing issue I would expect we'd try to fix the typing on IFluidContainer then rather than add a second way to call attach() - duplicating the functionality seems confusing to a user. Perhaps IFluidContainer should take a second generic argument for its attach props typing? @sonalideshpandemsft might also have some ideas here. |
@ChumpChief, I think you are giving contradicting guidance here: #22129 (comment) The last time we talked about it, you suggested to go this route. |
@yunho-microsoft , I'd love to see two more additions for this change:
|
I agree with @ChumpChief. The change: #18425 was intended to align Ideally, the |
I don't recall how that conversation ended, but in your link I'm objecting to a new IOdspFluidContainer, not to a new generic on IFluidContainer. Way back in 1.0 release I suggested that we keep attach() off the IFluidContainer but was ultimately overruled. My original proposal was for createContainer() to return Whatever we do here we should keep our patterns consistent across service-clients. |
Description
Add attach function to OdspContainerServices. It is more like exposing the ODSP specific arguments to ODSP client. Previously, the attach is at the IFluidContainer level which is a generic interface. Some arguments like filePath and fileName are not available in the function. But internally, we already support these arguments, through an internal logic by reassigning the attach function at ODSPClient. This change is just to expose it at ODSP interface.
User will be aware of the available args for ODSP specifically and can call OdspContainerServices.attach(odspArgs) to use the ODSP version of the attach function. It will just call the same function as before.
Reviewer Guidance
The review process is outlined on this wiki page.