Skip to content

Deprecate containerPackageInfo parameter in createOdspCreateContainerRequest #23919

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

Merged
merged 29 commits into from
Apr 14, 2025

Conversation

MarioJGMsoft
Copy link
Contributor

@MarioJGMsoft MarioJGMsoft commented Feb 25, 2025

Description

As of PR #22849 (released in 2.23), preferred pattern to add "containerPackageName" parameter to request is via URL resolver instead of createOdspCreateContainerRequest's last parameter.
Tag calling createOdspCreateContainerRequest with that parameter as deprecated now, and then in the 2.40 release remove that form altogether.

Future Breaking Changes

See issue 23882 for more details.

Reviewer Guidance

Please let me know if there's anything else I should be aware of or can do better, thanks!

Fixes: AB#31450

@github-actions github-actions bot added area: examples Changes that focus on our examples area: tests Tests to add, test infrastructure improvements, etc labels Feb 25, 2025
@@ -11,6 +11,7 @@ import {
} from "@fluidframework/odsp-doclib-utils/internal";
import {
OdspDriverUrlResolver,
// eslint-disable-next-line import/no-deprecated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to disable import no deprecated, because even though the version that is being imported is technically not the deprecated version, eslint detected that it was using that one. Does anyone know if there's a better way to deprecate the parameter?

Copy link
Contributor

Choose a reason for hiding this comment

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

The linter doesn't understand / is being conservative. This is okay, but should add a comment with the work item that will clean this up.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the only alternative might be to import the module as in import * as OdspDriver from "....
But since it is temporary, this is good enough.

Copy link
Contributor

Choose a reason for hiding this comment

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

Still looking for comment with the work item number.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comment

Copy link
Contributor

Choose a reason for hiding this comment

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

I recently learned of a better format to comment lint disables using --:

	// eslint-disable-next-line import/no-deprecated -- This is the non-deprecated call, but eslint doesn't distinguish. TODO AB#31049 remove suppression

@MarioJGMsoft MarioJGMsoft marked this pull request as ready for review February 27, 2025 17:57
@MarioJGMsoft MarioJGMsoft requested a review from a team as a code owner February 27, 2025 17:57
@MarioJGMsoft MarioJGMsoft requested review from a team, pragya91, markfields, jason-ha, jatgarg, kian-thompson, WillieHabi and rajatch5 and removed request for a team February 27, 2025 17:57
Josmithr
Josmithr previously approved these changes Feb 27, 2025
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.

Left a suggestion to enhance the deprecation notice comment. Otherwise, the API changes look good.

Comment on lines +14 to 17
// eslint-disable-next-line import/no-deprecated
createOdspCreateContainerRequest,
createOdspUrl,
} from "@fluidframework/odsp-driver/internal";
Copy link
Contributor

Choose a reason for hiding this comment

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

This is an example and should not be importing from /internal. Recommend fixing these when we have to touch them. See examples that use examples/.eslintrc.cjs and/or examples/.eslintrc.data.cjs.

Copy link
Member

Choose a reason for hiding this comment

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

cc @Abe27342 and @alexvy86 -- We were just talking about these in Foundation Enhancements meeting. This example which does stuff with ODSP Driver probably should be in a different group of examples that are internal-only. We don't expect anyone in the public to be doing anything with ODSP Driver.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should none of the odsp-driver exports be /legacy then? At least some of these are and should be okay to use /legacy import instead of /internal.

Copy link
Contributor

Choose a reason for hiding this comment

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

thread nudge

Copy link
Contributor

Choose a reason for hiding this comment

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

more aggressive nudge (@markfields , @Abe27342 , @alexvy86 )

Comment on lines +15 to 18
// eslint-disable-next-line import/no-deprecated
createOdspCreateContainerRequest,
createOdspUrl,
} from "@fluidframework/odsp-driver/internal";
Copy link
Contributor

Choose a reason for hiding this comment

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

Other option for this and other /internal import is to make the /internal export only export the non-deprecated version.
The how-to is covered at https://github.com/microsoft/FluidFramework/wiki/Change-Recipes#moving-api-to-internal

The ./internal.ts version could look like:

export const odspCreateContainerRequest: (
	siteUrl: string,
	driveId: string,
	filePath: string,
	fileName: string,
	createShareLinkType?: ISharingLinkKind,
) => ReturnType<typeof createOdspCreateContainerRequestOriginal> = createOdspCreateContainerRequestOriginal;

Since there are only two internal uses, may not be worth the effort.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's not worth the effort.

@jason-ha
Copy link
Contributor

I don't quite follow this statement in the description: "With PR: #22849 we introduced a parameter for ODSP that will not be used."
The parameter is used when passed. When present there will be a query parameter containerPackageName=....
Maybe you mean to say that there is alternative? Or are you saying that the generated QP will later be ignored?

@MarioJGMsoft
Copy link
Contributor Author

I don't quite follow this statement in the description: "With PR: #22849 we introduced a parameter for ODSP that will not be used." The parameter is used when passed. When present there will be a query parameter containerPackageName=.... Maybe you mean to say that there is alternative? Or are you saying that the generated QP will later be ignored?

The query parameter (I'm guessing that's what QP stands for), will later be ignored. The new alternative is that it can be added in the constructor of OdspDriverUrlResolverForShareLink. Then it will be processed and added when it resolves a request.

Therefore, having the parameter in the request is unnecessary.

@jason-ha
Copy link
Contributor

jason-ha commented Feb 27, 2025

I don't quite follow this statement in the description: "With PR: #22849 we introduced a parameter for ODSP that will not be used." The parameter is used when passed. When present there will be a query parameter containerPackageName=.... Maybe you mean to say that there is alternative? Or are you saying that the generated QP will later be ignored?

The query parameter (I'm guessing that's what QP stands for), will later be ignored. The new alternative is that it can be added in the constructor of OdspDriverUrlResolverForShareLink. Then it will be processed and added when it resolves a request.

Therefore, having the parameter in the request is unnecessary.

I am not sure I understand what it exactly means to be processed and added when the request is resolved. Sounds like the deprecation issue needs some more content. If originally someone passed containerPackageInfo and got IRequest.url with containerPackageName=... that was then ..??.., what are all of the changes that are needed to get the same effect? Sounds like something should be changed in some resolver.?

@jason-ha jason-ha dismissed Josmithr’s stale review February 27, 2025 19:58

ts-docs need corrected

@github-actions github-actions bot added area: examples Changes that focus on our examples area: tests Tests to add, test infrastructure improvements, etc labels Mar 28, 2025
@@ -11,6 +11,7 @@ import {
} from "@fluidframework/odsp-doclib-utils/internal";
import {
OdspDriverUrlResolver,
// eslint-disable-next-line import/no-deprecated
Copy link
Contributor

Choose a reason for hiding this comment

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

I recently learned of a better format to comment lint disables using --:

	// eslint-disable-next-line import/no-deprecated -- This is the non-deprecated call, but eslint doesn't distinguish. TODO AB#31049 remove suppression

"section": deprecation
---

The parameter `containerPackageInfo` in `createOdspCreateContainerRequest()` is deprecated and will be removed in version 2.40.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The parameter `containerPackageInfo` in `createOdspCreateContainerRequest()` is deprecated and will be removed in version 2.40.
Deprecate the `containerPackageInfo` parameter in `createOdspCreateContainerRequest()`

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied changes

Copy link
Contributor

Choose a reason for hiding this comment

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

@tylerbutler and @jzaffiro - I think Mario got comments both ways on whether the removal version should be included in this text.


The parameter `containerPackageInfo` in `createOdspCreateContainerRequest()` is deprecated and will be removed in version 2.40.

This will mean that the name of the containerPackage can no longer be sent through the request. Instead it can be added in the constructor of `OdspDriverUrlResolverForShareLink`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This will mean that the name of the containerPackage can no longer be sent through the request. Instead it can be added in the constructor of `OdspDriverUrlResolverForShareLink`.
The name of the containerPackage can no longer be sent through the request. This functionality will be removed in version 2.40. Instead, it can be added in the constructor of `OdspDriverUrlResolverForShareLink`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied changes

Copy link
Contributor

@jzaffiro jzaffiro left a comment

Choose a reason for hiding this comment

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

Changeset looks good to me!

@tylerbutler tylerbutler added the release-blocking Must be addressed before we cut and publish the next release label Apr 14, 2025
Copy link
Member

@tylerbutler tylerbutler left a comment

Choose a reason for hiding this comment

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

Approving for docs.

Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  163664 links
    1315 destination URLs
    1547 URLs ignored
       0 warnings
       0 errors


@jatgarg jatgarg merged commit 42b26b7 into microsoft:main Apr 14, 2025
36 checks passed
@MarioJGMsoft MarioJGMsoft deleted the deprecateRPI branch April 24, 2025 20:57
MarioJGMsoft added a commit that referenced this pull request May 27, 2025
…ontainerRequest` (#24481)

## Description

When communicating with partners about work of [issue
#23882](#23882), I
realized that the code that was meant to be deleted will actually still
be used, so there no longer is any need for the deprecation and removal.

This PR is meant to be a revert for this one [PR
#23919](https://github.com/microsoft/FluidFramework/pull/23919/files)

## Breaking Changes

This will close [issue
#23882](#23882)
without actually deleting any code.

## Reviewer Guidance

Let me know if you have any questions related to the revert or the code
in general.

Fixes:
[AB#31049](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/31049)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: driver Driver related issues area: examples Changes that focus on our examples area: odsp-driver area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch changeset-present public api change Changes to a public API release-blocking Must be addressed before we cut and publish the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Won't Fix] Remove parameter in createOdspCreateContainerRequest() in v2.40
8 participants