Skip to content

Live Share SDK 2.0.0#794

Draft
huntj88 wants to merge 54 commits intomainfrom
mainv2
Draft

Live Share SDK 2.0.0#794
huntj88 wants to merge 54 commits intomainfrom
mainv2

Conversation

@huntj88
Copy link
Contributor

@huntj88 huntj88 commented Aug 29, 2024

No description provided.

huntj88 and others added 29 commits February 26, 2024 16:20
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
… bug in `LiveCanvas`, and upgraded Fluid version (#775)
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: Ryan Bliss <smile@ryanbliss.me>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
…bo package (#781)

Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: Ryan Bliss <smile@ryanbliss.me>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
…fter npm install, other V2 prep (#786)

Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: Ryan Bliss <smile@ryanbliss.me>
…m support (#791)

Co-authored-by: James Hunt <jameshunt@microsoft.com>
…0.0, removed references to live-share-turbo
ryanbliss and others added 23 commits August 30, 2024 15:39
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: huntj88 <huntj88@gmail.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: huntj88 <huntj88@gmail.com>
Co-authored-by: Ryan Bliss <smile@ryanbliss.me>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
huntj88 and others added 2 commits January 8, 2026 15:25
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: huntj88 <10103298+huntj88@users.noreply.github.com>
Co-authored-by: James Hunt <jameshunt@microsoft.com>
Comment on lines +12 to +39
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm --loglevel verbose ci --ignore-scripts
timeout-minutes: 20

- run: npm install jest
working-directory: samples/javascript/02.react-video

- name: "build packages and samples"
run: npm run build

# TODO: get scenario_test.sh working

# - name: "test 02.react-video sample"
# shell: "bash"
# run: sh ../../../.github/workflows/scenario_test.sh
# working-directory: samples/javascript/02.react-video

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 days ago

In general, the fix is to add a permissions: block that explicitly scopes the GITHUB_TOKEN to the least privileges the workflow needs. For this workflow, it only checks out code and installs/builds dependencies, so contents: read is sufficient.

The best minimal fix without changing existing behavior is to add a workflow-level permissions: block right after the name: (or before jobs:). This will apply to all jobs that do not define their own permissions. We will set:

permissions:
    contents: read

This ensures that the GITHUB_TOKEN can read repository contents (needed for actions/checkout if the repo is private) but cannot write. No additional methods, imports, or definitions are required; it is purely a YAML configuration change in .github/workflows/live-share-build-samples.yaml.

Concretely, edit .github/workflows/live-share-build-samples.yaml to insert a permissions: section between line 2 and line 3 (between the workflow name and the on: block).

Suggested changeset 1
.github/workflows/live-share-build-samples.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/live-share-build-samples.yaml b/.github/workflows/live-share-build-samples.yaml
--- a/.github/workflows/live-share-build-samples.yaml
+++ b/.github/workflows/live-share-build-samples.yaml
@@ -1,5 +1,8 @@
 name: Build Live Share SDK samples
 
+permissions:
+    contents: read
+
 on:
     push:
         branches: [main, mainv2]
EOF
@@ -1,5 +1,8 @@
name: Build Live Share SDK samples

permissions:
contents: read

on:
push:
branches: [main, mainv2]
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +12 to +31
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- run: npm --loglevel verbose ci --ignore-scripts
timeout-minutes: 20

- name: "check formatting"
run: "bash checkFormatting.sh"
working-directory: .github/workflows

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 days ago

In general, the fix is to explicitly declare a permissions block for the workflow or for the specific job, setting least‑privilege scopes instead of relying on inherited defaults. For a formatting‑check workflow that only needs to read the repository contents, contents: read is an appropriate minimal setting.

For this concrete file, the simplest and least intrusive fix is to add a root‑level permissions: block (applies to all jobs) immediately after the name: or on: section, specifying only contents: read. This documents the intent and ensures the GITHUB_TOKEN cannot write to the repository even if the org/repo default is broader. No additional libraries, imports, or functional changes are required because permissions configuration is purely declarative in the workflow YAML.

Concretely: in .github/workflows/live-share-formatting.yaml, insert:

permissions:
    contents: read

right after the on: block (or right after name:); keeping existing indentation consistent with the file. No other edits are needed.

Suggested changeset 1
.github/workflows/live-share-formatting.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/live-share-formatting.yaml b/.github/workflows/live-share-formatting.yaml
--- a/.github/workflows/live-share-formatting.yaml
+++ b/.github/workflows/live-share-formatting.yaml
@@ -7,6 +7,9 @@
         branches: [main, mainv2, "user/**", "copilot/**"]
     workflow_dispatch:
 
+permissions:
+    contents: read
+
 jobs:
     build:
         runs-on: ubuntu-latest
EOF
@@ -7,6 +7,9 @@
branches: [main, mainv2, "user/**", "copilot/**"]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +12 to +40
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm --loglevel verbose ci --ignore-scripts
timeout-minutes: 20

- run: npm run prepare # will trigger a build of all packages

- name: "test live-share"
run: npm run test
working-directory: packages/live-share

- name: "test live-share-canvas"
run: npm run test
working-directory: packages/live-share-canvas

- name: "test live-share-media"
run: npm run test
working-directory: packages/live-share-media

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 days ago

Generally, this issue is fixed by adding an explicit permissions block to the workflow or specific job(s), limiting GITHUB_TOKEN to the minimal required scopes (typically contents: read for a pure CI job). This prevents the workflow from inheriting broader default permissions from the repository or organization.

For this workflow, the best fix without changing functionality is to add a permissions block at the workflow root (top-level, alongside name and on). The job only checks out code and runs Node/npm commands; it does not need to write to the repository or other resources via the GitHub API. Therefore, contents: read is sufficient and matches the minimal starting point suggested by CodeQL. Concretely, in .github/workflows/live-share-test-packages.yaml, insert:

permissions:
    contents: read

between the existing on: block and the jobs: block (i.e., after line 8 and before line 10). No additional imports, methods, or definitions are needed since this is just a YAML configuration change.

Suggested changeset 1
.github/workflows/live-share-test-packages.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/live-share-test-packages.yaml b/.github/workflows/live-share-test-packages.yaml
--- a/.github/workflows/live-share-test-packages.yaml
+++ b/.github/workflows/live-share-test-packages.yaml
@@ -7,6 +7,9 @@
         branches: [main, mainv2, "user/**", "copilot/**"]
     workflow_dispatch:
 
+permissions:
+    contents: read
+
 jobs:
     build:
         runs-on: ubuntu-latest
EOF
@@ -7,6 +7,9 @@
branches: [main, mainv2, "user/**", "copilot/**"]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Copilot is powered by AI and may make mistakes. Always verify output.
Comment on lines +12 to +45
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm --loglevel verbose ci --ignore-scripts
timeout-minutes: 20

- run: npm run prepare # will trigger a build of all packages

- name: "test live-share with cjs app"
run: npm run test
working-directory: internal/usage-test/cjs-test

- name: "test live-share with esm app"
run: npm run test
working-directory: internal/usage-test/esm-test

- uses: pnpm/action-setup@v4
name: Install pnpm for next step
with:
version: 9
run_install: false
- name: "test live-share with pnpm typescript esm app"
run: pnpm run test
working-directory: internal/usage-test/pnpm-test

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 days ago

In general, the fix is to add an explicit permissions: block declaring the minimal scopes needed by this workflow. For a test-only workflow that just checks out code and runs Node/npm/pnpm commands, contents: read is typically sufficient. Declaring this at the workflow root will apply to all jobs that do not override permissions.

The single best fix here, without changing functionality, is to add a root-level permissions: block right after the name: (before on:) in .github/workflows/live-share-test-usage.yaml:

name: Test Usage of Live Share SDK packages in different JS environments
permissions:
    contents: read

This restricts the GITHUB_TOKEN to read-only access to repository contents, which supports actions/checkout@v4 and normal test execution, while avoiding unnecessary write powers. No additional imports, methods, or other definitions are needed; it is purely a YAML configuration change in this workflow file.

Suggested changeset 1
.github/workflows/live-share-test-usage.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/live-share-test-usage.yaml b/.github/workflows/live-share-test-usage.yaml
--- a/.github/workflows/live-share-test-usage.yaml
+++ b/.github/workflows/live-share-test-usage.yaml
@@ -1,4 +1,6 @@
 name: Test Usage of Live Share SDK packages in different JS environments
+permissions:
+    contents: read
 
 on:
     push:
EOF
@@ -1,4 +1,6 @@
name: Test Usage of Live Share SDK packages in different JS environments
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment