Skip to content

Fix the ODSP shared tree demo issue #24627

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

Conversation

yunho-microsoft
Copy link
Contributor

@yunho-microsoft yunho-microsoft commented May 14, 2025

Description

The example cannot get correct environment example for local run. Fix it by adding plugin in webpack config. The reason is webpack doesn't load environment variables by default. It only works in Node environment.

@yunho-microsoft yunho-microsoft requested review from Copilot and sonalideshpandemsft and removed request for Copilot May 14, 2025 22:19
@github-actions github-actions bot added area: examples Changes that focus on our examples base: main PRs targeted against main branch labels May 14, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR ensures the shared-tree demo can read environment variables locally by injecting them via Webpack and updating related configs and docs.

  • Injects process.env variables in webpack.config.cjs using DefinePlugin
  • Adds "node" types in tsconfig.json and refines clientProps.ts to cast env vars
  • Updates README and .env.template to guide users on environment variable setup

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
examples/service-clients/odsp-client/shared-tree-demo/webpack.config.cjs Added DefinePlugin entries for SITE_URL, SPE_DRIVE_ID, SPE_CLIENT_ID, SPE_ENTRA_TENANT_ID
examples/service-clients/odsp-client/shared-tree-demo/tsconfig.json Included "node" in types to support process.env
examples/service-clients/odsp-client/shared-tree-demo/src/clientProps.ts Removed custom process declaration and added as string casts for env vars
examples/service-clients/odsp-client/shared-tree-demo/README.md Revised instructions to use environment variables from .env.template
examples/service-clients/odsp-client/shared-tree-demo/.env.template Renamed DRIVE_ID to SPE_DRIVE_ID for consistency

@@ -10,7 +10,7 @@ All the code required to set up the Fluid Framework and SharedTree data structur

You can run this example using the following steps:

1. To kick off the example, update the credentials in the `clientProps.ts` file by replacing siteUrl, driveId, and clientId with your own.
1. To kick off the example, update the environment variable by replacing siteUrl, driveId, clientId, entra id with your own. Please check detailed environment variable names in .env.template
Copy link
Preview

Copilot AI May 14, 2025

Choose a reason for hiding this comment

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

[nitpick] Capitalize and clarify 'entra id' to 'Entra Tenant ID' to match the variable SPE_ENTRA_TENANT_ID and maintain consistency.

Suggested change
1. To kick off the example, update the environment variable by replacing siteUrl, driveId, clientId, entra id with your own. Please check detailed environment variable names in .env.template
1. To kick off the example, update the environment variable by replacing siteUrl, driveId, clientId, Entra Tenant ID with your own. Please check detailed environment variable names in .env.template

Copilot uses AI. Check for mistakes.

@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label May 16, 2025
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:
  210260 links
    1663 destination URLs
    1895 URLs ignored
       0 warnings
       0 errors


@yunho-microsoft yunho-microsoft merged commit 9216202 into microsoft:main May 19, 2025
41 checks passed
@yunho-microsoft yunho-microsoft deleted the yunho/fixSharedTreeDemo branch May 20, 2025 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: examples Changes that focus on our examples base: main PRs targeted against main branch dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants